[no-issue] Parallel run e2e and e2e common action refactoring (#4702)

This commit is contained in:
Eugenio Romano
2019-05-13 04:44:35 +02:00
committed by GitHub
parent a48bfc3714
commit 898e3b5a80
288 changed files with 8704 additions and 5130 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { SearchResultsPage } from '../../pages/adf/searchResultsPage';
import { SearchFiltersPage } from '../../pages/adf/searchFiltersPage';
import { SearchDialog } from '../../pages/adf/dialog/searchDialog';
@@ -81,9 +81,9 @@ describe('Search Checklist Component', () => {
await browser.driver.sleep(15000);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.get(TestConfig.adf.url + '/search;q=' + randomName + '');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=' + randomName + '');
done();
});
@@ -139,8 +139,7 @@ describe('Search Checklist Component', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C277143] Should be able to click show more/less button with pageSize set as default', async () => {
@@ -283,12 +282,11 @@ describe('Search Checklist Component', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});

View File

@@ -191,8 +191,7 @@ describe('Search Date Range Filter', () => {
let jsonFile;
beforeAll(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C277117] Should be able to change date format', async () => {

View File

@@ -392,8 +392,7 @@ describe('Search Number Range Filter', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C276928] Should be able to change the field property for number range', async () => {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { SearchFiltersPage } from '../../pages/adf/searchFiltersPage';
import { SearchResultsPage } from '../../pages/adf/searchResultsPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
@@ -67,9 +67,7 @@ describe('Search Radio Component', () => {
});
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
createdFolder = await this.alfrescoJsApi.nodes.addNode('-my-', {
@@ -83,9 +81,9 @@ describe('Search Radio Component', () => {
await browser.driver.sleep(15000);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.get(TestConfig.adf.url + '/search;q=' + randomName);
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=' + randomName);
done();
});
@@ -138,8 +136,7 @@ describe('Search Radio Component', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C277147] Should be able to customise the pageSize value', async () => {
@@ -259,12 +256,11 @@ describe('Search Radio Component', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});

View File

@@ -78,8 +78,11 @@ describe('Search Number Range Filter', () => {
});
afterAll(async (done) => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, file2Bytes.entry.id);
try {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, file2Bytes.entry.id);
} catch (error) {
}
done();
});
@@ -158,8 +161,7 @@ describe('Search Number Range Filter', () => {
let jsonFile;
beforeEach(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C276983] Should be able to disable thumb label in Search Size Slider', async () => {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { LoginPage, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
import { SearchDialog } from '../../pages/adf/dialog/searchDialog';
import { SearchResultsPage } from '../../pages/adf/searchResultsPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
@@ -98,7 +98,7 @@ describe('Search Sorting Picker', () => {
});
afterEach(async (done) => {
await browser.get(TestConfig.adf.url);
await BrowserActions.getUrl(TestConfig.adf.url);
done();
});
@@ -112,8 +112,7 @@ describe('Search Sorting Picker', () => {
it('[C277271] Should be able to add a custom search sorter in the "sort by" option', async () => {
navigationBar.clickContentServicesButton();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
jsonFile.sorting.options.push({
'key': 'Modifier',
'label': 'Modifier',
@@ -135,8 +134,7 @@ describe('Search Sorting Picker', () => {
it('[C277272] Should be able to exclude a standard search sorter from the sorting option', async () => {
navigationBar.clickContentServicesButton();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
const removedOption = jsonFile.sorting.options.splice(0, 1);
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
@@ -153,8 +151,7 @@ describe('Search Sorting Picker', () => {
it('[C277273] Should be able to set a default order for a search sorting option', async () => {
navigationBar.clickContentServicesButton();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
jsonFile.sorting.options[0].ascending = false;
jsonFile.sorting.defaults[0] = {
'key': 'Size',
@@ -220,8 +217,7 @@ describe('Search Sorting Picker', () => {
it('[C277288] Should be able to sort the search results by "Modified Date" ASC', async () => {
navigationBar.clickContentServicesButton();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
jsonFile.sorting.options.push({
'key': 'Modified Date',
'label': 'Modified Date',
@@ -254,8 +250,7 @@ describe('Search Sorting Picker', () => {
it('[C277301] Should be able to change default sorting option for the search results', async () => {
navigationBar.clickContentServicesButton();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
jsonFile.sorting.options.push({
'key': 'createdByUser',
'label': 'Author',

View File

@@ -24,7 +24,7 @@ import TestConfig = require('../../test.config');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { LoginPage, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
import { SearchDialog } from '../../pages/adf/dialog/searchDialog';
import { SearchResultsPage } from '../../pages/adf/searchResultsPage';
import { SearchFiltersPage } from '../../pages/adf/searchFiltersPage';
@@ -68,13 +68,13 @@ describe('Search component - Text widget', () => {
await browser.driver.sleep(15000);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
it('[C289329] Placeholder should be displayed in the widget when the input string is empty', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchResultPage.tableIsLoaded();
searchFiltersPage.checkNameFilterIsDisplayed();
@@ -86,12 +86,11 @@ describe('Search component - Text widget', () => {
let jsonFile;
beforeAll(() => {
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
});
it('[C289330] Should be able to change the Field setting', async () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchResultPage.tableIsLoaded();
searchFiltersPage.checkCheckListFilterIsDisplayed();

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, protractor } from 'protractor';
import { browser } from 'protractor';
import { LoginPage } from '@alfresco/adf-testing';
import { SearchDialog } from '../pages/adf/dialog/searchDialog';
@@ -29,7 +29,7 @@ import { FolderModel } from '../models/ACS/folderModel';
import TestConfig = require('../test.config');
import { Util } from '../util/util';
import { StringUtil, LocalStorageUtil } from '@alfresco/adf-testing';
import { StringUtil, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '../actions/ACS/upload.actions';
@@ -89,9 +89,7 @@ describe('Search component - Search Bar', () => {
});
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
@@ -114,7 +112,7 @@ describe('Search component - Search Bar', () => {
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
@@ -130,7 +128,7 @@ describe('Search component - Search Bar', () => {
});
afterEach(async (done) => {
await browser.get(TestConfig.adf.url);
await BrowserActions.getUrl(TestConfig.adf.url);
done();
});
@@ -144,7 +142,7 @@ describe('Search component - Search Bar', () => {
.checkSearchBarIsVisible()
.checkSearchIconIsVisible();
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
BrowserActions.closeMenuAndDialogs();
searchDialog
.checkSearchBarIsNotVisible()
@@ -305,7 +303,7 @@ describe('Search component - Search Bar', () => {
const navigationBar = new NavigationBarPage();
const searchConfiguration = new SearchConfiguration().getConfiguration();
const searchConfiguration = SearchConfiguration.getConfiguration();
beforeAll(async () => {
navigationBar.clickContentServicesButton();

View File

@@ -24,7 +24,7 @@ import { FileModel } from '../models/ACS/fileModel';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import TestConfig = require('../test.config');
import { StringUtil, DocumentListPage, PaginationPage, LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { StringUtil, DocumentListPage, PaginationPage, LoginPage, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
import resources = require('../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
@@ -104,15 +104,14 @@ describe('Search Filters', () => {
fileTypeTxt2 = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel2.location, txtFileModel2.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
searchDialog.checkSearchIconIsVisible();
searchDialog.clickOnSearchIcon();
const searchConfiguration = new SearchConfiguration();
jsonFile = searchConfiguration.getConfiguration();
jsonFile = SearchConfiguration.getConfiguration();
done();
});
@@ -142,7 +141,7 @@ describe('Search Filters', () => {
});
it('[C277146] Should Show more/less buttons be hidden when inactive', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchFiltersPage.creatorCheckListFiltersPage().checkShowLessButtonIsNotDisplayed()
.checkShowMoreButtonIsDisplayed()
@@ -152,7 +151,7 @@ describe('Search Filters', () => {
});
it('[C286556] Search categories should preserve their collapsed/expanded state after the search', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchFiltersPage.clickFileTypeListFilter()
.checkFileTypeFilterIsCollapsed()
@@ -166,7 +165,7 @@ describe('Search Filters', () => {
});
it('[C287796] Should be able to display the correct bucket number after selecting a filter', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchFiltersPage.fileTypeCheckListFiltersPage().clickCheckListOption('PNG Image');
@@ -200,7 +199,7 @@ describe('Search Filters', () => {
});
it('[C291980] Should group search facets under specified labels', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed()
.checkTypeFacetQueryGroupIsDisplayed()
@@ -223,7 +222,7 @@ describe('Search Filters', () => {
});
it('[C297509] Should display search intervals under specified labels from config', () => {
browser.get(TestConfig.adf.url + '/search;q=*');
BrowserActions.getUrl(TestConfig.adf.url + '/search;q=*');
searchFiltersPage.checkFacetIntervalsByCreatedIsDisplayed()
.checkFacetIntervalsByCreatedIsExpanded()

View File

@@ -96,8 +96,8 @@ describe('Search Component - Multi-Select Facet', () => {
done();
});
it('[C280054] Should be able to select multiple items from a search facet filter', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
it('[C280054] Should be able to select multiple items from a search facet filter', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
searchDialog.checkSearchIconIsVisible();
searchDialog.clickOnSearchIcon();
@@ -167,8 +167,8 @@ describe('Search Component - Multi-Select Facet', () => {
done();
});
it('[C280056] Should be able to select multiple items from multiple search facet filters', () => {
loginPage.loginToContentServicesUsingUserModel(userUploadingImg);
it('[C280056] Should be able to select multiple items from multiple search facet filters', async () => {
await loginPage.loginToContentServicesUsingUserModel(userUploadingImg);
searchDialog.checkSearchIconIsVisible();
searchDialog.clickOnSearchIcon();
@@ -224,8 +224,8 @@ describe('Search Component - Multi-Select Facet', () => {
done();
});
it('[C280058] Should update filter facets items number when another filter facet item is selected', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
it('[C280058] Should update filter facets items number when another filter facet item is selected', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
searchDialog.checkSearchIconIsVisible();
searchDialog.clickOnSearchIcon();

View File

@@ -98,7 +98,7 @@ describe('Search component - Search Page', () => {
browser.driver.sleep(15000);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});

View File

@@ -17,10 +17,7 @@
export class SearchConfiguration {
constructor() {
}
getConfiguration() {
static getConfiguration() {
return {
'app:fields': [
'cm:name',