[ACA] fix e2e tests failing on slow environments (#801)

* fix tests failing on slow environments

* forgot a change
This commit is contained in:
Adina Parpalita
2018-11-14 17:23:33 +02:00
committed by Denys Vuika
parent 49e80ddce1
commit 2ac59bd278
6 changed files with 17 additions and 13 deletions

View File

@@ -57,7 +57,7 @@ export class CreateOrEditFolderDialog extends Component {
} }
async waitForDialogToClose() { async waitForDialogToClose() {
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT); await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for dialog to close ----');
} }
async isDialogOpen() { async isDialogOpen() {

View File

@@ -38,7 +38,7 @@ export class SearchInput extends Component {
optionCheckbox: '.mat-checkbox' optionCheckbox: '.mat-checkbox'
}; };
searchButton: ElementFinder = browser.element(by.css(SearchInput.selectors.searchButton)); searchButton: ElementFinder = this.component.element(by.css(SearchInput.selectors.searchButton));
searchContainer: ElementFinder = browser.element(by.css(SearchInput.selectors.searchContainer)); searchContainer: ElementFinder = browser.element(by.css(SearchInput.selectors.searchContainer));
searchBar: ElementFinder = browser.element(by.id(SearchInput.selectors.searchInput)); searchBar: ElementFinder = browser.element(by.id(SearchInput.selectors.searchInput));
searchOptionsArea: ElementFinder = browser.element(by.id(SearchInput.selectors.searchOptionsArea)); searchOptionsArea: ElementFinder = browser.element(by.id(SearchInput.selectors.searchOptionsArea));
@@ -54,8 +54,8 @@ export class SearchInput extends Component {
return (await this.searchContainer.isDisplayed()) && (await this.searchButton.isDisplayed()); return (await this.searchContainer.isDisplayed()) && (await this.searchButton.isDisplayed());
} }
async clickSearchContainer() { async clickSearchButton() {
return await this.searchContainer.click(); await this.searchButton.click();
} }
async isOptionsAreaDisplayed() { async isOptionsAreaDisplayed() {
@@ -105,8 +105,6 @@ export class SearchInput extends Component {
return optClass.includes('mat-checkbox-checked'); return optClass.includes('mat-checkbox-checked');
} }
async searchForText(text: string) { async searchForText(text: string) {
await this.searchBar.clear(); await this.searchBar.clear();
await this.searchBar.sendKeys(text); await this.searchBar.sendKeys(text);

View File

@@ -65,6 +65,12 @@ describe('General', () => {
expect(message).toEqual('The action was unsuccessful. Try again or contact your IT Team.'); expect(message).toEqual('The action was unsuccessful. Try again or contact your IT Team.');
expect(await browser.getTitle()).toContain('Sign in'); expect(await browser.getTitle()).toContain('Sign in');
try {
await createDialog.waitForDialogToClose();
} catch (error) {
console.log('err: ', error);
}
expect(await createDialog.isDialogOpen()).not.toBe(true, 'dialog is present'); expect(await createDialog.isDialogOpen()).not.toBe(true, 'dialog is present');
}); });
}); });

View File

@@ -125,7 +125,7 @@ describe('Page titles', () => {
}); });
it('Search Results page - [C280413]', async () => { it('Search Results page - [C280413]', async () => {
await searchInput.clickSearchContainer(); await searchInput.clickSearchButton();
await searchInput.searchForText(file); await searchInput.searchForText(file);
expect(await browser.getTitle()).toContain(PAGE_TITLES.SEARCH); expect(await browser.getTitle()).toContain(PAGE_TITLES.SEARCH);
}); });

View File

@@ -48,7 +48,7 @@ describe('Search input', () => {
}); });
it('Search options are displayed when clicking in the search input - [C289848]', async () => { it('Search options are displayed when clicking in the search input - [C289848]', async () => {
await searchInput.clickSearchContainer(); await searchInput.clickSearchButton();
expect(await searchInput.isOptionsAreaDisplayed()).toBe(true, '1. Search options not displayed'); expect(await searchInput.isOptionsAreaDisplayed()).toBe(true, '1. Search options not displayed');
expect(await searchInput.isFilesOptionEnabled()).toBe(true, '2. Files option not enabled'); expect(await searchInput.isFilesOptionEnabled()).toBe(true, '2. Files option not enabled');
expect(await searchInput.isFoldersOptionEnabled()).toBe(true, '3. Folders option not enabled'); expect(await searchInput.isFoldersOptionEnabled()).toBe(true, '3. Folders option not enabled');
@@ -59,7 +59,7 @@ describe('Search input', () => {
}); });
it('Search options are correctly enabled / disabled - [C289849]', async () => { it('Search options are correctly enabled / disabled - [C289849]', async () => {
await searchInput.clickSearchContainer(); await searchInput.clickSearchButton();
await searchInput.clickFilesOption(); await searchInput.clickFilesOption();
expect(await searchInput.isFoldersOptionEnabled()).toBe(true, 'Folders option not enabled'); expect(await searchInput.isFoldersOptionEnabled()).toBe(true, 'Folders option not enabled');