Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -79,7 +79,7 @@ describe('Search component - Search Bar', () => {
let fileHighlightUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -103,178 +103,161 @@ describe('Search component - Search Bar', () => {
filesToDelete.push(await uploadActions.createFolder(secondFolder.name, '-my-'));
filesToDelete.push(await uploadActions.createFolder(thirdFolder.name, '-my-'));
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
await browser.sleep(15000); // wait search index previous file/folder uploaded
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
filesToDelete.forEach(async (currentNode) => {
afterAll(async () => {
for (const currentNode of filesToDelete) {
await uploadActions.deleteFileOrFolder(currentNode.entry.id);
});
}
await navigationBarPage.clickLogoutButton();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url);
done();
});
it('[C272798] Search bar should be visible', () => {
searchDialog
.checkSearchBarIsNotVisible()
.checkSearchIconIsVisible();
it('[C272798] Search bar should be visible', async () => {
await searchDialog.checkSearchBarIsNotVisible();
await searchDialog.checkSearchIconIsVisible();
searchDialog
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.checkSearchIconIsVisible();
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
searchDialog
.checkSearchBarIsNotVisible()
.checkSearchIconIsVisible();
await searchDialog.checkSearchBarIsNotVisible();
await searchDialog.checkSearchIconIsVisible();
});
it('[C272799] Should be possible to hide search bar after input', () => {
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.enterText(firstFolderModel.shortName);
it('[C272799] Should be possible to hide search bar after input', async () => {
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.enterText(firstFolderModel.shortName);
});
it('[C260255] Should display message when searching for an inexistent file', () => {
searchDialog
.checkSearchBarIsNotVisible()
.clickOnSearchIcon()
.checkNoResultMessageIsNotDisplayed()
.enterText(search.inactive.name)
.checkNoResultMessageIsDisplayed();
it('[C260255] Should display message when searching for an inexistent file', async () => {
await searchDialog.checkSearchBarIsNotVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkNoResultMessageIsNotDisplayed();
await searchDialog.enterText(search.inactive.name);
await searchDialog.checkNoResultMessageIsDisplayed();
});
it('[C260256] Should display file/folder in search suggestion when typing first characters', () => {
searchDialog
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterText(firstFolderModel.shortName);
it('[C260256] Should display file/folder in search suggestion when typing first characters', async () => {
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterText(firstFolderModel.shortName);
searchDialog.resultTableContainsRow(firstFolderModel.name);
await searchDialog.resultTableContainsRow(firstFolderModel.name);
expect(searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.shortName);
expect(searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
expect(searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
await expect(await searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.shortName);
await expect(await searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await expect(await searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
searchDialog.clearText();
await searchDialog.clearText();
searchDialog.clickOnSearchIcon().enterText(firstFileModel.shortName);
searchDialog.resultTableContainsRow(firstFileModel.name);
await searchDialog.clickOnSearchIcon();
await searchDialog.enterText(firstFileModel.shortName);
await searchDialog.resultTableContainsRow(firstFileModel.name);
expect(searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.shortName);
expect(searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await expect(await searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.shortName);
await expect(await searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
expect(searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
await expect(await searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
});
it('[C272800] Should display file/folder in search suggestion when typing name', () => {
searchDialog
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterText(firstFolderModel.name);
it('[C272800] Should display file/folder in search suggestion when typing name', async () => {
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterText(firstFolderModel.name);
searchDialog.resultTableContainsRow(firstFolderModel.name);
await searchDialog.resultTableContainsRow(firstFolderModel.name);
expect(searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.name);
expect(searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
expect(searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
await expect(await searchDialog.getSpecificRowsHighlightName(firstFolderModel.name)).toEqual(firstFolderModel.name);
await expect(await searchDialog.getSpecificRowsAuthor(firstFolderModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await expect(await searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
searchDialog.clearText();
await searchDialog.clearText();
searchDialog.clickOnSearchIcon().enterText(firstFileModel.name);
searchDialog.resultTableContainsRow(firstFileModel.name);
await searchDialog.clickOnSearchIcon();
await searchDialog.enterText(firstFileModel.name);
await searchDialog.resultTableContainsRow(firstFileModel.name);
expect(searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.name);
expect(searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
expect(searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
await expect(await searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.name);
await expect(await searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await expect(await searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
});
it('[C260257] Should display content when clicking on folder from search suggestions', async () => {
searchDialog
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterText(firstFolderModel.shortName);
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterText(firstFolderModel.shortName);
searchDialog.resultTableContainsRow(firstFolderModel.name);
searchDialog.clickOnSpecificRow(firstFolderModel.name);
await searchDialog.resultTableContainsRow(firstFolderModel.name);
await searchDialog.clickOnSpecificRow(firstFolderModel.name);
expect(contentServicesPage.currentFolderName()).toEqual(firstFolderModel.name);
await expect(await contentServicesPage.currentFolderName()).toEqual(firstFolderModel.name);
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterText(firstFileModel.name)
.resultTableContainsRow(firstFileModel.name);
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterText(firstFileModel.name);
await searchDialog.resultTableContainsRow(firstFileModel.name);
searchDialog.clickOnSpecificRow(firstFileModel.name);
expect(await viewerPage.getDisplayedFileName()).toEqual(firstFileModel.name);
await searchDialog.clickOnSpecificRow(firstFileModel.name);
await expect(await viewerPage.getDisplayedFileName()).toEqual(firstFileModel.name);
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C272801] Should display message when searching for non-existent folder', () => {
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterTextAndPressEnter(search.inactive.name);
it('[C272801] Should display message when searching for non-existent folder', async () => {
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterTextAndPressEnter(search.inactive.name);
searchResultPage.checkNoResultMessageIsDisplayed();
await searchResultPage.checkNoResultMessageIsDisplayed();
});
it('[C272802] Should be able to find an existent folder in search results', () => {
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterTextAndPressEnter(firstFolderModel.name);
it('[C272802] Should be able to find an existent folder in search results', async () => {
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterTextAndPressEnter(firstFolderModel.name);
searchResultPage.checkContentIsDisplayed(firstFolderModel.name);
await searchResultPage.checkContentIsDisplayed(firstFolderModel.name);
});
it('[C260258] Should be able to find an existent file in search results', () => {
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterTextAndPressEnter(firstFileModel.name);
it('[C260258] Should be able to find an existent file in search results', async () => {
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterTextAndPressEnter(firstFileModel.name);
searchResultPage.checkContentIsDisplayed(firstFileModel.name);
await searchResultPage.checkContentIsDisplayed(firstFileModel.name);
});
it('[C91321] Should be able to use down arrow key when navigating throw suggestions', () => {
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterText(secondFolder.shortName)
.pressDownArrowAndEnter();
it('[C91321] Should be able to use down arrow key when navigating throw suggestions', async () => {
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterText(secondFolder.shortName);
await searchDialog.pressDownArrowAndEnter();
searchResultPage.tableIsLoaded();
expect(contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
await expect(await contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
});
it('[C290137] Should be able to search by \'%\'', () => {
searchDialog
.clickOnSearchIcon()
.enterTextAndPressEnter('%');
searchResultPage.tableIsLoaded();
it('[C290137] Should be able to search by \'%\'', async () => {
await searchDialog.clickOnSearchIcon();
await searchDialog.enterTextAndPressEnter('%');
await searchResultPage.tableIsLoaded();
});
describe('Highlight', () => {
@@ -282,22 +265,20 @@ describe('Search component - Search Bar', () => {
const searchConfiguration = SearchConfiguration.getConfiguration();
beforeAll(async () => {
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
await LocalStorageUtil.setConfigField('search', JSON.stringify(searchConfiguration));
searchDialog
.checkSearchIconIsVisible()
.clickOnSearchIcon()
.checkSearchBarIsVisible()
.enterTextAndPressEnter(term);
await searchDialog.checkSearchIconIsVisible();
await searchDialog.clickOnSearchIcon();
await searchDialog.checkSearchBarIsVisible();
await searchDialog.enterTextAndPressEnter(term);
});
it('[C299212] Should be able to configure the highlight option for search results', () => {
searchResultPage.getNodeHighlight(fileHighlightUploaded.entry.name).getText().then((text) => {
expect(text.includes(`¿${term}?`)).toBe(true);
expect(text.includes(`(${term})`)).toBe(true);
});
it('[C299212] Should be able to configure the highlight option for search results', async () => {
const text = await searchResultPage.getNodeHighlight(fileHighlightUploaded.entry.name).getText();
await expect(text.includes(`¿${term}?`)).toBe(true);
await expect(text.includes(`(${term})`)).toBe(true);
});
});
});