diff --git a/e2e/suites/list-views/empty-list.test.ts b/e2e/suites/list-views/empty-list.test.ts index 97ad27f8e..22fb7b387 100755 --- a/e2e/suites/list-views/empty-list.test.ts +++ b/e2e/suites/list-views/empty-list.test.ts @@ -106,8 +106,18 @@ describe('Empty list views', () => { expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); - it('File Libraries - pagination controls not displayed - [C280084]', async () => { - await page.clickFileLibraries(); + it('My Libraries - pagination controls not displayed - [C280084]', async () => { + await page.goToMyLibraries(); + 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('Favorite Libraries - pagination controls not displayed - [C291873]', async () => { + await page.goToFavoriteLibraries(); 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'); diff --git a/e2e/suites/pagination/pag-file-libraries.test.ts b/e2e/suites/pagination/pag-file-libraries.test.ts index 64433da0a..ec439de26 100755 --- a/e2e/suites/pagination/pag-file-libraries.test.ts +++ b/e2e/suites/pagination/pag-file-libraries.test.ts @@ -28,7 +28,7 @@ import { LoginPage, BrowsingPage } from '../../pages/pages'; import { Utils } from '../../utilities/utils'; import { RepoClient } from '../../utilities/repo-client/repo-client'; -describe('Pagination on multiple pages on File Libraries', () => { +describe('Pagination on multiple pages', () => { const username = `user-${Utils.random()}`; const apis = { @@ -51,109 +51,215 @@ describe('Pagination on multiple pages on File Libraries', () => { done(); }); - beforeEach(async (done) => { - await page.goToMyLibrariesAndWait(); - done(); - }); - - afterEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - afterAll(async (done) => { await apis.user.sites.deleteSites(sites); done(); }) - it('Pagination control default values - [C280086]', async () => { - 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'); + describe('on My Libraries', () => { + beforeEach(async (done) => { + await page.goToMyLibrariesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Pagination control default values - [C280086]', async () => { + 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 () => { + await pagination.openMaxItemsMenu(); + const [ first, second, third ] = [1, 2, 3] + .map(async nth => await pagination.menu.getNthItem(nth).getText()); + expect(first).toBe('25'); + expect(second).toBe('50'); + expect(third).toBe('100'); + await pagination.menu.closeMenu(); + }); + + it('current page menu items - [C280088]', async () => { + await pagination.openMaxItemsMenu(); + await pagination.menu.clickMenuItem('25'); + 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.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.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); + await pagination.openCurrentPageMenu(); + expect(await pagination.menu.getItemsCount()).toBe(2); + await pagination.menu.closeMenu(); + + await pagination.resetToDefaultPageSize(); + }); + + it('change the current page from menu - [C280089]', async () => { + await pagination.openCurrentPageMenu(); + await pagination.menu.clickNthItem(3); + await dataTable.waitForHeader(); + 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(); + }); + + it('navigate to next and previous pages - [C280092]', async () => { + await pagination.clickNext(); + await dataTable.waitForHeader(); + 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.clickPrevious(); + await dataTable.waitForHeader(); + 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.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.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); + }); }); - it('Items per page values - [C280087]', async () => { - await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); - await pagination.menu.closeMenu(); + describe('on Favorite Libraries', () => { + beforeEach(async (done) => { + await page.goToFavoriteLibrariesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Pagination control default values - [C291875]', async () => { + 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 - [C291876]', async () => { + await pagination.openMaxItemsMenu(); + const [ first, second, third ] = [1, 2, 3] + .map(async nth => await pagination.menu.getNthItem(nth).getText()); + expect(first).toBe('25'); + expect(second).toBe('50'); + expect(third).toBe('100'); + await pagination.menu.closeMenu(); + }); + + it('current page menu items - [C291877]', async () => { + await pagination.openMaxItemsMenu(); + await pagination.menu.clickMenuItem('25'); + 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.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.getMaxItems()).toContain('100'); + expect(await pagination.getTotalPages()).toContain('of 2'); + await pagination.openCurrentPageMenu(); + expect(await pagination.menu.getItemsCount()).toBe(2); + await pagination.menu.closeMenu(); + + await pagination.resetToDefaultPageSize(); + }); + + it('change the current page from menu - [C291878]', async () => { + await pagination.openCurrentPageMenu(); + await pagination.menu.clickNthItem(3); + await dataTable.waitForHeader(); + 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-40')).toBe(true, 'Site-60 not found on page'); + + await pagination.resetToDefaultPageNumber(); + }); + + it('navigate to next and previous pages - [C291881]', async () => { + await pagination.clickNext(); + await dataTable.waitForHeader(); + expect(await pagination.getRange()).toContain('26-50 of 101'); + expect(await dataTable.isItemPresent('site-70')).toBe(true, 'Site-31 not found on page'); + await pagination.resetToDefaultPageNumber(); + + await pagination.openCurrentPageMenu(); + await pagination.menu.clickNthItem(2); + await dataTable.waitForHeader(); + await pagination.clickPrevious(); + await dataTable.waitForHeader(); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await dataTable.isItemPresent('site-88')).toBe(true, 'Site-12 not found on page'); + + await pagination.resetToDefaultPageNumber(); + }); + + it('Previous button is disabled on first page - [C291879]', async () => { + 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 - [C291880]', 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.getCurrentPage()).toContain('Page 5'); + expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); + }); }); - it('current page menu items - [C280088]', async () => { - await pagination.openMaxItemsMenu(); - await pagination.menu.clickMenuItem('25'); - 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.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.getMaxItems()).toContain('100'); - expect(await pagination.getTotalPages()).toContain('of 2'); - await pagination.openCurrentPageMenu(); - expect(await pagination.menu.getItemsCount()).toBe(2); - await pagination.menu.closeMenu(); - - await pagination.resetToDefaultPageSize(); - }); - - it('change the current page from menu - [C280089]', async () => { - await pagination.openCurrentPageMenu(); - await pagination.menu.clickNthItem(3); - await dataTable.waitForHeader(); - 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(); - }); - - it('navigate to next and previous pages - [C280092]', async () => { - await pagination.clickNext(); - await dataTable.waitForHeader(); - 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.clickPrevious(); - await dataTable.waitForHeader(); - 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.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.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 00fb699c3..8014b6cc6 100755 --- a/e2e/suites/pagination/pag-single-page.test.ts +++ b/e2e/suites/pagination/pag-single-page.test.ts @@ -84,8 +84,13 @@ describe('Pagination on single page', () => { expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); }); - it('page selector not displayed on File Libraries - [C280085]', async () => { - await page.clickFileLibrariesAndWait(); + it('page selector not displayed on My Libraries - [C280085]', async () => { + await page.goToMyLibrariesAndWait(); + expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); + }); + + it('page selector not displayed on Favorite Libraries - [C291874]', async () => { + await page.goToFavoriteLibrariesAndWait(); expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed'); });