From 24f5f01900e46ac4b165803d5b770ab9ad92f442 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Fri, 21 Dec 2018 17:04:13 +0200 Subject: [PATCH] [ACA-1928] e2e improvements - part2 (#884) * refactor Mark as favourite tests rename method to be more clear create separate methods for some checks and actions * forgot some changes * refactor delete-undo tests * some more refactoring * fix * small improvements / refactoring --- e2e/components/data-table/data-table.ts | 25 ++- e2e/components/header/header.ts | 8 +- e2e/components/header/user-info.ts | 6 +- e2e/components/info-drawer/info-drawer.ts | 159 ++++++++++-------- e2e/components/login/login.ts | 18 +- e2e/components/pagination/pagination.ts | 60 ++++++- e2e/pages/page.ts | 22 +-- e2e/suites/actions/delete-undo-delete.test.ts | 24 +-- .../extensions/ext-document-list.test.ts | 24 ++- .../info-drawer/library-properties.test.ts | 46 ++--- e2e/suites/list-views/empty-list.test.ts | 84 ++++----- e2e/suites/list-views/favorites.test.ts | 8 +- e2e/suites/list-views/file-libraries.test.ts | 68 ++------ e2e/suites/list-views/personal-files.test.ts | 12 +- e2e/suites/list-views/recent-files.test.ts | 12 +- e2e/suites/list-views/shared-files.test.ts | 8 +- e2e/suites/list-views/trash.test.ts | 22 +-- e2e/suites/navigation/breadcrumb.test.ts | 5 +- e2e/suites/pagination/pag-favorites.test.ts | 48 +++--- .../pagination/pag-file-libraries.test.ts | 46 ++--- .../pagination/pag-personal-files.test.ts | 46 ++--- .../pagination/pag-recent-files.test.ts | 48 +++--- .../pagination/pag-search-results.test.ts | 48 +++--- .../pagination/pag-shared-files.test.ts | 48 +++--- e2e/suites/pagination/pag-single-page.test.ts | 14 +- e2e/suites/pagination/pag-trash.test.ts | 48 +++--- e2e/suites/search/search-input.test.ts | 6 +- .../search/search-results-libraries.test.ts | 38 ++--- protractor.conf.js | 3 +- 29 files changed, 511 insertions(+), 493 deletions(-) diff --git a/e2e/components/data-table/data-table.ts b/e2e/components/data-table/data-table.ts index d65912c52..588c8b009 100755 --- a/e2e/components/data-table/data-table.ts +++ b/e2e/components/data-table/data-table.ts @@ -94,7 +94,7 @@ export class DataTable extends Component { return this.head.all(locator); } - async getHeaderText() { + async getColumnHeadersText() { const el = this.getColumnHeaders(); return await el.getText(); } @@ -319,4 +319,27 @@ export class DataTable extends Component { async isItemPresent(name: string) { return await this.getRowByName(name).isPresent(); } + + async getEntireDataTableText() { + return this.getRows().map((row) => { + return row.all(this.cell).map(async cell => await cell.getText()); + }); + } + + async getSitesNameAndVisibility() { + const data = await this.getEntireDataTableText(); + return data.reduce((acc, cell) => { + acc[cell[1]] = cell[3].toUpperCase(); + return acc; + }, {}); + } + + async getSitesNameAndRole() { + const data = await this.getEntireDataTableText(); + return data.reduce((acc, cell) => { + acc[cell[1]] = cell[2]; + return acc; + }, {}); + } + } diff --git a/e2e/components/header/header.ts b/e2e/components/header/header.ts index 37c2bc8a2..38cc412f4 100755 --- a/e2e/components/header/header.ts +++ b/e2e/components/header/header.ts @@ -31,17 +31,17 @@ import { Toolbar } from './../toolbar/toolbar'; import { SearchInput } from '../search/search-input'; export class Header extends Component { - private locators = { + private static selectors = { root: 'app-header', logoLink: by.css('.app-menu__title'), userInfo: by.css('aca-current-user'), moreActions: by.id('app.header.more') }; - logoLink: ElementFinder = this.component.element(this.locators.logoLink); - userInfo: UserInfo = new UserInfo(this.component); - moreActions: ElementFinder = browser.element(this.locators.moreActions); + logoLink: ElementFinder = this.component.element(Header.selectors.logoLink); + moreActions: ElementFinder = browser.element(Header.selectors.moreActions); + userInfo: UserInfo = new UserInfo(this.component); menu: Menu = new Menu(); toolbar: Toolbar = new Toolbar(); searchInput: SearchInput = new SearchInput(); diff --git a/e2e/components/header/user-info.ts b/e2e/components/header/user-info.ts index 805a257d0..1900f8d59 100755 --- a/e2e/components/header/user-info.ts +++ b/e2e/components/header/user-info.ts @@ -28,14 +28,14 @@ import { Menu } from '../menu/menu'; import { Component } from '../component'; export class UserInfo extends Component { - private locators = { + private static selectors = { avatar: by.css('.current-user__avatar'), fullName: by.css('.current-user__full-name'), menuItems: by.css('[mat-menu-item]') }; - fullName: ElementFinder = this.component.element(this.locators.fullName); - avatar: ElementFinder = this.component.element(this.locators.avatar); + fullName: ElementFinder = this.component.element(UserInfo.selectors.fullName); + avatar: ElementFinder = this.component.element(UserInfo.selectors.avatar); menu: Menu = new Menu(); diff --git a/e2e/components/info-drawer/info-drawer.ts b/e2e/components/info-drawer/info-drawer.ts index ba4a7a5fc..47fdd6fbd 100755 --- a/e2e/components/info-drawer/info-drawer.ts +++ b/e2e/components/info-drawer/info-drawer.ts @@ -26,7 +26,6 @@ import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC } from 'protractor'; import { Component } from '../component'; import { BROWSER_WAIT_TIMEOUT } from '../../configs'; -import { Utils } from './../../utilities/utils'; export class InfoDrawer extends Component { private static selectors = { @@ -86,6 +85,7 @@ export class InfoDrawer extends Component { super(InfoDrawer.selectors.root, ancestor); } + async waitForInfoDrawerToOpen() { return await browser.wait(EC.presenceOf(this.header), BROWSER_WAIT_TIMEOUT); } @@ -95,10 +95,7 @@ export class InfoDrawer extends Component { } async isEmpty() { - if (await browser.isElementPresent(by.css(InfoDrawer.selectors.tabs))) { - return false; - } - return true; + return !(await browser.isElementPresent(by.css(InfoDrawer.selectors.tabs))); } getTabByTitle(title: string) { @@ -146,12 +143,6 @@ export class InfoDrawer extends Component { return this.getFieldByName(fieldName).isEnabled(); } - async isVisibilityEnabled() { - const wrapper = this.getLabelWrapper('Visibility'); - const field = wrapper.element(by.xpath('..')).element(by.css(InfoDrawer.selectors.dropDown)); - return await field.isEnabled(); - } - async getValueOfField(fieldName: string) { return await this.getFieldByName(fieldName).getText(); } @@ -162,11 +153,6 @@ export class InfoDrawer extends Component { return await input.sendKeys(text); } - async typeTextInInput(fieldName: string, text: string) { - const input = this.getFieldByName(fieldName); - await input.clear(); - return await Utils.typeInField(input, text); - } getButton(button: string) { return this.component.element(by.cssContainingText(InfoDrawer.selectors.metadataTabAction, button)); @@ -184,15 +170,21 @@ export class InfoDrawer extends Component { return await this.getButton(button).click(); } - async isButtonDisabled(button: string) { - try { - const disabled = await this.getButton(button).getAttribute('disabled'); - return disabled; - } catch (error) { - console.log('----- isButtonDisabled catch: ', error); - } + async waitForVisibilityDropDownToOpen() { + await browser.wait(EC.presenceOf(this.visibilityDropDown), BROWSER_WAIT_TIMEOUT); } + async waitForVisibilityDropDownToClose() { + await browser.wait(EC.stalenessOf(browser.$('.mat-option .mat-option-text')), BROWSER_WAIT_TIMEOUT); + } + + // --------------- + + async isAboutTabDisplayed() { + return await this.isTabDisplayed('About'); + } + + async isMessageDisplayed() { return await browser.isElementPresent(this.hint); } @@ -210,80 +202,59 @@ export class InfoDrawer extends Component { } - // --------------- async isNameDisplayed() { return await this.isFieldDisplayed('Name'); } - async isDescriptionDisplayed() { - return await this.isFieldDisplayed('Description'); - } - - async isVisibilityDisplayed() { - return await this.isFieldDisplayed('Visibility'); - } - - async isLibraryIdDisplayed() { - return await this.isFieldDisplayed('Library ID'); - } - - async getName() { - return await this.getValueOfField('Name'); - } - - async getVisibility() { - return await this.getValueOfField('Visibility'); - } - - async getLibraryId() { - return await this.getValueOfField('Library ID'); - } - - async getDescription() { - return await this.getValueOfField('Description'); - } - async isNameEnabled() { return await this.isInputEnabled('Name'); } - async isLibraryIdEnabled() { - return await this.isInputEnabled('Library ID'); - } - - async isDescriptionEnabled() { - return await this.isInputEnabled('Description'); + async getName() { + return await this.getValueOfField('Name'); } async enterName(name: string) { return await this.enterTextInInput('Name', name); } - async typeName(name: string) { - return await this.typeTextInInput('Name', name); + + async isDescriptionDisplayed() { + return await this.isFieldDisplayed('Description'); + } + + async isDescriptionEnabled() { + return await this.isInputEnabled('Description'); + } + + async getDescription() { + return await this.getValueOfField('Description'); } async enterDescription(desc: string) { return await this.enterTextInInput('Description', desc); } - async typeDescription(desc: string) { - return await this.typeTextInInput('Description', desc); + + async isVisibilityEnabled() { + const wrapper = this.getLabelWrapper('Visibility'); + const field = wrapper.element(by.xpath('..')).element(by.css(InfoDrawer.selectors.dropDown)); + return await field.isEnabled(); } - async waitForDropDownToOpen() { - await browser.wait(EC.presenceOf(this.visibilityDropDown), BROWSER_WAIT_TIMEOUT); + async isVisibilityDisplayed() { + return await this.isFieldDisplayed('Visibility'); } - async waitForDropDownToClose() { - await browser.wait(EC.stalenessOf(browser.$('.mat-option .mat-option-text')), BROWSER_WAIT_TIMEOUT); + async getVisibility() { + return await this.getValueOfField('Visibility'); } async setVisibility(visibility: string) { const val = visibility.toLowerCase(); await this.visibilityDropDown.click(); - await this.waitForDropDownToOpen(); + await this.waitForVisibilityDropDownToOpen(); if (val === 'public') { await this.visibilityPublic.click(); @@ -295,7 +266,59 @@ export class InfoDrawer extends Component { console.log('----- invalid visibility', val); } - await this.waitForDropDownToClose(); + await this.waitForVisibilityDropDownToClose(); + } + + + async isLibraryIdDisplayed() { + return await this.isFieldDisplayed('Library ID'); + } + + async isLibraryIdEnabled() { + return await this.isInputEnabled('Library ID'); + } + + async getLibraryId() { + return await this.getValueOfField('Library ID'); + } + + + async isEditEnabled() { + return await this.isButtonEnabled('Edit'); + } + + async isEditDisplayed() { + return await this.isButtonDisplayed('Edit'); + } + + async clickEdit() { + return await this.clickButton('Edit'); + } + + + async isUpdateEnabled() { + return await this.isButtonEnabled('Update'); + } + + async isUpdateDisplayed() { + return await this.isButtonDisplayed('Update'); + } + + async clickUpdate() { + return await this.clickButton('Update'); + } + + + async isCancelEnabled() { + return await this.isButtonEnabled('Cancel'); + } + + async isCancelDisplayed() { + return await this.isButtonDisplayed('Cancel'); + } + + async clickCancel() { + return await this.clickButton('Cancel'); } } diff --git a/e2e/components/login/login.ts b/e2e/components/login/login.ts index 865d5146b..6fadc2f77 100755 --- a/e2e/components/login/login.ts +++ b/e2e/components/login/login.ts @@ -27,9 +27,9 @@ import { by, ElementFinder } from 'protractor'; import { Component } from '../component'; export class LoginComponent extends Component { - static selector = 'adf-login'; + private static selectors = { + root: 'adf-login', - private locators = { usernameInput: by.css('input#username'), passwordInput: by.css('input#password'), passwordVisibility: by.css('.adf-login-password-icon'), @@ -38,15 +38,15 @@ export class LoginComponent extends Component { copyright: by.css('.adf-copyright') }; - usernameInput: ElementFinder = this.component.element(this.locators.usernameInput); - passwordInput: ElementFinder = this.component.element(this.locators.passwordInput); - submitButton: ElementFinder = this.component.element(this.locators.submitButton); - errorMessage: ElementFinder = this.component.element(this.locators.errorMessage); - copyright: ElementFinder = this.component.element(this.locators.copyright); - passwordVisibility: ElementFinder = this.component.element(this.locators.passwordVisibility); + usernameInput: ElementFinder = this.component.element(LoginComponent.selectors.usernameInput); + passwordInput: ElementFinder = this.component.element(LoginComponent.selectors.passwordInput); + submitButton: ElementFinder = this.component.element(LoginComponent.selectors.submitButton); + errorMessage: ElementFinder = this.component.element(LoginComponent.selectors.errorMessage); + copyright: ElementFinder = this.component.element(LoginComponent.selectors.copyright); + passwordVisibility: ElementFinder = this.component.element(LoginComponent.selectors.passwordVisibility); constructor(ancestor?: ElementFinder) { - super(LoginComponent.selector, ancestor); + super(LoginComponent.selectors.root, ancestor); } async enterUsername(username: string) { diff --git a/e2e/components/pagination/pagination.ts b/e2e/components/pagination/pagination.ts index 04326ace8..369514374 100755 --- a/e2e/components/pagination/pagination.ts +++ b/e2e/components/pagination/pagination.ts @@ -26,7 +26,7 @@ import { ElementFinder, by } from 'protractor'; import { Menu } from '../menu/menu'; import { Component } from '../component'; - +import { browser } from 'protractor'; export class Pagination extends Component { private static selectors = { root: 'adf-pagination', @@ -61,7 +61,6 @@ export class Pagination extends Component { await maxItemsButton.click(); await menu.waitForMenuToOpen(); - // return menu; } async openCurrentPageMenu() { @@ -69,11 +68,6 @@ export class Pagination extends Component { await pagesButton.click(); await menu.waitForMenuToOpen(); - // return menu; - } - - async getText(elem: ElementFinder) { - return await elem.getText(); } async resetToDefaultPageSize() { @@ -95,4 +89,56 @@ export class Pagination extends Component { async clickPrevious() { await this.previousButton.click(); } + + async isNextEnabled() { + return await this.nextButton.isEnabled(); + } + + async isPreviousEnabled() { + return await this.previousButton.isEnabled(); + } + + async isPagesButtonPresent() { + return await browser.isElementPresent(this.pagesButton); + } + + async isRangePresent() { + return await this.range.isPresent(); + } + + async isMaxItemsPresent() { + return await this.maxItems.isPresent(); + } + + async isCurrentPagePresent() { + return await this.currentPage.isPresent(); + } + + async isTotalPagesPresent() { + return await this.totalPages.isPresent(); + } + + async isPreviousButtonPresent() { + return await this.previousButton.isPresent(); + } + + async isNextButtonPresent() { + return await this.nextButton.isPresent(); + } + + async getCurrentPage() { + return await this.currentPage.getText(); + } + + async getRange() { + return await this.range.getText(); + } + + async getMaxItems() { + return await this.maxItems.getText(); + } + + async getTotalPages() { + return await this.totalPages.getText(); + } } diff --git a/e2e/pages/page.ts b/e2e/pages/page.ts index 2070cbb9d..8eb8bc093 100755 --- a/e2e/pages/page.ts +++ b/e2e/pages/page.ts @@ -27,7 +27,7 @@ import { browser, by, ElementFinder, ExpectedConditions as EC, until } from 'pro import { BROWSER_WAIT_TIMEOUT, USE_HASH_STRATEGY } from './../configs'; export abstract class Page { - private static locators = { + private static selectors = { app: 'app-root', layout: 'app-layout', overlay: '.cdk-overlay-container', @@ -41,17 +41,17 @@ export abstract class Page { genericErrorTitle: '.generic-error__title' }; - app: ElementFinder = browser.element(by.css(Page.locators.app)); - layout: ElementFinder = browser.element(by.css(Page.locators.layout)); - overlay: ElementFinder = browser.element(by.css(Page.locators.overlay)); - snackBar: ElementFinder = browser.element(by.css(Page.locators.snackBar)); - dialogContainer: ElementFinder = browser.element(by.css(Page.locators.dialogContainer)); - snackBarContainer: ElementFinder = browser.element(by.css(Page.locators.snackBarContainer)); - snackBarAction: ElementFinder = browser.element(by.css(Page.locators.snackBarAction)); + app: ElementFinder = browser.element(by.css(Page.selectors.app)); + layout: ElementFinder = browser.element(by.css(Page.selectors.layout)); + overlay: ElementFinder = browser.element(by.css(Page.selectors.overlay)); + snackBar: ElementFinder = browser.element(by.css(Page.selectors.snackBar)); + dialogContainer: ElementFinder = browser.element(by.css(Page.selectors.dialogContainer)); + snackBarContainer: ElementFinder = browser.element(by.css(Page.selectors.snackBarContainer)); + snackBarAction: ElementFinder = browser.element(by.css(Page.selectors.snackBarAction)); - genericError: ElementFinder = browser.element(by.css(Page.locators.genericError)); - genericErrorIcon: ElementFinder = browser.element(by.css(Page.locators.genericErrorIcon)); - genericErrorTitle: ElementFinder = browser.element(by.css(Page.locators.genericErrorTitle)); + genericError: ElementFinder = browser.element(by.css(Page.selectors.genericError)); + genericErrorIcon: ElementFinder = browser.element(by.css(Page.selectors.genericErrorIcon)); + genericErrorTitle: ElementFinder = browser.element(by.css(Page.selectors.genericErrorTitle)); constructor(public url: string = '') {} diff --git a/e2e/suites/actions/delete-undo-delete.test.ts b/e2e/suites/actions/delete-undo-delete.test.ts index b1f8fa3f5..7e81f0ca6 100755 --- a/e2e/suites/actions/delete-undo-delete.test.ts +++ b/e2e/suites/actions/delete-undo-delete.test.ts @@ -136,7 +136,7 @@ describe('Delete and undo delete', () => { expect(message).toContain(`Undo`); expect(await dataTable.isItemPresent(file1)).toBe(false, 'Item was not removed from list'); items--; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(file1)).toBe(true, 'Item is not in trash'); }); @@ -150,7 +150,7 @@ describe('Delete and undo delete', () => { expect(await dataTable.isItemPresent(file2)).toBe(false, `${file2} was not removed from list`); expect(await dataTable.isItemPresent(file3)).toBe(false, `${file3} was not removed from list`); items = items - 2; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} is not in trash`); expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} is not in trash`); @@ -162,7 +162,7 @@ describe('Delete and undo delete', () => { await toolbar.clickMoreActionsDelete(); expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not removed from list'); items--; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(folder1)).toBe(true, 'Item is not in trash'); expect(await dataTable.isItemPresent(file1InFolder)).toBe(false, 'Item is in trash'); @@ -204,7 +204,7 @@ describe('Delete and undo delete', () => { await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(file5)).toBe(true, 'Item was not restored'); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); }); it('undo delete of folder with content - [C280503]', async () => { @@ -214,7 +214,7 @@ describe('Delete and undo delete', () => { await toolbar.clickMoreActionsDelete(); await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(folder6)).toBe(true, 'Item was not restored'); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await dataTable.doubleClickOnRowByName(folder6); expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, 'file from folder not restored'); }); @@ -227,7 +227,7 @@ describe('Delete and undo delete', () => { await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(file6)).toBe(true, `${file6} was not removed from list`); expect(await dataTable.isItemPresent(file7)).toBe(true, `${file7} was not removed from list`); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); }); }); @@ -404,7 +404,7 @@ describe('Delete and undo delete', () => { expect(message).toContain(`Undo`); expect(await dataTable.isItemPresent(favFile1)).toBe(false, 'Item was not removed from list'); items--; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(favFile1)).toBe(true, 'Item is not in trash'); }); @@ -420,7 +420,7 @@ describe('Delete and undo delete', () => { expect(await dataTable.isItemPresent(favFile2)).toBe(false, `${favFile2} was not removed from list`); expect(await dataTable.isItemPresent(favFile3)).toBe(false, `${favFile3} was not removed from list`); items = items - 2; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(favFile2)).toBe(true, `${favFile2} is not in trash`); expect(await dataTable.isItemPresent(favFile3)).toBe(true, `${favFile3} is not in trash`); @@ -432,7 +432,7 @@ describe('Delete and undo delete', () => { await toolbar.clickMoreActionsDelete(); expect(await dataTable.isItemPresent(favFolder1)).toBe(false, 'Item was not removed from list'); items--; - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await page.clickTrash(); expect(await dataTable.isItemPresent(favFolder1)).toBe(true, 'Item is not in trash'); expect(await dataTable.isItemPresent(file1InFolder)).toBe(false, 'Item is in trash'); @@ -472,7 +472,7 @@ describe('Delete and undo delete', () => { await toolbar.clickMoreActionsDelete(); await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(favFile5)).toBe(true, 'Item was not restored'); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); }); it('undo delete of folder with content - [C280526]', async () => { @@ -482,7 +482,7 @@ describe('Delete and undo delete', () => { await toolbar.clickMoreActionsDelete(); await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(favFolder6)).toBe(true, 'Item was not restored'); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); await dataTable.doubleClickOnRowByName(favFolder6); expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, 'file from folder not restored'); }); @@ -495,7 +495,7 @@ describe('Delete and undo delete', () => { await page.clickSnackBarAction(); expect(await dataTable.isItemPresent(favFile6)).toBe(true, `${favFile6} was not removed from list`); expect(await dataTable.isItemPresent(favFile7)).toBe(true, `${favFile7} was not removed from list`); - expect(await page.pagination.range.getText()).toContain(`1-${items} of ${items}`); + expect(await page.pagination.getRange()).toContain(`1-${items} of ${items}`); }); }); diff --git a/e2e/suites/extensions/ext-document-list.test.ts b/e2e/suites/extensions/ext-document-list.test.ts index e0d1d95cd..ca3d560ea 100644 --- a/e2e/suites/extensions/ext-document-list.test.ts +++ b/e2e/suites/extensions/ext-document-list.test.ts @@ -36,24 +36,24 @@ describe('Extensions - DocumentList presets', () => { const testData = [ { id: 'app.files.name', - fixtureLabel: 'Name' + label: 'Name' }, { id: 'app.files.thumbnail', - fixtureLabel: 'Thumbnail' + label: 'Thumbnail' }, { id: 'app.files.size', - fixtureLabel: 'Size', + label: 'Size', disabled: true }, { id: 'app.files.modifiedBy', - fixtureLabel: 'Test header' + label: 'Test header' }, { id: 'some.id.createdBy', - fixtureLabel: 'New column' + label: 'New column' } ]; @@ -88,20 +88,16 @@ describe('Extensions - DocumentList presets', () => { }); it('Sets the columns to display - [C286700]', async () => { - const labels = testData + const expectedColumns = testData .filter(item => !item.disabled) - .map(data => data.fixtureLabel); - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + .map(data => data.label); + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(labels.length, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('Disabled items are not shown - [C286699]', async () => { - const noColumnLabel = testData.find(item => item.disabled).fixtureLabel; + const noColumnLabel = testData.find(item => item.disabled).label; const element = dataTable.getColumnHeaderByLabel(noColumnLabel); expect(await element.isPresent()).toBe(false, `"${noColumnLabel}" is displayed`); diff --git a/e2e/suites/info-drawer/library-properties.test.ts b/e2e/suites/info-drawer/library-properties.test.ts index 5ac7a28dd..7e8dd04d7 100755 --- a/e2e/suites/info-drawer/library-properties.test.ts +++ b/e2e/suites/info-drawer/library-properties.test.ts @@ -107,7 +107,7 @@ describe('Library properties', () => { await infoDrawer.waitForInfoDrawerToOpen(); expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); - expect(await infoDrawer.isTabPresent('About')).toBe(true, 'About tab is not displayed'); + expect(await infoDrawer.isAboutTabDisplayed()).toBe(true, 'About tab is not displayed'); expect(await infoDrawer.isNameDisplayed()).toBe(true, 'Name field not displayed'); expect(await infoDrawer.isLibraryIdDisplayed()).toBe(true, 'Library ID field not displayed'); expect(await infoDrawer.isVisibilityDisplayed()).toBe(true, 'Visibility field not displayed'); @@ -118,7 +118,7 @@ describe('Library properties', () => { expect((await infoDrawer.getVisibility()).toLowerCase()).toEqual((site.visibility).toLowerCase()); expect(await infoDrawer.getDescription()).toEqual(site.description); - expect(await infoDrawer.isButtonDisplayed('Edit')).toBe(true, 'Edit action is not displayed'); + expect(await infoDrawer.isEditDisplayed()).toBe(true, 'Edit action is not displayed'); }); it('Editable properties - [C289338]', async () => { @@ -126,18 +126,18 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isButtonEnabled('Edit')).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickButton('Edit'); + expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); + await infoDrawer.clickEdit(); expect(await infoDrawer.isNameEnabled()).toBe(true, 'Name field not enabled'); expect(await infoDrawer.isLibraryIdEnabled()).toBe(false, 'Library ID field not disabled'); expect(await infoDrawer.isVisibilityEnabled()).toBe(true, 'Visibility field not enabled'); expect(await infoDrawer.isDescriptionEnabled()).toBe(true, 'Description field not enabled'); - expect(await infoDrawer.isButtonDisplayed('Cancel')).toBe(true, 'Cancel button not displayed'); - expect(await infoDrawer.isButtonDisplayed('Update')).toBe(true, 'Update button not displayed'); - expect(await infoDrawer.isButtonEnabled('Cancel')).toBe(true, 'Cancel button not enabled'); - expect(await infoDrawer.isButtonEnabled('Update')).toBe(false, 'Update button not disabled'); + expect(await infoDrawer.isCancelDisplayed()).toBe(true, 'Cancel button not displayed'); + expect(await infoDrawer.isUpdateDisplayed()).toBe(true, 'Update button not displayed'); + expect(await infoDrawer.isCancelEnabled()).toBe(true, 'Cancel button not enabled'); + expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); it('Edit site details - [C289339]', async () => { @@ -145,15 +145,15 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isButtonEnabled('Edit')).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickButton('Edit'); + expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); + await infoDrawer.clickEdit(); await infoDrawer.enterName(siteUpdated.name); await infoDrawer.enterDescription(siteUpdated.description); await infoDrawer.setVisibility(siteUpdated.visibility); - expect(await infoDrawer.isButtonEnabled('Update')).toBe(true, 'Update button not enabled'); + expect(await infoDrawer.isUpdateEnabled()).toBe(true, 'Update button not enabled'); - await infoDrawer.clickButton('Update'); + await infoDrawer.clickUpdate(); expect(await page.getSnackBarMessage()).toEqual('Library properties updated'); expect(await dataTable.isItemPresent(siteUpdated.name)).toBe(true, 'New site name not displayed in the list'); @@ -172,14 +172,14 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isButtonEnabled('Edit')).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickButton('Edit'); + expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); + await infoDrawer.clickEdit(); await infoDrawer.enterName(newName); await infoDrawer.enterDescription(newDesc); await infoDrawer.setVisibility(SITE_VISIBILITY.MODERATED); - await infoDrawer.clickButton('Cancel'); + await infoDrawer.clickCancel(); expect(await dataTable.isItemPresent(newName)).toBe(false, 'New site name is displayed in the list'); expect(await dataTable.isItemPresent(site.name)).toBe(true, 'Original site name not displayed in the list'); @@ -192,7 +192,7 @@ describe('Library properties', () => { await dataTable.selectItem(siteDup); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickButton('Edit'); + await infoDrawer.clickEdit(); await infoDrawer.enterName(site.name); expect(await infoDrawer.isMessageDisplayed()).toBe(true, 'Message not displayed'); @@ -203,26 +203,26 @@ describe('Library properties', () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickButton('Edit'); + await infoDrawer.clickEdit(); await infoDrawer.enterName(Utils.string257); await Utils.pressTab(); expect(await infoDrawer.isErrorDisplayed()).toBe(true, 'Message not displayed'); expect(await infoDrawer.getError()).toEqual('Use 256 characters or less for title'); - expect(await infoDrawer.isButtonEnabled('Update')).toBe(false, 'Update button not disabled'); + expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); it('Site description too long - [C289343]', async () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickButton('Edit'); + await infoDrawer.clickEdit(); await infoDrawer.enterDescription(Utils.string513); await Utils.pressTab(); expect(await infoDrawer.isErrorDisplayed()).toBe(true, 'Message not displayed'); expect(await infoDrawer.getError()).toEqual('Use 512 characters or less for description'); - expect(await infoDrawer.isButtonEnabled('Update')).toBe(false, 'Update button not disabled'); + expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); describe('Non manager', () => { @@ -238,7 +238,7 @@ describe('Library properties', () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isButtonDisplayed('Edit')).toBe(false, 'Edit action is displayed'); + expect(await infoDrawer.isEditDisplayed()).toBe(false, 'Edit action is displayed'); }); it('Error notification - [C289344]', async () => { @@ -248,12 +248,12 @@ describe('Library properties', () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickButton('Edit'); + await infoDrawer.clickEdit(); await apis.user.sites.updateSiteMember(site.id, user3, SITE_ROLES.SITE_CONSUMER.ROLE); await infoDrawer.enterDescription('new description'); - await infoDrawer.clickButton('Update'); + await infoDrawer.clickUpdate(); expect(await page.getSnackBarMessage()).toEqual('There was an error updating library properties'); }); diff --git a/e2e/suites/list-views/empty-list.test.ts b/e2e/suites/list-views/empty-list.test.ts index 879f12a49..97ad27f8e 100755 --- a/e2e/suites/list-views/empty-list.test.ts +++ b/e2e/suites/list-views/empty-list.test.ts @@ -98,62 +98,62 @@ describe('Empty list views', () => { it('Favorites - pagination controls not displayed - [C280111]', async () => { await page.clickFavorites(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('File Libraries - pagination controls not displayed - [C280084]', async () => { await page.clickFileLibraries(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('Personal Files - pagination controls not displayed - [C280075]', async () => { await page.clickPersonalFiles(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('Recent Files - pagination controls not displayed - [C280102]', async () => { await page.clickRecentFiles(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('Shared Files - pagination controls not displayed - [C280094]', async () => { await page.clickSharedFiles(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('Trash - pagination controls not displayed - [C280120]', async () => { await page.clickTrash(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); it('Search results - pagination controls not displayed - [C290123]', async () => { @@ -163,11 +163,11 @@ describe('Empty list views', () => { await searchInput.searchFor('qwertyuiop'); await dataTable.waitForBody(); - expect(await pagination.range.isPresent()).toBe(false); - expect(await pagination.maxItems.isPresent()).toBe(false); - expect(await pagination.currentPage.isPresent()).toBe(false); - expect(await pagination.totalPages.isPresent()).toBe(false); - expect(await pagination.previousButton.isPresent()).toBe(false); - expect(await pagination.nextButton.isPresent()).toBe(false); + expect(await pagination.isRangePresent()).toBe(false, 'Range is present'); + expect(await pagination.isMaxItemsPresent()).toBe(false, 'Max items is present'); + expect(await pagination.isCurrentPagePresent()).toBe(false, 'Current page is present'); + expect(await pagination.isTotalPagesPresent()).toBe(false, 'Total pages is present'); + expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); + expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); }); diff --git a/e2e/suites/list-views/favorites.test.ts b/e2e/suites/list-views/favorites.test.ts index 56245dcce..f2394ef53 100755 --- a/e2e/suites/list-views/favorites.test.ts +++ b/e2e/suites/list-views/favorites.test.ts @@ -88,12 +88,10 @@ describe('Favorites', () => { }); it('has the correct columns - [C280482]', async () => { - const expectedHeader = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by' ]; - const headers = dataTable.getColumnHeaders(); - const count = await headers.count(); - expect(count).toBe(5 + 1, 'Incorrect number of columns'); + const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getHeaderText()).toEqual(expectedHeader); + expect(actualColumns).toEqual(expectedColumns); }); it('displays the favorite files and folders - [C213226]', async () => { diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts index 97be64c47..c9d22662a 100755 --- a/e2e/suites/list-views/file-libraries.test.ts +++ b/e2e/suites/list-views/file-libraries.test.ts @@ -105,14 +105,10 @@ describe('File Libraries', () => { }); it('has the correct columns - [C217095]', async () => { - const labels = [ 'Name', 'My Role', 'Visibility' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(3 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('User can see only the sites he is a member of - [C280501]', async () => { @@ -129,17 +125,11 @@ describe('File Libraries', () => { [userSitePublic]: SITE_VISIBILITY.PUBLIC }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[3].toUpperCase(); - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndVisibility(); - Object.keys(expectedSitesVisibility).forEach((site) => { + for (const site of Object.keys(expectedSitesVisibility)) { expect(sitesList[site]).toEqual(expectedSitesVisibility[site]); - }); + } }); it('User role is correctly displayed - [C289903]', async () => { @@ -150,17 +140,11 @@ describe('File Libraries', () => { [adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[2]; - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndRole(); - Object.keys(expectedSitesRoles).forEach((site) => { + for (const site of Object.keys(expectedSitesRoles)) { expect(sitesList[site]).toEqual(expectedSitesRoles[site]); - }); + } }); it('Site ID is displayed when two sites have the same name - [C217098]', async () => { @@ -192,14 +176,10 @@ describe('File Libraries', () => { }); it('has the correct columns - [C289893]', async () => { - const labels = [ 'Name', 'My Role', 'Visibility' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(3 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('User can see only his favorite sites - [C289897]', async () => { @@ -216,17 +196,11 @@ describe('File Libraries', () => { [userSitePublic]: SITE_VISIBILITY.PUBLIC }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[3].toUpperCase(); - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndVisibility(); - Object.keys(expectedSitesVisibility).forEach((site) => { + for (const site of Object.keys(expectedSitesVisibility)) { expect(sitesList[site]).toEqual(expectedSitesVisibility[site]); - }); + } }); it('User role is correctly displayed - [C289904]', async () => { @@ -237,17 +211,11 @@ describe('File Libraries', () => { [adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[2]; - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndRole(); - Object.keys(expectedSitesRoles).forEach((site) => { + for (const site of Object.keys(expectedSitesRoles)) { expect(sitesList[site]).toEqual(expectedSitesRoles[site]); - }); + } }); it('Site ID is displayed when two sites have the same name - [C289896]', async () => { diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts index 42a78427f..f2b1c188a 100755 --- a/e2e/suites/list-views/personal-files.test.ts +++ b/e2e/suites/list-views/personal-files.test.ts @@ -96,18 +96,14 @@ describe('Personal Files', () => { }); it('has the correct columns - [C217142]', async () => { - const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'Size', 'Modified', 'Modified by' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('has default sorted column - [C217143]', async () => { - expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified'); + expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified'); }); it('has user created content - [C213242]', async () => { diff --git a/e2e/suites/list-views/recent-files.test.ts b/e2e/suites/list-views/recent-files.test.ts index 76b72f8f2..1b8d772c6 100755 --- a/e2e/suites/list-views/recent-files.test.ts +++ b/e2e/suites/list-views/recent-files.test.ts @@ -81,18 +81,14 @@ describe('Recent Files', () => { }); it('has the correct columns - [C213168]', async () => { - const labels = [ 'Name', 'Location', 'Size', 'Modified' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('default sorting column - [C213171]', async () => { - expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified'); + expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified'); expect(await dataTable.getSortingOrder()).toBe('desc'); }); diff --git a/e2e/suites/list-views/shared-files.test.ts b/e2e/suites/list-views/shared-files.test.ts index aef7f3c23..c9a9948d8 100755 --- a/e2e/suites/list-views/shared-files.test.ts +++ b/e2e/suites/list-views/shared-files.test.ts @@ -87,12 +87,10 @@ describe('Shared Files', () => { }); it('has the correct columns - [C213113]', async () => { - const expectedHeader = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ]; - const headers = dataTable.getColumnHeaders(); - const count = await headers.count(); - expect(count).toBe(6 + 1, 'Incorrect number of columns'); + const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getHeaderText()).toEqual(expectedHeader); + expect(actualColumns).toEqual(expectedColumns); }); it('default sorting column - [C213115]', async () => { diff --git a/e2e/suites/list-views/trash.test.ts b/e2e/suites/list-views/trash.test.ts index a03c8d12e..2286071bf 100755 --- a/e2e/suites/list-views/trash.test.ts +++ b/e2e/suites/list-views/trash.test.ts @@ -101,14 +101,10 @@ describe('Trash', () => { }); it('has the correct columns - [C213217]', async () => { - const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('displays the files and folders deleted by everyone - [C280493]', async () => { @@ -134,14 +130,10 @@ describe('Trash', () => { }); it('has the correct columns - [C280494]', async () => { - const labels = [ 'Name', 'Location', 'Size', 'Deleted']; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Deleted']; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('displays the files and folders deleted by the user - [C213218]', async () => { @@ -154,7 +146,7 @@ describe('Trash', () => { }); it('default sorting column - [C213219]', async () => { - expect(await dataTable.getSortedColumnHeader().getText()).toBe('Deleted'); + expect(await dataTable.getSortedColumnHeaderText()).toBe('Deleted'); expect(await dataTable.getSortingOrder()).toBe('desc'); }); diff --git a/e2e/suites/navigation/breadcrumb.test.ts b/e2e/suites/navigation/breadcrumb.test.ts index 5e5abf4ac..8f1c1626f 100755 --- a/e2e/suites/navigation/breadcrumb.test.ts +++ b/e2e/suites/navigation/breadcrumb.test.ts @@ -185,8 +185,7 @@ describe('Breadcrumb', () => { expect(await breadcrumb.getAllItems()).toEqual(expectedBreadcrumb); }); - // disabled cause of ACA-1039 - xdescribe('as admin', () => { + describe('as admin', () => { const user2 = 'a_user'; const userFolder = `userFolder-${Utils.random()}`; let userFolderId; const user2Api = new RepoClient(user2, user2); @@ -203,7 +202,7 @@ describe('Breadcrumb', () => { done(); }); - xit(`Breadcrumb on navigation to a user's home - [C260970]`, async () => { + it(`Breadcrumb on navigation to a user's home - [C260970]`, async () => { await page.dataTable.doubleClickOnRowByName('User Homes'); await page.dataTable.doubleClickOnRowByName(user2); expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2 ]); diff --git a/e2e/suites/pagination/pag-favorites.test.ts b/e2e/suites/pagination/pag-favorites.test.ts index 9affc12ea..bf9b9c85f 100755 --- a/e2e/suites/pagination/pag-favorites.test.ts +++ b/e2e/suites/pagination/pag-favorites.test.ts @@ -73,12 +73,12 @@ describe('Pagination on multiple pages on Favorites', () => { }); it('Pagination control default values - [C280113]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280114]', async () => { @@ -94,24 +94,24 @@ describe('Pagination on multiple pages on Favorites', () => { it('current page menu items - [C280115]', async () => { await pagination.openMaxItemsMenu() await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -122,43 +122,43 @@ describe('Pagination on multiple pages on Favorites', () => { it('change the current page from menu - [C280116]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); - expect(await pagination.getText(pagination.range)).toContain('51-75 of 101'); - expect(await pagination.getText(pagination.currentPage)).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('navigate to next and previous pages - [C280119]', async () => { - await pagination.nextButton.click(); + await pagination.clickNext(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280117]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280118]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-file-libraries.test.ts b/e2e/suites/pagination/pag-file-libraries.test.ts index d92190d23..132ba6446 100755 --- a/e2e/suites/pagination/pag-file-libraries.test.ts +++ b/e2e/suites/pagination/pag-file-libraries.test.ts @@ -67,12 +67,12 @@ describe('Pagination on multiple pages on File Libraries', () => { }) it('Pagination control default values - [C280086]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280087]', async () => { @@ -88,24 +88,24 @@ describe('Pagination on multiple pages on File Libraries', () => { it('current page menu items - [C280088]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -117,10 +117,10 @@ describe('Pagination on multiple pages on File Libraries', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('site-60')).toBe(true, 'Site-60 not found on page'); await pagination.resetToDefaultPageNumber(); @@ -129,31 +129,31 @@ describe('Pagination on multiple pages on File Libraries', () => { it('navigate to next and previous pages - [C280092]', async () => { await pagination.clickNext(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await dataTable.isItemPresent('site-31')).toBe(true, 'Site-31 not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await dataTable.isItemPresent('site-12')).toBe(true, 'Site-12 not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280090]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280091]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-personal-files.test.ts b/e2e/suites/pagination/pag-personal-files.test.ts index 783b4eb43..1ed862a29 100755 --- a/e2e/suites/pagination/pag-personal-files.test.ts +++ b/e2e/suites/pagination/pag-personal-files.test.ts @@ -69,12 +69,12 @@ describe('Pagination on multiple pages on Personal Files', () => { }); it('Pagination control default values - [C280077]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280078]', async () => { @@ -90,24 +90,24 @@ describe('Pagination on multiple pages on Personal Files', () => { it('current page menu items - [C280079]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -119,10 +119,10 @@ describe('Pagination on multiple pages on Personal Files', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('file-60')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); @@ -131,31 +131,31 @@ describe('Pagination on multiple pages on Personal Files', () => { it('navigate to next and previous pages - [C280083]', async () => { await pagination.clickNext(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await dataTable.isItemPresent('file-31')).toBe(true, 'file-31 not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await dataTable.isItemPresent('file-12')).toBe(true, 'file-12 not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280081]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280082]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-recent-files.test.ts b/e2e/suites/pagination/pag-recent-files.test.ts index 56b62c29e..2ebcd2a1d 100755 --- a/e2e/suites/pagination/pag-recent-files.test.ts +++ b/e2e/suites/pagination/pag-recent-files.test.ts @@ -69,12 +69,12 @@ describe('Pagination on multiple pages on Recent Files', () => { }); it('Pagination control default values - [C280104]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280105]', async () => { @@ -90,24 +90,24 @@ describe('Pagination on multiple pages on Recent Files', () => { it('current page menu items - [C280106]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -119,43 +119,43 @@ describe('Pagination on multiple pages on Recent Files', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('navigate to next and previous pages - [C280110]', async () => { - await pagination.nextButton.click(); + await pagination.clickNext(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(pagination.range.getText()).toContain('1-25 of 101'); + expect(pagination.getRange()).toContain('1-25 of 101'); expect(dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280108]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280109]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-search-results.test.ts b/e2e/suites/pagination/pag-search-results.test.ts index b5e64e92a..04332bd28 100755 --- a/e2e/suites/pagination/pag-search-results.test.ts +++ b/e2e/suites/pagination/pag-search-results.test.ts @@ -71,12 +71,12 @@ describe('Pagination on multiple pages on Search Results', () => { }); it('Pagination control default values - [C290125]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C290126]', async () => { @@ -92,24 +92,24 @@ describe('Pagination on multiple pages on Search Results', () => { it('current page menu items - [C290127]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -121,40 +121,40 @@ describe('Pagination on multiple pages on Search Results', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForBody(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); await pagination.resetToDefaultPageNumber(); }); it('navigate to next and previous pages - [C290131]', async () => { - await pagination.nextButton.click(); + await pagination.clickNext(); await dataTable.waitForBody(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForBody(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForBody(); - expect(pagination.range.getText()).toContain('1-25 of 101'); + expect(pagination.getRange()).toContain('1-25 of 101'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C290129]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C290130]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-shared-files.test.ts b/e2e/suites/pagination/pag-shared-files.test.ts index 50e914657..ae07b97e6 100755 --- a/e2e/suites/pagination/pag-shared-files.test.ts +++ b/e2e/suites/pagination/pag-shared-files.test.ts @@ -72,12 +72,12 @@ describe('Pagination on multiple pages on Shared Files', () => { }); it('Pagination control default values - [C280095]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280096]', async () => { @@ -94,24 +94,24 @@ describe('Pagination on multiple pages on Shared Files', () => { it('current page menu items - [C280097]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -123,43 +123,43 @@ describe('Pagination on multiple pages on Shared Files', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('navigate to next and previous pages - [C280101]', async () => { - await pagination.nextButton.click(); + await pagination.clickNext(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('26-50 of 101'); + expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280099]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280100]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/pagination/pag-single-page.test.ts b/e2e/suites/pagination/pag-single-page.test.ts index bffffc44a..00fb699c3 100755 --- a/e2e/suites/pagination/pag-single-page.test.ts +++ b/e2e/suites/pagination/pag-single-page.test.ts @@ -81,32 +81,32 @@ describe('Pagination on single page', () => { it('page selector not displayed on Favorites - [C280112]', async () => { await page.clickFavoritesAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on File Libraries - [C280085]', async () => { await page.clickFileLibrariesAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on Personal Files - [C280076]', async () => { await page.clickPersonalFilesAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on Recent Files - [C280103]', async () => { await page.clickRecentFilesAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on Shared Files - [C280094]', async () => { await page.clickSharedFilesAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on Trash - [C280121]', async () => { await page.clickTrashAndWait(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); it('page selector not displayed on Search results - [C290124]', async () => { @@ -114,7 +114,7 @@ describe('Pagination on single page', () => { await searchInput.checkOnlyFiles(); await searchInput.searchFor(file); await dataTable.waitForBody(); - expect(await pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); }); diff --git a/e2e/suites/pagination/pag-trash.test.ts b/e2e/suites/pagination/pag-trash.test.ts index fc337c688..af28b5972 100755 --- a/e2e/suites/pagination/pag-trash.test.ts +++ b/e2e/suites/pagination/pag-trash.test.ts @@ -68,12 +68,12 @@ describe('Pagination on multiple pages on Trash', () => { }); it('Pagination control default values - [C280122]', async () => { - expect(await pagination.range.getText()).toContain('1-25 of 101'); - expect(await pagination.maxItems.getText()).toContain('25'); - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.totalPages.getText()).toContain('of 5'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.getTotalPages()).toContain('of 5'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); }); it('Items per page values - [C280123]', async () => { @@ -89,24 +89,24 @@ describe('Pagination on multiple pages on Trash', () => { it('current page menu items - [C280124]', async () => { await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('25'); - expect(await pagination.getText(pagination.maxItems)).toContain('25'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 5'); + expect(await pagination.getMaxItems()).toContain('25'); + expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('50'); - expect(await pagination.getText(pagination.maxItems)).toContain('50'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 3'); + expect(await pagination.getMaxItems()).toContain('50'); + expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); await pagination.menu.clickMenuItem('100'); - expect(await pagination.getText(pagination.maxItems)).toContain('100'); - expect(await pagination.getText(pagination.totalPages)).toContain('of 2'); + expect(await pagination.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); await pagination.openCurrentPageMenu(); expect(await pagination.menu.getItemsCount()).toBe(2); await pagination.menu.closeMenu(); @@ -118,43 +118,43 @@ describe('Pagination on multiple pages on Trash', () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(3); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('51-75 of 101'); - expect(await pagination.currentPage.getText()).toContain('Page 3'); - expect(await pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled'); - expect(await pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); + expect(await pagination.getRange()).toContain('51-75 of 101'); + expect(await pagination.getCurrentPage()).toContain('Page 3'); + expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); + expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('navigate to next and previous pages - [C280128]', async () => { - await pagination.nextButton.click(); + await pagination.clickNext(); await dataTable.waitForHeader(); - expect(pagination.range.getText()).toContain('26-50 of 101'); + expect(pagination.getRange()).toContain('26-50 of 101'); expect(dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(2); await dataTable.waitForHeader(); - await pagination.previousButton.click(); + await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(await pagination.range.getText()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); it('Previous button is disabled on first page - [C280126]', async () => { - expect(await pagination.currentPage.getText()).toContain('Page 1'); - expect(await pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); + expect(await pagination.getCurrentPage()).toContain('Page 1'); + expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); }); it('Next button is disabled on last page - [C280127]', async () => { await pagination.openCurrentPageMenu(); await pagination.menu.clickNthItem(5); expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page'); - expect(await pagination.currentPage.getText()).toContain('Page 5'); - expect(await pagination.nextButton.isEnabled()).toBe(false, 'Next button is enabled on last page'); + expect(await pagination.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); }); }); diff --git a/e2e/suites/search/search-input.test.ts b/e2e/suites/search/search-input.test.ts index 3dfb6e064..78cfb5460 100644 --- a/e2e/suites/search/search-input.test.ts +++ b/e2e/suites/search/search-input.test.ts @@ -24,8 +24,7 @@ */ import { BrowsingPage, LoginPage } from '../../pages/pages'; -// import { Utils } from '../../utilities/utils'; -import { browser } from 'protractor'; +import { Utils } from '../../utilities/utils'; describe('Search input', () => { const loginPage = new LoginPage(); @@ -38,8 +37,7 @@ describe('Search input', () => { }); beforeEach(async (done) => { - // await Utils.pressEscape(); - await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform(); + await Utils.pressEscape(); done(); }); diff --git a/e2e/suites/search/search-results-libraries.test.ts b/e2e/suites/search/search-results-libraries.test.ts index aead99846..a32025903 100644 --- a/e2e/suites/search/search-results-libraries.test.ts +++ b/e2e/suites/search/search-results-libraries.test.ts @@ -172,14 +172,10 @@ describe('Search results - libraries', () => { await searchInput.searchFor(site1.name); await dataTable.waitForBody(); - const labels = [ 'Name', 'My Role', 'Visibility' ]; - const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); + const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ]; + const actualColumns = await dataTable.getColumnHeadersText(); - expect(await dataTable.getColumnHeaders().count()).toBe(3 + 1, 'Incorrect number of columns'); - - await elements.forEach(async (element, index) => { - expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`); - }); + expect(actualColumns).toEqual(expectedColumns); }); it('Library visibility is correctly displayed - [C290017]', async () => { @@ -194,17 +190,11 @@ describe('Search results - libraries', () => { [userSitePublic]: SITE_VISIBILITY.PUBLIC }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[3].toUpperCase(); - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndVisibility(); - Object.keys(expectedSitesVisibility).forEach((expectedSite) => { - expect(sitesList[expectedSite]).toEqual(expectedSitesVisibility[expectedSite]); - }); + for (const site of Object.keys(expectedSitesVisibility)) { + expect(sitesList[site]).toEqual(expectedSitesVisibility[site]); + } }); it('User role is correctly displayed - [C290018]', async () => { @@ -220,17 +210,11 @@ describe('Search results - libraries', () => { [adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL }; - const rowCells = await dataTable.getRows().map((row) => { - return row.all(dataTable.cell).map(async cell => await cell.getText()); - }); - const sitesList = rowCells.reduce((acc, cell) => { - acc[cell[1]] = cell[2]; - return acc; - }, {}); + const sitesList = await dataTable.getSitesNameAndRole(); - Object.keys(expectedSitesRoles).forEach((expectedSite) => { - expect(sitesList[expectedSite]).toEqual(expectedSitesRoles[expectedSite]); - }); + for (const site of Object.keys(expectedSitesRoles)) { + expect(sitesList[site]).toEqual(expectedSitesRoles[site]); + } }); it('Private sites are not displayed when user is not a member - [C290019]', async () => { diff --git a/protractor.conf.js b/protractor.conf.js index 336b17908..c74000f53 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -52,6 +52,7 @@ exports.config = { ], SELENIUM_PROMISE_MANAGER: true, + capabilities: { browserName: 'chrome', chromeOptions: { @@ -71,7 +72,7 @@ exports.config = { // baseUrl: 'http://localhost:4000', getPageTimeout: 50000, - framework: 'jasmine2', + framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 60000,