Unexclude due the timeout (#1805)

* change base method to wait

* fix import

* reduce log

* fix

* data placeholder

* fix

* fix

* fix

* fix style

* change visibility with common method

* fix

* use common get value method

* remove unused import

* fix a few incorrect api calls

* - use separate variables

* correctly wait for items after they have been created

* use browseraction click

* Exclude failing tests

* increase timeout and some fix

* check env before execute test

* simplify conf

* exclude

* rerun

* logs

* refactor pagination tests to use only 51 items
take out pagination tests into a separate stage

* fix check

* remove hardcoded total items. other shared files might already exist

Co-authored-by: Adina Parpalita <Adina.Parpalita@ness.com>
Co-authored-by: iuliaib <iulia.burca@ness.com>
This commit is contained in:
Eugenio Romano 2020-11-19 16:07:57 +00:00 committed by GitHub
parent 509c6b6f75
commit 8308573f3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 815 additions and 750 deletions

View File

@ -37,8 +37,7 @@ stages:
env: env:
global: global:
- API_CONTENT_HOST=$API_CONTENT_HOST_REMOTE - API_AOS_HOST=$API_CONTENT_HOST
- API_AOS_HOST=$API_CONTENT_HOST_REMOTE
- ADMIN_EMAIL=$ADMIN_EMAIL_REMOTE - ADMIN_EMAIL=$ADMIN_EMAIL_REMOTE
- ADMIN_PASSWORD=$ADMIN_PASSWORD_REMOTE - ADMIN_PASSWORD=$ADMIN_PASSWORD_REMOTE
@ -84,44 +83,52 @@ jobs:
cache: false cache: false
- stage: e2e - stage: e2e
name: 'Test Suites: authentication,listViews,navigation,application,pagination,search' name: 'Test Suites: authentication,listViews,navigation,application,search'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=authentication,listViews,navigation,application,pagination,search" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=authentication,listViews,navigation,application,search"
after_script:
- ./scripts/ci/job_hooks/after_e2e.sh
- stage: e2e
name: 'Test Suites: pagination'
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=pagination"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh
- name: 'Test Suites: actionsAvailable' - name: 'Test Suites: actionsAvailable'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=actionsAvailable" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=actionsAvailable"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh
- name: 'Test Suites: addRemoveContent' - name: 'Test Suites: addRemoveContent'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=addRemoveContent" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=addRemoveContent"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh
- name: 'Test Suites: manageContent' - name: 'Test Suites: manageContent'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=manageContent" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=manageContent"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh
- name: 'Test Suite: sharingContent' - name: 'Test Suite: sharingContent'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=sharingContent" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=sharingContent"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh
- name: 'Test Suites: viewer,infoDrawer,extensions' - name: 'Test Suites: viewer,infoDrawer,extensions'
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" - ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a" || travis_terminate 1
script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=viewer,infoDrawer,extensions" script: ./scripts/ci/jobs/affected-project-with.sh -target e2e -options "--suite=viewer,infoDrawer,extensions"
after_script: after_script:
- ./scripts/ci/job_hooks/after_e2e.sh - ./scripts/ci/job_hooks/after_e2e.sh

View File

@ -1,19 +1,44 @@
{ {
"C586766" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586766" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586767" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586767" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586768" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586768" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586769" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586769" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586770" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586770" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586771" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586771" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586772" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586772" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586773" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586773" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586774" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586774" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586776" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586776" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586777" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586777" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586778" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586778" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586779" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586779" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586780" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586780" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C586781" : "Include once ACA starts using ACS 7+, https://issues.alfresco.com/jira/browse/ACA-3601", "C586781" : "Include once ACA starts using ACS 7+, https://alfresco.atlassian.net/browse/ACA-3601",
"C280132" : "Shared files list is not empty on the live environment", "C280132" : "https://alfresco.atlassian.net/browse/ACA-4167",
"C280094" : "Shared files list is not empty on the live environment" "C280094" : "https://alfresco.atlassian.net/browse/ACA-4167",
"MNT-21058" : "https://alfresco.atlassian.net/browse/ACA-4145",
"C217171" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280202" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C217172" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C217174" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280214" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280226" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280227" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280229" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C306938" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C306939" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C306941" : "https://alfresco.atlassian.net/browse/ACA-4166",
"C280536" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217132" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280503" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280504" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280324" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280514" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280524" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280526" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280525" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217181" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217178" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217179" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280537" : "https://alfresco.atlassian.net/browse/ACA-4165"
} }

View File

@ -90,7 +90,7 @@ describe('Files / folders actions : ', () => {
await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 12 }); await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 12 });
const initialFavoritesTotalItems = await userApi.favorites.getFavoritesTotalItems(); const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]); await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
await userApi.favorites.addFavoritesByIds('file', [ await userApi.favorites.addFavoritesByIds('file', [
fileDocxFavId, fileDocxFavId,
@ -119,7 +119,7 @@ describe('Files / folders actions : ', () => {
await userApi.nodes.lockFile(fileSharedFavLockedId); await userApi.nodes.lockFile(fileSharedFavLockedId);
await loginPage.loginWith(username); await loginPage.loginWith(username);
}); }, 300000);
afterAll(async () => { afterAll(async () => {
await userActions.deleteNodes([parentId]); await userActions.deleteNodes([parentId]);

View File

@ -24,6 +24,7 @@
*/ */
import { LoginPage, BrowsingPage, RepoClient, NodeContentTree, Utils, AdminActions } from '@alfresco/aca-testing-shared'; import { LoginPage, BrowsingPage, RepoClient, NodeContentTree, Utils, AdminActions } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Generic tests : ', () => { describe('Generic tests : ', () => {
const random = Utils.random(); const random = Utils.random();
@ -109,7 +110,7 @@ describe('Generic tests : ', () => {
it('[C280619] Context menu closes when clicking away from it', async () => { it('[C280619] Context menu closes when clicking away from it', async () => {
await dataTable.rightClickOnItem(file1); await dataTable.rightClickOnItem(file1);
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
await page.breadcrumb.currentItem.click(); await BrowserActions.click(page.breadcrumb.currentItem);
expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed'); expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed');
}); });
}); });

View File

@ -84,7 +84,7 @@ describe('Library actions : ', () => {
await userActions.waitForTrashcanSize(initialDeletedTotalItems + 2); await userActions.waitForTrashcanSize(initialDeletedTotalItems + 2);
await loginPage.loginWith(username); await loginPage.loginWith(username);
}); }, 300000);
afterAll(async () => { afterAll(async () => {
await userActions.deleteSites([ await userActions.deleteSites([

View File

@ -145,7 +145,7 @@ describe('Special permissions : ', () => {
userManagerApi.search.waitForApi(userManager, { expect: managerSearchTotalItems + 14 }), userManagerApi.search.waitForApi(userManager, { expect: managerSearchTotalItems + 14 }),
userCollaboratorApi.favorites.waitForApi({ expect: collaboratorFavoritesTotalItems + 2 }) userCollaboratorApi.favorites.waitForApi({ expect: collaboratorFavoritesTotalItems + 2 })
]); ]);
}); }, 300000);
afterAll(async () => { afterAll(async () => {
await userManagerApi.sites.deleteSite(sitePrivate); await userManagerApi.sites.deleteSite(sitePrivate);

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Copy content', () => { describe('Copy content', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -478,7 +479,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -498,7 +499,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -522,7 +523,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 2 items'); expect(msg).toContain('Copied 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -544,7 +545,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -564,7 +565,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -590,7 +591,7 @@ describe('Copy content', () => {
await copyDialog.dataTable.doubleClickOnRowByName(siteName); await copyDialog.dataTable.doubleClickOnRowByName(siteName);
await copyDialog.dataTable.doubleClickOnRowByName('documentLibrary'); await copyDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain(`Copied ${noOfItems} ${noOfItems === 1 ? 'item' : 'items'}`); expect(msg).toContain(`Copied ${noOfItems} ${noOfItems === 1 ? 'item' : 'items'}`);
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -618,7 +619,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -641,7 +642,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -672,7 +673,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -695,7 +696,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -720,7 +721,7 @@ describe('Copy content', () => {
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.dataTable.doubleClickOnRowByName(source); await copyDialog.dataTable.doubleClickOnRowByName(source);
await copyDialog.selectDestination(destination); await copyDialog.selectDestination(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -746,7 +747,7 @@ describe('Copy content', () => {
await toolbar.clickMoreActionsCopy(); await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files'); await copyDialog.selectLocation('Personal Files');
await copyDialog.dataTable.doubleClickOnRowByName(destination); await copyDialog.dataTable.doubleClickOnRowByName(destination);
await copyDialog.copyButton.click(); await BrowserActions.click(copyDialog.copyButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item'); expect(msg).toContain('Copied 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Move content', () => { describe('Move content', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -166,7 +167,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationPF); await moveDialog.selectDestination(destinationPF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -184,7 +185,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationPF); await moveDialog.selectDestination(destinationPF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -206,7 +207,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationPF); await moveDialog.selectDestination(destinationPF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -226,7 +227,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationPF); await moveDialog.selectDestination(destinationPF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); expect(msg).toContain('Move unsuccessful, a file with the same name already exists');
expect(msg).not.toContain('Undo'); expect(msg).not.toContain('Undo');
@ -245,7 +246,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationPF); await moveDialog.selectDestination(destinationPF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -268,7 +269,7 @@ describe('Move content', () => {
await moveDialog.dataTable.doubleClickOnRowByName(siteName); await moveDialog.dataTable.doubleClickOnRowByName(siteName);
await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSitePF); await moveDialog.selectDestination(folderSitePF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -325,7 +326,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationRF); await moveDialog.selectDestination(destinationRF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -344,7 +345,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationRF); await moveDialog.selectDestination(destinationRF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -366,7 +367,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationRF); await moveDialog.selectDestination(destinationRF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); expect(msg).toContain('Move unsuccessful, a file with the same name already exists');
expect(msg).not.toContain('Undo'); expect(msg).not.toContain('Undo');
@ -388,7 +389,7 @@ describe('Move content', () => {
await moveDialog.dataTable.doubleClickOnRowByName(siteName); await moveDialog.dataTable.doubleClickOnRowByName(siteName);
await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteRF); await moveDialog.selectDestination(folderSiteRF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -451,7 +452,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationSF); await moveDialog.selectDestination(destinationSF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -470,7 +471,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationSF); await moveDialog.selectDestination(destinationSF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -492,7 +493,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationSF); await moveDialog.selectDestination(destinationSF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); expect(msg).toContain('Move unsuccessful, a file with the same name already exists');
expect(msg).not.toContain('Undo'); expect(msg).not.toContain('Undo');
@ -514,7 +515,7 @@ describe('Move content', () => {
await moveDialog.dataTable.doubleClickOnRowByName(siteName); await moveDialog.dataTable.doubleClickOnRowByName(siteName);
await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteSF); await moveDialog.selectDestination(folderSiteSF);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -603,7 +604,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationFav); await moveDialog.selectDestination(destinationFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -622,7 +623,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationFav); await moveDialog.selectDestination(destinationFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -645,7 +646,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationFav); await moveDialog.selectDestination(destinationFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -667,7 +668,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationFav); await moveDialog.selectDestination(destinationFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); expect(msg).toContain('Move unsuccessful, a file with the same name already exists');
expect(msg).not.toContain('Undo'); expect(msg).not.toContain('Undo');
@ -687,7 +688,7 @@ describe('Move content', () => {
await toolbar.clickMoreActionsMove(); await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('Personal Files'); await moveDialog.selectLocation('Personal Files');
await moveDialog.selectDestination(destinationFav); await moveDialog.selectDestination(destinationFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 1 item'); expect(msg).toContain('Moved 1 item');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');
@ -711,7 +712,7 @@ describe('Move content', () => {
await moveDialog.dataTable.doubleClickOnRowByName(siteName); await moveDialog.dataTable.doubleClickOnRowByName(siteName);
await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteFav); await moveDialog.selectDestination(folderSiteFav);
await moveDialog.moveButton.click(); await BrowserActions.click(moveDialog.moveButton);
const msg = await page.getSnackBarMessage(); const msg = await page.getSnackBarMessage();
expect(msg).toContain('Moved 2 items'); expect(msg).toContain('Moved 2 items');
expect(msg).toContain('Undo'); expect(msg).toContain('Undo');

View File

@ -34,6 +34,7 @@ import {
RepoClient, RepoClient,
NodeContentTree NodeContentTree
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Create file from template', () => { describe('Create file from template', () => {
const random = Utils.random(); const random = Utils.random();
@ -311,7 +312,7 @@ describe('Create file from template', () => {
it('[C325030] Create a file from a template - with a new Name', async () => { it('[C325030] Create a file from a template - with a new Name', async () => {
await createFromTemplateDialog.enterName(file1.name); await createFromTemplateDialog.enterName(file1.name);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -322,7 +323,7 @@ describe('Create file from template', () => {
await createFromTemplateDialog.enterName(file2.name); await createFromTemplateDialog.enterName(file2.name);
await createFromTemplateDialog.enterTitle(file2.title); await createFromTemplateDialog.enterTitle(file2.title);
await createFromTemplateDialog.enterDescription(file2.description); await createFromTemplateDialog.enterDescription(file2.description);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -335,7 +336,7 @@ describe('Create file from template', () => {
it('[C325028] Create a file with a duplicate name', async () => { it('[C325028] Create a file with a duplicate name', async () => {
await createFromTemplateDialog.enterName(duplicateFileName); await createFromTemplateDialog.enterName(duplicateFileName);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -351,7 +352,7 @@ describe('Create file from template', () => {
it('[C325042] Trim spaces from file Name', async () => { it('[C325042] Trim spaces from file Name', async () => {
await createFromTemplateDialog.enterName(nameWithSpaces); await createFromTemplateDialog.enterName(nameWithSpaces);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -376,7 +377,7 @@ describe('Create file from template', () => {
await createFromTemplateDialog.enterName(fileSite.name); await createFromTemplateDialog.enterName(fileSite.name);
await createFromTemplateDialog.enterTitle(fileSite.title); await createFromTemplateDialog.enterTitle(fileSite.title);
await createFromTemplateDialog.enterDescription(fileSite.description); await createFromTemplateDialog.enterDescription(fileSite.description);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -397,7 +398,7 @@ describe('Create file from template', () => {
it('[C325025] Create a file with a duplicate name', async () => { it('[C325025] Create a file with a duplicate name', async () => {
await createFromTemplateDialog.enterName(duplicateFileSite); await createFromTemplateDialog.enterName(duplicateFileSite);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');

View File

@ -34,6 +34,7 @@ import {
RepoClient, RepoClient,
NodeContentTree NodeContentTree
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Create folder from template', () => { describe('Create folder from template', () => {
const random = Utils.random(); const random = Utils.random();
@ -296,7 +297,7 @@ describe('Create folder from template', () => {
it('[C325157] Create a folder from a template - with a new Name', async () => { it('[C325157] Create a folder from a template - with a new Name', async () => {
await createFromTemplateDialog.enterName(folder1.name); await createFromTemplateDialog.enterName(folder1.name);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -307,7 +308,7 @@ describe('Create folder from template', () => {
await createFromTemplateDialog.enterName(folder2.name); await createFromTemplateDialog.enterName(folder2.name);
await createFromTemplateDialog.enterTitle(folder2.title); await createFromTemplateDialog.enterTitle(folder2.title);
await createFromTemplateDialog.enterDescription(folder2.description); await createFromTemplateDialog.enterDescription(folder2.description);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -320,7 +321,7 @@ describe('Create folder from template', () => {
it('[C325156] Create a folder with a duplicate name', async () => { it('[C325156] Create a folder with a duplicate name', async () => {
await createFromTemplateDialog.enterName(duplicateFolderName); await createFromTemplateDialog.enterName(duplicateFolderName);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -336,7 +337,7 @@ describe('Create folder from template', () => {
it('[C325158] Trim spaces from folder Name', async () => { it('[C325158] Trim spaces from folder Name', async () => {
await createFromTemplateDialog.enterName(nameWithSpaces); await createFromTemplateDialog.enterName(nameWithSpaces);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -361,7 +362,7 @@ describe('Create folder from template', () => {
await createFromTemplateDialog.enterName(folderSite.name); await createFromTemplateDialog.enterName(folderSite.name);
await createFromTemplateDialog.enterTitle(folderSite.title); await createFromTemplateDialog.enterTitle(folderSite.title);
await createFromTemplateDialog.enterDescription(folderSite.description); await createFromTemplateDialog.enterDescription(folderSite.description);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
await createFromTemplateDialog.waitForDialogToClose(); await createFromTemplateDialog.waitForDialogToClose();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
@ -382,7 +383,7 @@ describe('Create folder from template', () => {
it('[C325163] Create a folder with a duplicate name', async () => { it('[C325163] Create a folder with a duplicate name', async () => {
await createFromTemplateDialog.enterName(duplicateFolderSite); await createFromTemplateDialog.enterName(duplicateFolderSite);
await createFromTemplateDialog.createButton.click(); await BrowserActions.click(createFromTemplateDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');

View File

@ -32,6 +32,7 @@ import {
clearTextWithBackspace, clearTextWithBackspace,
RepoClient RepoClient
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Create folder', () => { describe('Create folder', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -96,7 +97,7 @@ describe('Create folder', () => {
await page.sidenav.openCreateFolderDialog(); await page.sidenav.openCreateFolderDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(folderName1); await createDialog.enterName(folderName1);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -109,7 +110,7 @@ describe('Create folder', () => {
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(folderName2); await createDialog.enterName(folderName2);
await createDialog.enterDescription(folderDescription); await createDialog.enterDescription(folderDescription);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -191,7 +192,7 @@ describe('Create folder', () => {
await page.sidenav.openCreateFolderDialog(); await page.sidenav.openCreateFolderDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(duplicateFolderName); await createDialog.enterName(duplicateFolderName);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -202,7 +203,7 @@ describe('Create folder', () => {
await page.sidenav.openCreateFolderDialog(); await page.sidenav.openCreateFolderDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(nameWithSpaces); await createDialog.enterName(nameWithSpaces);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -229,7 +230,7 @@ describe('Create folder', () => {
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(folderSite); await createDialog.enterName(folderSite);
await createDialog.enterDescription(folderDescription); await createDialog.enterDescription(folderDescription);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -254,7 +255,7 @@ describe('Create folder', () => {
await page.sidenav.openCreateFolderDialog(); await page.sidenav.openCreateFolderDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(duplicateFolderSite); await createDialog.enterName(duplicateFolderSite);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present');

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, SITE_VISIBILITY, LoginPage, BrowsingPage, CreateLibraryDialog, Utils, RepoClient } from '@alfresco/aca-testing-shared'; import { AdminActions, SITE_VISIBILITY, LoginPage, BrowsingPage, CreateLibraryDialog, Utils, RepoClient } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Create library', () => { describe('Create library', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -98,7 +99,7 @@ describe('Create library', () => {
await page.sidenav.openCreateLibraryDialog(); await page.sidenav.openCreateLibraryDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(site1Name); await createDialog.enterName(site1Name);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
expect(await page.breadcrumb.currentItem.getText()).toEqual(site1Name, `Not navigated into ${site1Name}`); expect(await page.breadcrumb.currentItem.getText()).toEqual(site1Name, `Not navigated into ${site1Name}`);
@ -111,8 +112,8 @@ describe('Create library', () => {
await page.sidenav.openCreateLibraryDialog(); await page.sidenav.openCreateLibraryDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(site2Name); await createDialog.enterName(site2Name);
await createDialog.visibilityModerated.click(); await BrowserActions.click(createDialog.visibilityModerated);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
expect(await page.breadcrumb.currentItem.getText()).toEqual(site2Name, `Not navigated into ${site2Name}`); expect(await page.breadcrumb.currentItem.getText()).toEqual(site2Name, `Not navigated into ${site2Name}`);
@ -125,8 +126,8 @@ describe('Create library', () => {
await page.sidenav.openCreateLibraryDialog(); await page.sidenav.openCreateLibraryDialog();
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(site3Name); await createDialog.enterName(site3Name);
await createDialog.visibilityPrivate.click(); await BrowserActions.click(createDialog.visibilityPrivate);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
expect(await page.breadcrumb.currentItem.getText()).toEqual(site3Name, `Not navigated into ${site3Name}`); expect(await page.breadcrumb.currentItem.getText()).toEqual(site3Name, `Not navigated into ${site3Name}`);
@ -141,8 +142,8 @@ describe('Create library', () => {
await createDialog.enterName(site4.name); await createDialog.enterName(site4.name);
await createDialog.enterLibraryId(site4.id); await createDialog.enterLibraryId(site4.id);
await createDialog.enterDescription(site4.description); await createDialog.enterDescription(site4.description);
await createDialog.visibilityPublic.click(); await BrowserActions.click(createDialog.visibilityPublic);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
expect(await page.breadcrumb.currentItem.getText()).toEqual(site4.name, `Not navigated into ${site4.name}`); expect(await page.breadcrumb.currentItem.getText()).toEqual(site4.name, `Not navigated into ${site4.name}`);
@ -167,7 +168,7 @@ describe('Create library', () => {
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(siteInTrash.name); await createDialog.enterName(siteInTrash.name);
await createDialog.enterLibraryId(siteInTrash.id); await createDialog.enterLibraryId(siteInTrash.id);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
expect(await createDialog.getErrorMessage()).toEqual(`This Library ID is already used. Check the trashcan.`); expect(await createDialog.getErrorMessage()).toEqual(`This Library ID is already used. Check the trashcan.`);
}); });
@ -201,7 +202,7 @@ describe('Create library', () => {
await createDialog.waitForDialogToOpen(); await createDialog.waitForDialogToOpen();
await createDialog.enterName(duplicateSite.name); await createDialog.enterName(duplicateSite.name);
await createDialog.enterLibraryId(`${duplicateSite.id}-2`); await createDialog.enterLibraryId(`${duplicateSite.id}-2`);
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
await createDialog.waitForDialogToClose(); await createDialog.waitForDialogToClose();
expect(await page.breadcrumb.currentItem.getText()).toEqual(duplicateSite.name, `Not navigated into ${duplicateSite.name}`); expect(await page.breadcrumb.currentItem.getText()).toEqual(duplicateSite.name, `Not navigated into ${duplicateSite.name}`);

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Download', () => { describe('Download', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -140,14 +141,14 @@ describe('Download', () => {
it('[C213179] Download a file', async () => { it('[C213179] Download a file', async () => {
await dataTable.selectItem(filePersonal); await dataTable.selectItem(filePersonal);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(filePersonal)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(filePersonal)).toBe(true, 'File not found in download location');
}); });
it('[C216352] Download a folder', async () => { it('[C216352] Download a folder', async () => {
await dataTable.selectItem(folderPersonal); await dataTable.selectItem(folderPersonal);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
const folderZip = `${folderPersonal}.zip`; const folderZip = `${folderPersonal}.zip`;
@ -160,7 +161,7 @@ describe('Download', () => {
it('[C216353] Download multiple items', async () => { it('[C216353] Download multiple items', async () => {
await dataTable.selectMultipleItems([filePersonal, folderPersonal]); await dataTable.selectMultipleItems([filePersonal, folderPersonal]);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location');
@ -183,14 +184,14 @@ describe('Download', () => {
it('[C280173] Download a file', async () => { it('[C280173] Download a file', async () => {
await dataTable.selectItem(fileFavorites); await dataTable.selectItem(fileFavorites);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(fileFavorites)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(fileFavorites)).toBe(true, 'File not found in download location');
}); });
it('[C280188] Download a folder', async () => { it('[C280188] Download a folder', async () => {
await dataTable.selectItem(folderFavorites); await dataTable.selectItem(folderFavorites);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
const folderZip = `${folderFavorites}.zip`; const folderZip = `${folderFavorites}.zip`;
@ -203,7 +204,7 @@ describe('Download', () => {
it('[C280189] Download multiple items', async () => { it('[C280189] Download multiple items', async () => {
await dataTable.selectMultipleItems([fileFavorites, folderFavorites]); await dataTable.selectMultipleItems([fileFavorites, folderFavorites]);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location');
@ -226,14 +227,14 @@ describe('Download', () => {
it('[C280170] Download a file', async () => { it('[C280170] Download a file', async () => {
await dataTable.selectItem(fileShared1); await dataTable.selectItem(fileShared1);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(fileShared1)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(fileShared1)).toBe(true, 'File not found in download location');
}); });
it('[C280183] Download multiple items', async () => { it('[C280183] Download multiple items', async () => {
await dataTable.selectMultipleItems([fileShared1, fileShared2]); await dataTable.selectMultipleItems([fileShared1, fileShared2]);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location');
@ -252,14 +253,14 @@ describe('Download', () => {
it('[C280167] Download a file', async () => { it('[C280167] Download a file', async () => {
await dataTable.selectItem(fileRecent1); await dataTable.selectItem(fileRecent1);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(fileRecent1)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(fileRecent1)).toBe(true, 'File not found in download location');
}); });
it('[C280177] Download multiple items', async () => { it('[C280177] Download multiple items', async () => {
await dataTable.selectMultipleItems([fileRecent1, fileRecent2]); await dataTable.selectMultipleItems([fileRecent1, fileRecent2]);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location');
@ -281,14 +282,14 @@ describe('Download', () => {
it('[C279164] Download a file', async () => { it('[C279164] Download a file', async () => {
await dataTable.selectItem(fileSearch, parent); await dataTable.selectItem(fileSearch, parent);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(fileSearch)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(fileSearch)).toBe(true, 'File not found in download location');
}); });
it('[C297694] Download a folder', async () => { it('[C297694] Download a folder', async () => {
await dataTable.selectItem(folderSearch, parent); await dataTable.selectItem(folderSearch, parent);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
const folderZip = `${folderSearch}.zip`; const folderZip = `${folderSearch}.zip`;
@ -301,7 +302,7 @@ describe('Download', () => {
it('[C297695] Download multiple items', async () => { it('[C297695] Download multiple items', async () => {
await dataTable.selectMultipleItems([fileSearch, folderSearch], parent); await dataTable.selectMultipleItems([fileSearch, folderSearch], parent);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location');

View File

@ -34,6 +34,7 @@ import {
Utils, Utils,
clearTextWithBackspace clearTextWithBackspace
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Edit folder', () => { describe('Edit folder', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -142,7 +143,7 @@ describe('Edit folder', () => {
await dataTable.doubleClickOnRowByName(parent); await dataTable.doubleClickOnRowByName(parent);
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
expect(await editDialog.getTitle()).toEqual('Edit folder'); expect(await editDialog.getTitle()).toEqual('Edit folder');
expect(await editDialog.getName()).toBe(folderName); expect(await editDialog.getName()).toBe(folderName);
@ -162,11 +163,11 @@ describe('Edit folder', () => {
it('[C216335] properties are modified when pressing OK', async (done) => { it('[C216335] properties are modified when pressing OK', async (done) => {
await dataTable.selectItem(folderNameToEdit); await dataTable.selectItem(folderNameToEdit);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited); await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited); await editDialog.enterName(folderNameEdited);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
await editDialog.waitForDialogToClose(); await editDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -179,7 +180,7 @@ describe('Edit folder', () => {
it('[C216332] with empty folder name', async () => { it('[C216332] with empty folder name', async () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await clearTextWithBackspace(editDialog.nameInput); await clearTextWithBackspace(editDialog.nameInput);
expect(await editDialog.isUpdateButtonEnabled()).toBe(false, 'upload button is not enabled'); expect(await editDialog.isUpdateButtonEnabled()).toBe(false, 'upload button is not enabled');
@ -191,7 +192,7 @@ describe('Edit folder', () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
for (const name of namesWithSpecialChars) { for (const name of namesWithSpecialChars) {
await editDialog.enterName(name); await editDialog.enterName(name);
@ -203,7 +204,7 @@ describe('Edit folder', () => {
it('[C216334] with name ending with a dot', async () => { it('[C216334] with name ending with a dot', async () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.nameInput.sendKeys('.'); await editDialog.nameInput.sendKeys('.');
@ -214,7 +215,7 @@ describe('Edit folder', () => {
it('[C216336] Cancel button', async () => { it('[C216336] Cancel button', async () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.clickCancel(); await editDialog.clickCancel();
@ -224,10 +225,10 @@ describe('Edit folder', () => {
it('[C216337] with duplicate folder name', async () => { it('[C216337] with duplicate folder name', async () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterName(duplicateFolderName); await editDialog.enterName(duplicateFolderName);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -236,9 +237,9 @@ describe('Edit folder', () => {
it('[C216338] trim ending spaces', async () => { it('[C216338] trim ending spaces', async () => {
await dataTable.selectItem(folderName); await dataTable.selectItem(folderName);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.nameInput.sendKeys(' '); await editDialog.nameInput.sendKeys(' ');
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
await editDialog.waitForDialogToClose(); await editDialog.waitForDialogToClose();
expect(await page.snackBar.isPresent()).not.toBe(true, 'notification appears'); expect(await page.snackBar.isPresent()).not.toBe(true, 'notification appears');
@ -255,11 +256,11 @@ describe('Edit folder', () => {
it('[C280384] properties are modified when pressing OK', async (done) => { it('[C280384] properties are modified when pressing OK', async (done) => {
await dataTable.selectItem(folderFavoriteToEdit); await dataTable.selectItem(folderFavoriteToEdit);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited); await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited); await editDialog.enterName(folderNameEdited);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
await editDialog.waitForDialogToClose(); await editDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -272,10 +273,10 @@ describe('Edit folder', () => {
it('[C280386] with duplicate folder name', async () => { it('[C280386] with duplicate folder name', async () => {
await dataTable.selectItem(folderFavorite); await dataTable.selectItem(folderFavorite);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterName(folderFavoriteDuplicate); await editDialog.enterName(folderFavoriteDuplicate);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -292,11 +293,11 @@ describe('Edit folder', () => {
it('[C280509] properties are modified when pressing OK', async (done) => { it('[C280509] properties are modified when pressing OK', async (done) => {
await dataTable.selectItem(folderSiteToEdit); await dataTable.selectItem(folderSiteToEdit);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited); await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited); await editDialog.enterName(folderNameEdited);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
await editDialog.waitForDialogToClose(); await editDialog.waitForDialogToClose();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
@ -309,10 +310,10 @@ describe('Edit folder', () => {
it('[C280511] with duplicate folder name', async () => { it('[C280511] with duplicate folder name', async () => {
await dataTable.selectItem(folderSite); await dataTable.selectItem(folderSite);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterName(duplicateFolderSite); await editDialog.enterName(duplicateFolderSite);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');
@ -329,11 +330,11 @@ describe('Edit folder', () => {
await dataTable.selectItem(folderSearchToEdit); await dataTable.selectItem(folderSearchToEdit);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterDescription(folderDescriptionEdited); await editDialog.enterDescription(folderDescriptionEdited);
await editDialog.enterName(folderNameEdited2); await editDialog.enterName(folderNameEdited2);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
await editDialog.waitForDialogToClose(); await editDialog.waitForDialogToClose();
await page.refresh(); await page.refresh();
@ -351,10 +352,10 @@ describe('Edit folder', () => {
await dataTable.selectItem(folderSearch); await dataTable.selectItem(folderSearch);
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.menu.editFolderAction.click(); await BrowserActions.click(toolbar.menu.editFolderAction);
await editDialog.waitForDialogToOpen(); await editDialog.waitForDialogToOpen();
await editDialog.enterName(folderSearchDuplicate); await editDialog.enterName(folderSearchDuplicate);
await editDialog.updateButton.click(); await BrowserActions.click(editDialog.updateButton);
expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`);
expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present');

View File

@ -34,6 +34,7 @@ import {
ConfirmDialog, ConfirmDialog,
RepoClient RepoClient
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Library actions', () => { describe('Library actions', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -89,12 +90,9 @@ describe('Library actions', () => {
await adminApiActions.sites.createSite(siteSearchModerated2Admin, SITE_VISIBILITY.MODERATED); await adminApiActions.sites.createSite(siteSearchModerated2Admin, SITE_VISIBILITY.MODERATED);
await apis.user.sites.createSite(siteSearchForDelete); await apis.user.sites.createSite(siteSearchForDelete);
await apis.user.queries.waitForSites('site-public-search', { expect: 5 });
await apis.user.queries.waitForSites('site-moderated-search', { expect: 2 });
await loginPage.loginWith(username); await loginPage.loginWith(username);
done(); done();
}); }, 300000);
beforeEach(async () => { beforeEach(async () => {
await Utils.pressEscape(); await Utils.pressEscape();
@ -141,7 +139,7 @@ describe('Library actions', () => {
it('[C290105] from Favorite Libraries', async () => { it('[C290105] from Favorite Libraries', async () => {
await page.goToFavoriteLibrariesAndWait(); await page.goToFavoriteLibrariesAndWait();
await dataTable.selectItem(sitePublic1Admin); await dataTable.selectItem(sitePublic1Admin);
await toolbar.joinButton.click(); await BrowserActions.click(toolbar.joinButton);
expect(await dataTable.getLibraryRole(sitePublic1Admin)).toEqual(SITE_ROLES.SITE_CONSUMER.LABEL); expect(await dataTable.getLibraryRole(sitePublic1Admin)).toEqual(SITE_ROLES.SITE_CONSUMER.LABEL);
}); });
@ -153,7 +151,7 @@ describe('Library actions', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(siteSearchPublic1Admin); await dataTable.selectItem(siteSearchPublic1Admin);
await toolbar.joinButton.click(); await BrowserActions.click(toolbar.joinButton);
expect(await dataTable.getLibraryRole(siteSearchPublic1Admin)).toEqual(SITE_ROLES.SITE_CONSUMER.LABEL); expect(await dataTable.getLibraryRole(siteSearchPublic1Admin)).toEqual(SITE_ROLES.SITE_CONSUMER.LABEL);
}); });
@ -170,7 +168,7 @@ describe('Library actions', () => {
it('[C290109] from Favorite Libraries', async () => { it('[C290109] from Favorite Libraries', async () => {
await page.goToFavoriteLibrariesAndWait(); await page.goToFavoriteLibrariesAndWait();
await dataTable.selectItem(siteModerated1Admin); await dataTable.selectItem(siteModerated1Admin);
await toolbar.joinButton.click(); await BrowserActions.click(toolbar.joinButton);
expect(await dataTable.getLibraryRole(siteModerated1Admin)).toEqual(SITE_ROLES.NONE.LABEL); expect(await dataTable.getLibraryRole(siteModerated1Admin)).toEqual(SITE_ROLES.NONE.LABEL);
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated1Admin); const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated1Admin);
@ -184,7 +182,7 @@ describe('Library actions', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(siteSearchModerated1Admin); await dataTable.selectItem(siteSearchModerated1Admin);
await toolbar.joinButton.click(); await BrowserActions.click(toolbar.joinButton);
expect(await dataTable.getLibraryRole(siteSearchModerated1Admin)).toEqual(SITE_ROLES.NONE.LABEL); expect(await dataTable.getLibraryRole(siteSearchModerated1Admin)).toEqual(SITE_ROLES.NONE.LABEL);
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated1Admin); const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated1Admin);
@ -212,9 +210,9 @@ describe('Library actions', () => {
it('[C290106] from My Libraries', async () => { it('[C290106] from My Libraries', async () => {
await page.goToMyLibrariesAndWait(); await page.goToMyLibrariesAndWait();
await dataTable.selectItem(sitePublic2Admin); await dataTable.selectItem(sitePublic2Admin);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.okButton.click(); await BrowserActions.click(confirmDialog.okButton);
expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); expect(await page.getSnackBarMessage()).toEqual(`You have left the library`);
expect(await dataTable.isItemPresent(sitePublic2Admin)).toBe(false, `${sitePublic2Admin} is displayed`); expect(await dataTable.isItemPresent(sitePublic2Admin)).toBe(false, `${sitePublic2Admin} is displayed`);
@ -223,9 +221,9 @@ describe('Library actions', () => {
it('[C290110] from Favorite Libraries', async () => { it('[C290110] from Favorite Libraries', async () => {
await page.goToFavoriteLibrariesAndWait(); await page.goToFavoriteLibrariesAndWait();
await dataTable.selectItem(sitePublic3Admin); await dataTable.selectItem(sitePublic3Admin);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.okButton.click(); await BrowserActions.click(confirmDialog.okButton);
expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); expect(await page.getSnackBarMessage()).toEqual(`You have left the library`);
expect(await dataTable.isItemPresent(sitePublic3Admin)).toBe(true, `${sitePublic3Admin} is not displayed`); expect(await dataTable.isItemPresent(sitePublic3Admin)).toBe(true, `${sitePublic3Admin} is not displayed`);
@ -238,9 +236,9 @@ describe('Library actions', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(siteSearchPublic2Admin); await dataTable.selectItem(siteSearchPublic2Admin);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.okButton.click(); await BrowserActions.click(confirmDialog.okButton);
expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); expect(await page.getSnackBarMessage()).toEqual(`You have left the library`);
expect(await dataTable.isItemPresent(siteSearchPublic2Admin)).toBe(true, `${siteSearchPublic2Admin} is not displayed`); expect(await dataTable.isItemPresent(siteSearchPublic2Admin)).toBe(true, `${siteSearchPublic2Admin} is not displayed`);
@ -249,7 +247,7 @@ describe('Library actions', () => {
it('[C290136] Confirmation dialog UI', async () => { it('[C290136] Confirmation dialog UI', async () => {
await page.goToMyLibrariesAndWait(); await page.goToMyLibrariesAndWait();
await dataTable.selectItem(sitePublic4Admin); await dataTable.selectItem(sitePublic4Admin);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open'); expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
@ -262,20 +260,21 @@ describe('Library actions', () => {
it('[C290111] Cancel Leave Library', async () => { it('[C290111] Cancel Leave Library', async () => {
await page.goToMyLibrariesAndWait(); await page.goToMyLibrariesAndWait();
await dataTable.selectItem(sitePublic5Admin); await dataTable.selectItem(sitePublic5Admin);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled'); expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled');
await confirmDialog.cancelButton.click(); await BrowserActions.click(confirmDialog.cancelButton);
expect(await dataTable.isItemPresent(sitePublic5Admin)).toBe(true, `${sitePublic5Admin} was deleted`); expect(await dataTable.isItemPresent(sitePublic5Admin)).toBe(true, `${sitePublic5Admin} was deleted`);
}); });
it('[C290107] Leave a library - failure notification', async () => { it('[C290107] Leave a library - failure notification', async () => {
await page.goToMyLibrariesAndWait(); await page.goToMyLibrariesAndWait();
await dataTable.selectItem(sitePublicUser); await dataTable.selectItem(sitePublicUser);
await toolbar.leaveButton.click(); await BrowserActions.click(toolbar.leaveButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.okButton.click(); await BrowserActions.click(confirmDialog.okButton);
expect(await page.getSnackBarMessage()).toEqual(`Cannot leave this library`); expect(await page.getSnackBarMessage()).toEqual(`Cannot leave this library`);
}); });

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, UserActions, LoginPage, BrowsingPage, ConfirmDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, ConfirmDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Permanently delete from Trash', () => { describe('Permanently delete from Trash', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -79,9 +80,9 @@ describe('Permanently delete from Trash', () => {
it('[C217091] delete a file', async () => { it('[C217091] delete a file', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.deleteButton.click(); await BrowserActions.click(confirmDialog.deleteButton);
expect(await page.getSnackBarMessage()).toEqual(`${file1} deleted`); expect(await page.getSnackBarMessage()).toEqual(`${file1} deleted`);
expect(await dataTable.isItemPresent(file1)).toBe(false, 'Item was not deleted'); expect(await dataTable.isItemPresent(file1)).toBe(false, 'Item was not deleted');
@ -89,9 +90,9 @@ describe('Permanently delete from Trash', () => {
it('[C280416] delete a folder', async () => { it('[C280416] delete a folder', async () => {
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.deleteButton.click(); await BrowserActions.click(confirmDialog.deleteButton);
expect(await page.getSnackBarMessage()).toEqual(`${folder1} deleted`); expect(await page.getSnackBarMessage()).toEqual(`${folder1} deleted`);
expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not deleted'); expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not deleted');
@ -99,9 +100,9 @@ describe('Permanently delete from Trash', () => {
it('[C290103] delete a library', async () => { it('[C290103] delete a library', async () => {
await dataTable.selectItem(site); await dataTable.selectItem(site);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.deleteButton.click(); await BrowserActions.click(confirmDialog.deleteButton);
expect(await page.getSnackBarMessage()).toEqual(`${site} deleted`); expect(await page.getSnackBarMessage()).toEqual(`${site} deleted`);
expect(await dataTable.isItemPresent(site)).toBe(false, `${site} was not deleted`); expect(await dataTable.isItemPresent(site)).toBe(false, `${site} was not deleted`);
@ -109,9 +110,9 @@ describe('Permanently delete from Trash', () => {
it('[C280417] delete multiple items', async () => { it('[C280417] delete multiple items', async () => {
await dataTable.selectMultipleItems([file2, folder2]); await dataTable.selectMultipleItems([file2, folder2]);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
await confirmDialog.deleteButton.click(); await BrowserActions.click(confirmDialog.deleteButton);
expect(await page.getSnackBarMessage()).toEqual(`2 items deleted`); expect(await page.getSnackBarMessage()).toEqual(`2 items deleted`);
expect(await dataTable.isItemPresent(file2)).toBe(false, 'Item was not deleted'); expect(await dataTable.isItemPresent(file2)).toBe(false, 'Item was not deleted');
@ -120,7 +121,7 @@ describe('Permanently delete from Trash', () => {
it('[C269113] Confirmation dialog UI', async () => { it('[C269113] Confirmation dialog UI', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open'); expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
@ -135,11 +136,11 @@ describe('Permanently delete from Trash', () => {
it('[C269115] Keep action cancels the deletion', async () => { it('[C269115] Keep action cancels the deletion', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.permanentlyDeleteButton.click(); await BrowserActions.click(toolbar.permanentlyDeleteButton);
await page.waitForDialog(); await page.waitForDialog();
expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled'); expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled');
await confirmDialog.keepButton.click(); await BrowserActions.click(confirmDialog.keepButton);
expect(await dataTable.isItemPresent(file3)).toBe(true, 'Item was deleted'); expect(await dataTable.isItemPresent(file3)).toBe(true, 'Item was deleted');
}); });
}); });

View File

@ -25,6 +25,7 @@
import { browser } from 'protractor'; import { browser } from 'protractor';
import { AdminActions, UserActions, LoginPage, BrowsingPage, APP_ROUTES, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, APP_ROUTES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Restore from Trash', () => { describe('Restore from Trash', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -82,7 +83,7 @@ describe('Restore from Trash', () => {
it('[C217177] restore file', async () => { it('[C217177] restore file', async () => {
await dataTable.selectItem(file); await dataTable.selectItem(file);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage(); const text = await page.getSnackBarMessage();
expect(text).toContain(`${file} restored`); expect(text).toContain(`${file} restored`);
expect(text).toContain(`View`); expect(text).toContain(`View`);
@ -95,7 +96,7 @@ describe('Restore from Trash', () => {
it('[C280438] restore folder', async () => { it('[C280438] restore folder', async () => {
await dataTable.selectItem(folder); await dataTable.selectItem(folder);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage(); const text = await page.getSnackBarMessage();
expect(text).toContain(`${folder} restored`); expect(text).toContain(`${folder} restored`);
expect(text).toContain(`View`); expect(text).toContain(`View`);
@ -108,7 +109,7 @@ describe('Restore from Trash', () => {
it('[C290104] restore library', async () => { it('[C290104] restore library', async () => {
await dataTable.selectItem(site); await dataTable.selectItem(site);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage(); const text = await page.getSnackBarMessage();
expect(text).toContain(`${site} restored`); expect(text).toContain(`${site} restored`);
expect(text).toContain(`View`); expect(text).toContain(`View`);
@ -119,7 +120,7 @@ describe('Restore from Trash', () => {
it('[C217182] restore multiple items', async () => { it('[C217182] restore multiple items', async () => {
await dataTable.selectMultipleItems([file, folder]); await dataTable.selectMultipleItems([file, folder]);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
const text = await page.getSnackBarMessage(); const text = await page.getSnackBarMessage();
expect(text).toContain(`Restore successful`); expect(text).toContain(`Restore successful`);
expect(text).not.toContain(`View`); expect(text).not.toContain(`View`);
@ -134,7 +135,7 @@ describe('Restore from Trash', () => {
it('[C217181] View from notification', async () => { it('[C217181] View from notification', async () => {
await dataTable.selectItem(file); await dataTable.selectItem(file);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
await page.clickSnackBarAction(); await page.clickSnackBarAction();
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
expect(await page.sidenav.isActive('Personal Files')).toBe(true, 'Personal Files sidebar link not active'); expect(await page.sidenav.isActive('Personal Files')).toBe(true, 'Personal Files sidebar link not active');
@ -183,14 +184,14 @@ describe('Restore from Trash', () => {
it('[C217178] Restore a file when another file with same name exists on the restore location', async () => { it('[C217178] Restore a file when another file with same name exists on the restore location', async () => {
await page.clickTrashAndWait(); await page.clickTrashAndWait();
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
expect(await page.getSnackBarMessage()).toEqual(`Can't restore, ${file1} already exists`); expect(await page.getSnackBarMessage()).toEqual(`Can't restore, ${file1} already exists`);
}); });
it('[C217179] Restore a file when original location no longer exists', async () => { it('[C217179] Restore a file when original location no longer exists', async () => {
await page.clickTrashAndWait(); await page.clickTrashAndWait();
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
expect(await page.getSnackBarMessage()).toEqual(`Can't restore ${file2}, the original location no longer exists`); expect(await page.getSnackBarMessage()).toEqual(`Can't restore ${file2}, the original location no longer exists`);
}); });
}); });
@ -247,13 +248,13 @@ describe('Restore from Trash', () => {
it('[C217183] one failure', async () => { it('[C217183] one failure', async () => {
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
expect(await page.getSnackBarMessage()).toEqual(`Can't restore ${file1}, the original location no longer exists`); expect(await page.getSnackBarMessage()).toEqual(`Can't restore ${file1}, the original location no longer exists`);
}); });
it('[C217184] multiple failures', async () => { it('[C217184] multiple failures', async () => {
await dataTable.selectMultipleItems([file3, file4, file5]); await dataTable.selectMultipleItems([file3, file4, file5]);
await toolbar.restoreButton.click(); await BrowserActions.click(toolbar.restoreButton);
expect(await page.getSnackBarMessage()).toEqual('2 items not restored because of issues with the restore location'); expect(await page.getSnackBarMessage()).toEqual('2 items not restored because of issues with the restore location');
}); });
}); });

View File

@ -35,6 +35,7 @@ import {
Viewer, Viewer,
Utils Utils
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Share a file', () => { describe('Share a file', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -109,7 +110,7 @@ describe('Share a file', () => {
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
expect(await viewer.getFileTitle()).toEqual(file6); expect(await viewer.getFileTitle()).toEqual(file6);
await toolbar.downloadButton.click(); await BrowserActions.click(toolbar.downloadButton);
expect(await Utils.fileExistsOnOS(file6)).toBe(true, 'File not found in download location'); expect(await Utils.fileExistsOnOS(file6)).toBe(true, 'File not found in download location');
}); });
}); });
@ -170,7 +171,7 @@ describe('Share a file', () => {
it('[C286327] Share dialog default values', async () => { it('[C286327] Share dialog default values', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`);
@ -186,7 +187,7 @@ describe('Share a file', () => {
it('[C286328] Close dialog', async () => { it('[C286328] Close dialog', async () => {
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled');
@ -196,7 +197,7 @@ describe('Share a file', () => {
it('[C286329] Share a file', async () => { it('[C286329] Share a file', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
@ -208,12 +209,13 @@ describe('Share a file', () => {
it('[C286330] Copy shared file URL', async () => { it('[C286330] Copy shared file URL', async () => {
await dataTable.selectItem(file4); await dataTable.selectItem(file4);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl); expect(url).toContain(shareLinkPreUrl);
await shareDialog.urlAction.click(); await BrowserActions.click(shareDialog.urlAction);
expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard');
await browser.get(url); await browser.get(url);
@ -225,12 +227,15 @@ describe('Share a file', () => {
it('[C286332] Share a file with expiration date', async () => { it('[C286332] Share a file with expiration date', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click(); await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked');
await shareDialog.datetimePickerButton.click();
await BrowserActions.click(shareDialog.datetimePickerButton);
expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened');
const date = await shareDialog.dateTimePicker.setDefaultDay(); const date = await shareDialog.dateTimePicker.setDefaultDay();
await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
@ -247,7 +252,7 @@ describe('Share a file', () => {
it('[C286337] Expire date is displayed correctly', async () => { it('[C286337] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -258,7 +263,7 @@ describe('Share a file', () => {
it('[C286333] Disable the share link expiration', async () => { it('[C286333] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -274,7 +279,7 @@ describe('Share a file', () => {
it('[C286335] Shared file URL is not changed when Share dialog is closed and opened again', async () => { it('[C286335] Shared file URL is not changed when Share dialog is closed and opened again', async () => {
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url1 = await shareDialog.getLinkUrl(); const url1 = await shareDialog.getLinkUrl();
await shareDialog.clickClose(); await shareDialog.clickClose();
@ -282,7 +287,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();
@ -349,7 +354,7 @@ describe('Share a file', () => {
it('[C286639] Share dialog default values', async () => { it('[C286639] Share dialog default values', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`);
@ -365,7 +370,7 @@ describe('Share a file', () => {
it('[C286640] Close dialog', async () => { it('[C286640] Close dialog', async () => {
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled');
@ -375,7 +380,7 @@ describe('Share a file', () => {
it('[C286641] Share a file', async () => { it('[C286641] Share a file', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
@ -387,7 +392,7 @@ describe('Share a file', () => {
it('[C286642] Copy shared file URL', async () => { it('[C286642] Copy shared file URL', async () => {
await dataTable.selectItem(file4); await dataTable.selectItem(file4);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl); expect(url).toContain(shareLinkPreUrl);
@ -404,7 +409,7 @@ describe('Share a file', () => {
it('[C286643] Share a file with expiration date', async () => { it('[C286643] Share a file with expiration date', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click(); await shareDialog.expireToggle.click();
@ -426,7 +431,7 @@ describe('Share a file', () => {
it('[C286644] Expire date is displayed correctly', async () => { it('[C286644] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -437,7 +442,7 @@ describe('Share a file', () => {
it('[C286645] Disable the share link expiration', async () => { it('[C286645] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -453,7 +458,7 @@ describe('Share a file', () => {
it('[C286646] Shared file URL is not changed when Share dialog is closed and opened again', async () => { it('[C286646] Shared file URL is not changed when Share dialog is closed and opened again', async () => {
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url1 = await shareDialog.getLinkUrl(); const url1 = await shareDialog.getLinkUrl();
await shareDialog.clickClose(); await shareDialog.clickClose();
@ -461,7 +466,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();
@ -525,7 +530,7 @@ describe('Share a file', () => {
it('[C286657] Share dialog default values', async () => { it('[C286657] Share dialog default values', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`);
@ -541,7 +546,7 @@ describe('Share a file', () => {
it('[C286658] Close dialog', async () => { it('[C286658] Close dialog', async () => {
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled');
@ -551,7 +556,7 @@ describe('Share a file', () => {
it('[C286659] Share a file', async () => { it('[C286659] Share a file', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
@ -563,7 +568,7 @@ describe('Share a file', () => {
it('[C286660] Copy shared file URL', async () => { it('[C286660] Copy shared file URL', async () => {
await dataTable.selectItem(file4); await dataTable.selectItem(file4);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl); expect(url).toContain(shareLinkPreUrl);
@ -580,7 +585,7 @@ describe('Share a file', () => {
it('[C286661] Share a file with expiration date', async () => { it('[C286661] Share a file with expiration date', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click(); await shareDialog.expireToggle.click();
@ -602,7 +607,7 @@ describe('Share a file', () => {
it('[C286662] Expire date is displayed correctly', async () => { it('[C286662] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -613,7 +618,7 @@ describe('Share a file', () => {
it('[C286663] Disable the share link expiration', async () => { it('[C286663] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -629,7 +634,7 @@ describe('Share a file', () => {
it('[C286664] Shared file URL is not changed when Share dialog is closed and opened again', async () => { it('[C286664] Shared file URL is not changed when Share dialog is closed and opened again', async () => {
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url1 = await shareDialog.getLinkUrl(); const url1 = await shareDialog.getLinkUrl();
await shareDialog.clickClose(); await shareDialog.clickClose();
@ -637,7 +642,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();
@ -699,7 +704,7 @@ describe('Share a file', () => {
it('[C286648] Share dialog default values', async () => { it('[C286648] Share dialog default values', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`);
@ -715,7 +720,7 @@ describe('Share a file', () => {
it('[C286649] Close dialog', async () => { it('[C286649] Close dialog', async () => {
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled');
@ -725,7 +730,7 @@ describe('Share a file', () => {
it('[C286651] Copy shared file URL', async () => { it('[C286651] Copy shared file URL', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl); expect(url).toContain(shareLinkPreUrl);
@ -742,7 +747,7 @@ describe('Share a file', () => {
it('[C286653] Expire date is displayed correctly', async () => { it('[C286653] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file4); await dataTable.selectItem(file4);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file4Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file4Id);
@ -753,7 +758,7 @@ describe('Share a file', () => {
it('[C286654] Disable the share link expiration', async () => { it('[C286654] Disable the share link expiration', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -769,7 +774,7 @@ describe('Share a file', () => {
it('[C286655] Shared file URL is not changed when Share dialog is closed and opened again', async () => { it('[C286655] Shared file URL is not changed when Share dialog is closed and opened again', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url1 = await shareDialog.getLinkUrl(); const url1 = await shareDialog.getLinkUrl();
await shareDialog.clickClose(); await shareDialog.clickClose();
@ -777,7 +782,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();
@ -856,7 +861,7 @@ describe('Share a file', () => {
it('[C286666] Share dialog default values', async () => { it('[C286666] Share dialog default values', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`);
@ -872,7 +877,7 @@ describe('Share a file', () => {
it('[C286667] Close dialog', async () => { it('[C286667] Close dialog', async () => {
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled');
@ -882,7 +887,7 @@ describe('Share a file', () => {
it('[C286668] Share a file', async () => { it('[C286668] Share a file', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
@ -894,7 +899,7 @@ describe('Share a file', () => {
it('[C286669] Copy shared file URL', async () => { it('[C286669] Copy shared file URL', async () => {
await dataTable.selectItem(file4); await dataTable.selectItem(file4);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl); expect(url).toContain(shareLinkPreUrl);
@ -911,7 +916,7 @@ describe('Share a file', () => {
it('[C286670] Share a file with expiration date', async () => { it('[C286670] Share a file with expiration date', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click(); await shareDialog.expireToggle.click();
@ -933,7 +938,7 @@ describe('Share a file', () => {
it('[C286671] Expire date is displayed correctly', async () => { it('[C286671] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -944,7 +949,7 @@ describe('Share a file', () => {
it('[C286672] Disable the share link expiration', async () => { it('[C286672] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -960,7 +965,7 @@ describe('Share a file', () => {
it('[C286673] Shared file URL is not changed when Share dialog is closed and opened again', async () => { it('[C286673] Shared file URL is not changed when Share dialog is closed and opened again', async () => {
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url1 = await shareDialog.getLinkUrl(); const url1 = await shareDialog.getLinkUrl();
await shareDialog.clickClose(); await shareDialog.clickClose();
@ -968,7 +973,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();
@ -1035,7 +1040,7 @@ describe('Share a file', () => {
it('[C306975] Share a file', async () => { it('[C306975] Share a file', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
@ -1047,7 +1052,7 @@ describe('Share a file', () => {
it('[C306977] Share a file with expiration date', async () => { it('[C306977] Share a file with expiration date', async () => {
await dataTable.selectItem(file5); await dataTable.selectItem(file5);
await toolbar.shareButton.click(); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click(); await shareDialog.expireToggle.click();
@ -1069,7 +1074,7 @@ describe('Share a file', () => {
it('[C306978] Expire date is displayed correctly', async () => { it('[C306978] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -1080,13 +1085,14 @@ describe('Share a file', () => {
it('[C306979] Disable the share link expiration', async () => { it('[C306979] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await toolbar.shareEditButton.click(); await BrowserActions.click(toolbar.shareEditButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click(); await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@ -1097,7 +1103,8 @@ describe('Share a file', () => {
it('[C306981] Share a file from the context menu', async () => { it('[C306981] Share a file from the context menu', async () => {
await dataTable.rightClickOnItem(file9); await dataTable.rightClickOnItem(file9);
await contextMenu.waitForMenuToOpen(); await contextMenu.waitForMenuToOpen();
await contextMenu.shareAction.click(); await BrowserActions.click(contextMenu.shareAction);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();

View File

@ -27,6 +27,7 @@ import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils, Upload
import { VersionManagePage } from '../../../projects/aca-testing-shared/src/components/version-manage/version-manager'; import { VersionManagePage } from '../../../projects/aca-testing-shared/src/components/version-manage/version-manager';
import { Viewer } from '../../../projects/aca-testing-shared/src/components'; import { Viewer } from '../../../projects/aca-testing-shared/src/components';
import { browser } from 'protractor'; import { browser } from 'protractor';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Version component actions', () => { describe('Version component actions', () => {
const versionManagePage = new VersionManagePage(); const versionManagePage = new VersionManagePage();
@ -62,9 +63,11 @@ describe('Version component actions', () => {
await page.waitForDialog(); await page.waitForDialog();
await uploadNewVersionDialog.majorOption.click(); await BrowserActions.click(uploadNewVersionDialog.majorOption);
await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.uploadButton.click(); await BrowserActions.click(uploadNewVersionDialog.uploadButton);
await uploadNewVersionDialog.waitForDialogToClose(); await uploadNewVersionDialog.waitForDialogToClose();
} }
done(); done();

View File

@ -24,7 +24,7 @@
*/ */
import { browser } from 'protractor'; import { browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserActions, Logger } from '@alfresco/adf-testing';
import { BrowsingPage, LoginPage, CreateOrEditFolderDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { BrowsingPage, LoginPage, CreateOrEditFolderDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
describe('General', () => { describe('General', () => {
@ -55,7 +55,7 @@ describe('General', () => {
await adminApi.logout(); await adminApi.logout();
await createDialog.createButton.click(); await BrowserActions.click(createDialog.createButton);
expect(await page.getSnackBarMessage()).toEqual('The action was unsuccessful. Try again or contact your IT Team.'); expect(await page.getSnackBarMessage()).toEqual('The action was unsuccessful. Try again or contact your IT Team.');

View File

@ -25,6 +25,7 @@
import { browser } from 'protractor'; import { browser } from 'protractor';
import { AdminActions, APP_ROUTES, LoginPage, Utils, navigate } from '@alfresco/aca-testing-shared'; import { AdminActions, APP_ROUTES, LoginPage, Utils, navigate } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Login', () => { describe('Login', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
@ -87,7 +88,8 @@ describe('Login', () => {
it('[C213091] change password visibility', async () => { it('[C213091] change password visibility', async () => {
await login.enterPassword('some password'); await login.enterPassword('some password');
expect(await login.isPasswordDisplayed()).toBe(false, 'password is visible'); expect(await login.isPasswordDisplayed()).toBe(false, 'password is visible');
await login.passwordVisibility.click(); await BrowserActions.click(login.passwordVisibility);
expect(await login.isPasswordHidden()).toBe(false, 'Password visibility not changed'); expect(await login.isPasswordHidden()).toBe(false, 'Password visibility not changed');
expect(await login.isPasswordDisplayed()).toBe(true, 'password is not visible'); expect(await login.isPasswordDisplayed()).toBe(true, 'password is not visible');
}); });

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, BrowsingPage, InfoDrawer, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, BrowsingPage, InfoDrawer, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Extensions - Info Drawer', () => { describe('Extensions - Info Drawer', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -90,7 +91,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284646] Add a new tab with icon and title', async () => { it('[C284646] Add a new tab with icon and title', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
const val = await infoDrawer.getTabTitle(custom_tab.order); const val = await infoDrawer.getTabTitle(custom_tab.order);
@ -100,7 +101,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284647] Remove existing tab', async () => { it('[C284647] Remove existing tab', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`); expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`);
@ -108,7 +109,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284648] Change tab title', async () => { it('[C284648] Change tab title', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`); expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`);
@ -117,7 +118,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284649] Tab with icon and no title', async () => { it('[C284649] Tab with icon and no title', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`); expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`);
@ -126,7 +127,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284651] Insert new component in tab', async () => { it('[C284651] Insert new component in tab', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`); expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`);
@ -146,7 +147,7 @@ describe('Extensions - Info Drawer', () => {
it('[C284650] Remove all tabs', async () => { it('[C284650] Remove all tabs', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty'); expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty');

View File

@ -33,6 +33,7 @@ import {
InfoDrawer, InfoDrawer,
MetadataCard MetadataCard
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Extensions - Metadata presets', () => { describe('Extensions - Metadata presets', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -87,11 +88,11 @@ describe('Extensions - Metadata presets', () => {
await page.refresh(); await page.refresh();
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickTab(properties_tab.title); await infoDrawer.clickTab(properties_tab.title);
await metadataCard.expandButton.click(); await BrowserActions.click(metadataCard.expandButton);
await metadataCard.waitForFirstExpansionPanel(); await metadataCard.waitForFirstExpansionPanel();
done(); done();

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, BrowsingPage, Viewer, RepoClient, EXTENSIBILITY_CONFIGS, FILES, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, BrowsingPage, Viewer, RepoClient, EXTENSIBILITY_CONFIGS, FILES, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Extensions - Viewer', () => { describe('Extensions - Viewer', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -105,7 +106,7 @@ describe('Extensions - Viewer', () => {
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present'); expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component); expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component);
await viewer.closeButton.click(); await BrowserActions.click(viewer.closeButton);
await page.dataTable.doubleClickOnRowByName(docxFile.file_name); await page.dataTable.doubleClickOnRowByName(docxFile.file_name);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');

View File

@ -25,6 +25,7 @@
import { AdminActions, UserActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
const moment = require('moment'); const moment = require('moment');
import { BrowserActions } from '@alfresco/adf-testing';
describe('Comments', () => { describe('Comments', () => {
const username = `user1-${Utils.random()}`; const username = `user1-${Utils.random()}`;
@ -119,7 +120,7 @@ describe('Comments', () => {
it('[C299173] Comments tab default fields', async () => { it('[C299173] Comments tab default fields', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -131,7 +132,7 @@ describe('Comments', () => {
it('[C280583] Comments are displayed ordered by created date in descending order', async () => { it('[C280583] Comments are displayed ordered by created date in descending order', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -141,7 +142,7 @@ describe('Comments', () => {
it('[C280585] Total number of comments is displayed', async () => { it('[C280585] Total number of comments is displayed', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -150,7 +151,7 @@ describe('Comments', () => {
it('[C280589] Add button is enabled when typing in the comment field', async () => { it('[C280589] Add button is enabled when typing in the comment field', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -164,7 +165,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(file2Personal); await dataTable.selectItem(file2Personal);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -179,7 +180,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -192,7 +193,7 @@ describe('Comments', () => {
it('[C280591] Escape key clears the text when focus is on the textarea', async () => { it('[C280591] Escape key clears the text when focus is on the textarea', async () => {
await dataTable.selectItem(file2Personal); await dataTable.selectItem(file2Personal);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment('myComment'); await commentsTab.typeComment('myComment');
@ -218,7 +219,7 @@ describe('Comments', () => {
it('[C299197] Comments are displayed ordered by created date in descending order', async () => { it('[C299197] Comments are displayed ordered by created date in descending order', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -228,7 +229,7 @@ describe('Comments', () => {
it('[C299198] Total number of comments is displayed', async () => { it('[C299198] Total number of comments is displayed', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -239,7 +240,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(file2Favorites); await dataTable.selectItem(file2Favorites);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -254,7 +255,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(folder2); await dataTable.selectItem(folder2);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -274,7 +275,7 @@ describe('Comments', () => {
it('[C299189] Comments are displayed ordered by created date in descending order', async () => { it('[C299189] Comments are displayed ordered by created date in descending order', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -284,7 +285,7 @@ describe('Comments', () => {
it('[C299190] Total number of comments is displayed', async () => { it('[C299190] Total number of comments is displayed', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -295,7 +296,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(file2Shared); await dataTable.selectItem(file2Shared);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -320,7 +321,7 @@ describe('Comments', () => {
it('[C299193] Comments are displayed ordered by created date in descending order', async () => { it('[C299193] Comments are displayed ordered by created date in descending order', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -330,7 +331,7 @@ describe('Comments', () => {
it('[C299194] Total number of comments is displayed', async () => { it('[C299194] Total number of comments is displayed', async () => {
await dataTable.selectItem(fileWith2Comments); await dataTable.selectItem(fileWith2Comments);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -341,7 +342,7 @@ describe('Comments', () => {
const myComment = 'my comment'; const myComment = 'my comment';
await dataTable.selectItem(file2Recent); await dataTable.selectItem(file2Recent);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
await commentsTab.typeComment(myComment); await commentsTab.typeComment(myComment);
@ -368,7 +369,7 @@ describe('Comments', () => {
await dataTable.doubleClickOnRowByName(parent); await dataTable.doubleClickOnRowByName(parent);
await dataTable.selectItem(fileWith1Comment); await dataTable.selectItem(fileWith1Comment);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -390,7 +391,7 @@ describe('Comments', () => {
await page.clickFavoritesAndWait(); await page.clickFavoritesAndWait();
await dataTable.selectItem(fileWith1Comment); await dataTable.selectItem(fileWith1Comment);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -412,7 +413,7 @@ describe('Comments', () => {
await page.clickSharedFilesAndWait(); await page.clickSharedFilesAndWait();
await dataTable.selectItem(fileWith1Comment); await dataTable.selectItem(fileWith1Comment);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();
@ -434,7 +435,7 @@ describe('Comments', () => {
await page.clickRecentFilesAndWait(); await page.clickRecentFilesAndWait();
await dataTable.selectItem(fileWith1Comment); await dataTable.selectItem(fileWith1Comment);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await infoDrawer.clickCommentsTab(); await infoDrawer.clickCommentsTab();

View File

@ -34,6 +34,7 @@ import {
DATE_TIME_FORMAT, DATE_TIME_FORMAT,
DATE_FORMAT DATE_FORMAT
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
const moment = require('moment'); const moment = require('moment');
@ -104,7 +105,7 @@ describe('File / Folder properties', () => {
describe('View properties', () => { describe('View properties', () => {
it('[C299162] Default tabs', async () => { it('[C299162] Default tabs', async () => {
await dataTable.selectItem(file1.name); await dataTable.selectItem(file1.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); expect(await infoDrawer.getHeaderTitle()).toEqual('Details');
@ -142,7 +143,7 @@ describe('File / Folder properties', () => {
]; ];
await dataTable.selectItem(file1.name); await dataTable.selectItem(file1.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed'); expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
@ -167,7 +168,7 @@ describe('File / Folder properties', () => {
]; ];
await dataTable.selectItem(folder1.name); await dataTable.selectItem(folder1.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed'); expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
@ -178,19 +179,19 @@ describe('File / Folder properties', () => {
it('[C269004] Less / More information buttons', async () => { it('[C269004] Less / More information buttons', async () => {
await dataTable.selectItem(file1.name); await dataTable.selectItem(file1.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled'); expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded'); expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded');
await propertiesTab.moreInfoButton.click(); await BrowserActions.click(propertiesTab.moreInfoButton);
expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(false, 'More information button displayed'); expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(false, 'More information button displayed');
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled'); expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
expect(await propertiesTab.isPropertiesListExpanded()).toBe(false, 'Properties list expanded'); expect(await propertiesTab.isPropertiesListExpanded()).toBe(false, 'Properties list expanded');
await propertiesTab.lessInfoButton.click(); await BrowserActions.click(propertiesTab.lessInfoButton);
expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(true, 'More information button not displayed'); expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(true, 'More information button not displayed');
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(false, 'Less information button enabled'); expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(false, 'Less information button enabled');
@ -231,11 +232,12 @@ describe('File / Folder properties', () => {
]; ];
await dataTable.selectItem(image1.name); await dataTable.selectItem(image1.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await propertiesTab.moreInfoButton.click(); await BrowserActions.click(propertiesTab.moreInfoButton);
await propertiesTab.imagePropertiesPanel.click(); await BrowserActions.click(propertiesTab.imagePropertiesPanel);
await propertiesTab.waitForImagePropertiesPanelToExpand(); await propertiesTab.waitForImagePropertiesPanelToExpand();
expect(await propertiesTab.isImagePropertiesPanelDisplayed()).toBe(true, 'Image properties panel not displayed'); expect(await propertiesTab.isImagePropertiesPanelDisplayed()).toBe(true, 'Image properties panel not displayed');

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('General', () => { describe('General', () => {
const username = `user1-${Utils.random()}`; const username = `user1-${Utils.random()}`;
@ -69,14 +70,14 @@ describe('General', () => {
afterEach(async (done) => { afterEach(async (done) => {
if (await infoDrawer.isOpen()) { if (await infoDrawer.isOpen()) {
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
} }
done(); done();
}); });
it('[C268999] Info drawer closes on page refresh', async () => { it('[C268999] Info drawer closes on page refresh', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
expect(await infoDrawer.isOpen()).toBe(true, 'Info drawer not open'); expect(await infoDrawer.isOpen()).toBe(true, 'Info drawer not open');
await page.refresh(); await page.refresh();

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Library properties', () => { describe('Library properties', () => {
const username = `user1-${Utils.random()}`; const username = `user1-${Utils.random()}`;
@ -93,14 +94,14 @@ describe('Library properties', () => {
afterEach(async (done) => { afterEach(async (done) => {
if (await infoDrawer.isOpen()) { if (await infoDrawer.isOpen()) {
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
} }
done(); done();
}); });
it('[C289336] Info drawer opens for a library', async () => { it('[C289336] Info drawer opens for a library', async () => {
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); expect(await infoDrawer.getHeaderTitle()).toEqual('Details');
@ -120,7 +121,7 @@ describe('Library properties', () => {
it('[C289338] Editable properties', async () => { it('[C289338] Editable properties', async () => {
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled');
@ -139,7 +140,7 @@ describe('Library properties', () => {
it('[C289339] Edit site details', async () => { it('[C289339] Edit site details', async () => {
await dataTable.selectItem(siteForUpdate.name); await dataTable.selectItem(siteForUpdate.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled');
@ -166,7 +167,7 @@ describe('Library properties', () => {
const newDesc = `new desc ${Utils.random}`; const newDesc = `new desc ${Utils.random}`;
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled');
@ -187,7 +188,7 @@ describe('Library properties', () => {
await apis.user.queries.waitForSites(site.name, { expect: 1 }); await apis.user.queries.waitForSites(site.name, { expect: 1 });
await dataTable.selectItem(siteDup); await dataTable.selectItem(siteDup);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await aboutTab.clickEditLibraryProperties(); await aboutTab.clickEditLibraryProperties();
@ -198,7 +199,7 @@ describe('Library properties', () => {
it('[C289342] Site name too long', async () => { it('[C289342] Site name too long', async () => {
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await aboutTab.clickEditLibraryProperties(); await aboutTab.clickEditLibraryProperties();
@ -211,7 +212,7 @@ describe('Library properties', () => {
it('[C289343] Site description too long', async () => { it('[C289343] Site description too long', async () => {
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await aboutTab.clickEditLibraryProperties(); await aboutTab.clickEditLibraryProperties();
@ -240,7 +241,7 @@ describe('Library properties', () => {
await page.goToMyLibrariesAndWait(); await page.goToMyLibrariesAndWait();
await dataTable.selectItem(site.name); await dataTable.selectItem(site.name);
await page.toolbar.viewDetailsButton.click(); await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
await aboutTab.clickEditLibraryProperties(); await aboutTab.clickEditLibraryProperties();

View File

@ -47,6 +47,9 @@ describe('Favorites', () => {
const adminApiActions = new AdminActions(); const adminApiActions = new AdminActions();
const userActions = new UserActions(); const userActions = new UserActions();
let parentId: string;
let folderId: string;
beforeAll(async (done) => { beforeAll(async (done) => {
await adminApiActions.login(); await adminApiActions.login();
await adminApiActions.createUser({ username }); await adminApiActions.createUser({ username });
@ -57,8 +60,8 @@ describe('Favorites', () => {
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE); await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
const file1Id = (await adminApiActions.nodes.createFile(fileName1, docLibId)).entry.id; const file1Id = (await adminApiActions.nodes.createFile(fileName1, docLibId)).entry.id;
const folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id; folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
const parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id; parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id; const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id; const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id;
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id; const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id;
@ -82,7 +85,7 @@ describe('Favorites', () => {
afterAll(async (done) => { afterAll(async (done) => {
await adminApiActions.deleteSites([siteName]); await adminApiActions.deleteSites([siteName]);
await userActions.deleteNodes([favFolderName, parentFolder]); await userActions.deleteNodes([folderId, parentId]);
await userActions.emptyTrashcan(); await userActions.emptyTrashcan();
done(); done();
}); });

View File

@ -42,7 +42,15 @@ describe('File / folder tooltips', () => {
const fileNameEqTitleDiffDesc = `file6-${Utils.random()}`; const fileNameEqTitleDiffDesc = `file6-${Utils.random()}`;
const fileNameEqDescDiffTitle = `file7-${Utils.random()}`; const fileNameEqDescDiffTitle = `file7-${Utils.random()}`;
const fileTitleEqDesc = `file8-${Utils.random()}`; const fileTitleEqDesc = `file8-${Utils.random()}`;
let parentId, file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id; let parentId: string;
let file1Id: string;
let file2Id: string;
let file3Id: string;
let file4Id: string;
let file5Id: string;
let file6Id: string;
let file7Id: string;
let file8Id: string;
const fileTitle = 'file title'; const fileTitle = 'file title';
const fileDescription = 'file description'; const fileDescription = 'file description';
@ -82,7 +90,7 @@ describe('File / folder tooltips', () => {
}); });
afterAll(async (done) => { afterAll(async (done) => {
await userActions.deleteNodes([parent]); await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan(); await userActions.emptyTrashcan();
done(); done();
}); });
@ -248,8 +256,15 @@ describe('File / folder tooltips', () => {
describe('on Trash', () => { describe('on Trash', () => {
const parentForTrash = `parent-${Utils.random()}`; const parentForTrash = `parent-${Utils.random()}`;
let parentForTrashId, file1TrashId, file2TrashId, file3TrashId, file4TrashId; let parentForTrashId: string;
let file5TrashId, file6TrashId, file7TrashId, file8TrashId; let file1TrashId: string;
let file2TrashId: string;
let file3TrashId: string;
let file4TrashId: string;
let file5TrashId: string;
let file6TrashId: string;
let file7TrashId: string;
let file8TrashId: string;
beforeAll(async (done) => { beforeAll(async (done) => {
parentForTrashId = (await apis.user.nodes.createFolder(parentForTrash)).entry.id; parentForTrashId = (await apis.user.nodes.createFolder(parentForTrash)).entry.id;
@ -273,7 +288,7 @@ describe('File / folder tooltips', () => {
}); });
afterAll(async (done) => { afterAll(async (done) => {
await userActions.deleteNodes([parentForTrash]); await userActions.deleteNodes([parentForTrashId]);
await userActions.emptyTrashcan(); await userActions.emptyTrashcan();
done(); done();
}); });

View File

@ -39,6 +39,13 @@ describe('Breadcrumb', () => {
const fileName1 = `file1-${Utils.random()}.txt`; const fileName1 = `file1-${Utils.random()}.txt`;
const siteName = `site-${Utils.random()}`; const siteName = `site-${Utils.random()}`;
const parentFromSite = `parent-in-site-${Utils.random()}`;
let parentFromSiteId: string;
const subFolder1FromSite = `subFolder1-in-site-${Utils.random()}`;
let subFolder1FromSiteId: string;
const subFolder2FromSite = `subFolder2-in-site-${Utils.random()}`;
let subFolder2FromSiteId: string;
const fileName1FromSite = `file1-in-site-${Utils.random()}.txt`;
const parent2 = `parent2-${Utils.random()}`; const parent2 = `parent2-${Utils.random()}`;
let parent2Id: string; let parent2Id: string;
@ -67,10 +74,10 @@ describe('Breadcrumb', () => {
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
const docLibId = await apis.user.sites.getDocLibId(siteName); const docLibId = await apis.user.sites.getDocLibId(siteName);
parentId = (await apis.user.nodes.createFolder(parent, docLibId)).entry.id; parentFromSiteId = (await apis.user.nodes.createFolder(parentFromSite, docLibId)).entry.id;
subFolder1Id = (await apis.user.nodes.createFolder(subFolder1, parentId)).entry.id; subFolder1FromSiteId = (await apis.user.nodes.createFolder(subFolder1FromSite, parentFromSiteId)).entry.id;
subFolder2Id = (await apis.user.nodes.createFolder(subFolder2, subFolder1Id)).entry.id; subFolder2FromSiteId = (await apis.user.nodes.createFolder(subFolder2FromSite, subFolder1FromSiteId)).entry.id;
await apis.user.nodes.createFile(fileName1, subFolder2Id); await apis.user.nodes.createFile(fileName1FromSite, subFolder2FromSiteId);
await loginPage.loginWith(username); await loginPage.loginWith(username);
done(); done();
@ -135,10 +142,10 @@ describe('Breadcrumb', () => {
it('[C260967] File Libraries breadcrumb for a folder hierarchy', async () => { it('[C260967] File Libraries breadcrumb for a folder hierarchy', async () => {
await page.clickFileLibrariesAndWait(); await page.clickFileLibrariesAndWait();
await page.dataTable.doubleClickOnRowByName(siteName); await page.dataTable.doubleClickOnRowByName(siteName);
await page.dataTable.doubleClickOnRowByName(parent); await page.dataTable.doubleClickOnRowByName(parentFromSite);
await page.dataTable.doubleClickOnRowByName(subFolder1); await page.dataTable.doubleClickOnRowByName(subFolder1FromSite);
await page.dataTable.doubleClickOnRowByName(subFolder2); await page.dataTable.doubleClickOnRowByName(subFolder2FromSite);
const expectedItems = ['Favorite Libraries', siteName, parent, subFolder1, subFolder2]; const expectedItems = ['Favorite Libraries', siteName, parentFromSite, subFolder1FromSite, subFolder2FromSite];
expect(await breadcrumb.getAllItems()).toEqual(expectedItems); expect(await breadcrumb.getAllItems()).toEqual(expectedItems);
}); });

View File

@ -59,18 +59,22 @@ describe('Single click on item name', () => {
await adminApiActions.createUser({ username }); await adminApiActions.createUser({ username });
await userActions.login(username, username); await userActions.login(username, username);
const initialRecentTotalItems = await apis.user.search.getTotalItems(username);
file1Id = (await apis.user.nodes.createFile(file1)).entry.id; file1Id = (await apis.user.nodes.createFile(file1)).entry.id;
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id; folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
await apis.user.sites.createSite(siteName);
const docLibId = await apis.user.sites.getDocLibId(siteName);
await apis.user.nodes.createFile(fileSite, docLibId);
await apis.user.search.waitForApi(username, { expect: initialRecentTotalItems + 2 });
deletedFile1Id = (await apis.user.nodes.createFile(deletedFile1)).entry.id; deletedFile1Id = (await apis.user.nodes.createFile(deletedFile1)).entry.id;
deletedFolder1Id = (await apis.user.nodes.createFolder(deletedFolder1)).entry.id; deletedFolder1Id = (await apis.user.nodes.createFolder(deletedFolder1)).entry.id;
await userActions.deleteNodes([deletedFile1Id, deletedFolder1Id], false); await userActions.deleteNodes([deletedFile1Id, deletedFolder1Id], false);
await apis.user.sites.createSite(siteName);
const docLibId = await apis.user.sites.getDocLibId(siteName);
await apis.user.nodes.createFile(fileSite, docLibId);
await loginPage.loginWith(username); await loginPage.loginWith(username);
done(); done();
}); });
@ -204,8 +208,6 @@ describe('Single click on item name', () => {
describe('on Search Results', () => { describe('on Search Results', () => {
beforeEach(async () => { beforeEach(async () => {
const initialRecentTotalItems = await apis.user.search.getTotalItems(username);
await apis.user.search.waitForApi(username, { expect: initialRecentTotalItems + 2 });
await searchInput.clickSearchButton(); await searchInput.clickSearchButton();
await searchInput.checkFilesAndFolders(); await searchInput.checkFilesAndFolders();
}); });

View File

@ -40,16 +40,16 @@ export function favoritesTests(username: string) {
await Utils.pressEscape(); await Utils.pressEscape();
}); });
it('Pagination control default values - [C280113]', async () => { it('[C280113] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('Items per page values - [C280114]', async () => { it('[C280114] Items per page values', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
@ -57,51 +57,48 @@ export function favoritesTests(username: string) {
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
}); });
it('current page menu items - [C280115]', async () => { it('[C280115] current page menu items', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
it('change the current page from menu - [C280116]', async () => { it('[C280116] change the current page from menu', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-1')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('navigate to next and previous pages - [C280119]', async () => { it('[C280119] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-21')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -109,22 +106,22 @@ export function favoritesTests(username: string) {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-50')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('Previous button is disabled on first page - [C280117]', async () => { it('[C280117] Previous button is disabled on first page', async () => {
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page - [C280118]', async () => { it('[C280118] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -37,7 +37,7 @@ describe('Pagination on multiple pages : ', () => {
const parent = `parent-${random}`; const parent = `parent-${random}`;
let parentId: string; let parentId: string;
const files = Array(101) const files = Array(51)
.fill('my-file') .fill('my-file')
.map((name, index): string => `${name}-${index + 1}-${random}.txt`); .map((name, index): string => `${name}-${index + 1}-${random}.txt`);
let filesIds: string[]; let filesIds: string[];
@ -61,7 +61,7 @@ describe('Pagination on multiple pages : ', () => {
initialFavoritesTotalItems = await userApi.favorites.getFavoritesTotalItems(); initialFavoritesTotalItems = await userApi.favorites.getFavoritesTotalItems();
await userApi.shared.shareFilesByIds(filesIds); await userApi.shared.shareFilesByIds(filesIds);
await userApi.favorites.addFavoritesByIds('file', filesIds); await userApi.favorites.addFavoritesByIds('file', filesIds);
}, 150000); }, 300000);
afterAll(async () => { afterAll(async () => {
await userApi.nodes.deleteNodeById(parentId); await userApi.nodes.deleteNodeById(parentId);
@ -73,29 +73,29 @@ describe('Pagination on multiple pages : ', () => {
describe('on Recent Files', () => { describe('on Recent Files', () => {
beforeAll(async () => { beforeAll(async () => {
await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 101 }); await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 51 });
}, 120000); }, 300000);
recentFilesTests(username); recentFilesTests(username);
}); });
describe('on Search Results', () => { describe('on Search Results', () => {
beforeAll(async () => { beforeAll(async () => {
await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 101 }); await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 51 });
}, 120000); }, 300000);
searchResultsTests(username); searchResultsTests(username);
}); });
describe('on Shared Files', () => { describe('on Shared Files', () => {
beforeAll(async () => { beforeAll(async () => {
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 101 }); await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 51 });
}, 120000); }, 300000);
sharedFilesTests(username); sharedFilesTests(username);
}); });
describe('on Favorites', () => { describe('on Favorites', () => {
beforeAll(async () => { beforeAll(async () => {
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 101 }); await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 51 });
}, 120000); }, 300000);
favoritesTests(username); favoritesTests(username);
}); });
}); });

View File

@ -24,6 +24,7 @@
*/ */
import { LoginPage, BrowsingPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared'; import { LoginPage, BrowsingPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
import { Logger } from '@alfresco/adf-testing';
describe('Pagination on multiple pages', () => { describe('Pagination on multiple pages', () => {
const random = Utils.random(); const random = Utils.random();
@ -37,25 +38,33 @@ describe('Pagination on multiple pages', () => {
const page = new BrowsingPage(); const page = new BrowsingPage();
const { dataTable, pagination } = page; const { dataTable, pagination } = page;
const sites = Array(101) const sites = Array(51)
.fill('site') .fill('site')
.map((name, index): string => `${name}-${index + 1}-${random}`); .map((name, index): string => `${name}-${index + 1}-${random}`);
let initialSitesTotalItems: number; let initialSitesTotalItems: number;
beforeAll(async () => { beforeAll(async () => {
await adminApiActions.createUser({ username }); try {
await adminApiActions.createUser({ username });
initialSitesTotalItems = await userApi.sites.getSitesTotalItems(); initialSitesTotalItems = await userApi.sites.getSitesTotalItems();
await userApi.sites.createSitesPrivate(sites); await userApi.sites.createSitesPrivate(sites);
await userApi.sites.waitForApi({ expect: initialSitesTotalItems + 101 }); await userApi.sites.waitForApi({ expect: initialSitesTotalItems + 51 });
await loginPage.loginWith(username); await loginPage.loginWith(username);
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
}, 450000); }, 450000);
afterAll(async () => { afterAll(async () => {
await userApi.sites.deleteSites(sites); try {
await userApi.sites.waitForApi({ expect: initialSitesTotalItems }); await userApi.sites.deleteSites(sites);
await userApi.sites.waitForApi({ expect: initialSitesTotalItems });
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
}, 420000); }, 420000);
describe('on My Libraries', () => { describe('on My Libraries', () => {
@ -68,10 +77,10 @@ describe('Pagination on multiple pages', () => {
}); });
it('[C280086] Pagination control default values', async () => { it('[C280086] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
@ -88,39 +97,36 @@ describe('Pagination on multiple pages', () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
it('[C280089] change the current page from menu', async () => { it('[C280089] change the current page from menu', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(2);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 2');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next 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'); expect(await dataTable.isItemPresent('site-34')).toBe(true, 'Site-34 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -128,8 +134,8 @@ describe('Pagination on multiple pages', () => {
it('[C280092] navigate to next and previous pages', async () => { it('[C280092] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('site-31')).toBe(true, 'Site-31 not found on page'); expect(await dataTable.isItemPresent('site-34')).toBe(true, 'Site-34 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -137,7 +143,7 @@ describe('Pagination on multiple pages', () => {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('site-12')).toBe(true, 'Site-12 not found on page'); expect(await dataTable.isItemPresent('site-12')).toBe(true, 'Site-12 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
@ -150,9 +156,9 @@ describe('Pagination on multiple pages', () => {
it('[C280091] Next button is disabled on last page', async () => { it('[C280091] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });
@ -167,10 +173,10 @@ describe('Pagination on multiple pages', () => {
}); });
it('[C291875] Pagination control default values', async () => { it('[C291875] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
@ -187,27 +193,24 @@ describe('Pagination on multiple pages', () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
@ -215,11 +218,11 @@ describe('Pagination on multiple pages', () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('site-40')).toBe(true, 'Site-60 not found on page'); expect(await dataTable.isItemPresent('site-1')).toBe(true, 'Site-1 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -227,8 +230,8 @@ describe('Pagination on multiple pages', () => {
it('[C291881] navigate to next and previous pages', async () => { it('[C291881] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('site-70')).toBe(true, 'Site-31 not found on page'); expect(await dataTable.isItemPresent('site-21')).toBe(true, 'Site-21 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -236,8 +239,8 @@ describe('Pagination on multiple pages', () => {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('site-88')).toBe(true, 'Site-12 not found on page'); expect(await dataTable.isItemPresent('site-32')).toBe(true, 'Site-32 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -249,9 +252,9 @@ describe('Pagination on multiple pages', () => {
it('[C291880] Next button is disabled on last page', async () => { it('[C291880] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -29,7 +29,7 @@ describe('Pagination on multiple pages on Trash', () => {
const random = Utils.random(); const random = Utils.random();
const username = `user-${random}`; const username = `user-${random}`;
const filesForDelete = Array(101) const filesForDelete = Array(51)
.fill('file') .fill('file')
.map((name, index): string => `${name}-${index + 1}-${random}.txt`); .map((name, index): string => `${name}-${index + 1}-${random}.txt`);
let filesDeletedIds: string[]; let filesDeletedIds: string[];
@ -50,11 +50,11 @@ describe('Pagination on multiple pages on Trash', () => {
filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map((entries: any) => entries.entry.id); filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map((entries: any) => entries.entry.id);
await userActions.deleteNodes(filesDeletedIds, false); await userActions.deleteNodes(filesDeletedIds, false);
await userActions.waitForTrashcanSize(101); await userActions.waitForTrashcanSize(51);
await loginPage.loginWith(username); await loginPage.loginWith(username);
await page.clickTrashAndWait(); await page.clickTrashAndWait();
}, 120000); }, 300000);
afterEach(async () => { afterEach(async () => {
await Utils.pressEscape(); await Utils.pressEscape();
@ -65,10 +65,10 @@ describe('Pagination on multiple pages on Trash', () => {
}); });
it('[C280122] Pagination control default values', async () => { it('[C280122] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
@ -85,27 +85,24 @@ describe('Pagination on multiple pages on Trash', () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
@ -113,11 +110,11 @@ describe('Pagination on multiple pages on Trash', () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('file-1')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -125,8 +122,8 @@ describe('Pagination on multiple pages on Trash', () => {
it('[C280128] navigate to next and previous pages', async () => { it('[C280128] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('file-26')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -134,8 +131,8 @@ describe('Pagination on multiple pages on Trash', () => {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('file-50')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -147,9 +144,9 @@ describe('Pagination on multiple pages on Trash', () => {
it('[C280127] Next button is disabled on last page', async () => { it('[C280127] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -43,10 +43,10 @@ export function personalFilesTests(username: string, parentName: string) {
}); });
it('[C280077] Pagination control default values', async () => { it('[C280077] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
@ -63,27 +63,24 @@ export function personalFilesTests(username: string, parentName: string) {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
@ -91,11 +88,11 @@ export function personalFilesTests(username: string, parentName: string) {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('my-file-60')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-9')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -103,8 +100,8 @@ export function personalFilesTests(username: string, parentName: string) {
it('[C280083] navigate to next and previous pages', async () => { it('[C280083] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('my-file-31')).toBe(true, 'file-31 not found on page'); expect(await dataTable.isItemPresent('my-file-34')).toBe(true, 'my-file-34 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -112,8 +109,8 @@ export function personalFilesTests(username: string, parentName: string) {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('my-file-12')).toBe(true, 'my-file-12 not found on page'); expect(await dataTable.isItemPresent('my-file-15')).toBe(true, 'my-file-15 not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -125,9 +122,9 @@ export function personalFilesTests(username: string, parentName: string) {
it('[C280082] Next button is disabled on last page', async () => { it('[C280082] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -40,16 +40,16 @@ export function recentFilesTests(username: string) {
await Utils.pressEscape(); await Utils.pressEscape();
}); });
it('Pagination control default values - [C280104]', async () => { it('[C280104] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('Items per page values - [C280105]', async () => { it('[C280105] Items per page values', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
@ -57,52 +57,49 @@ export function recentFilesTests(username: string) {
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
}); });
it('current page menu items - [C280106]', async () => { it('[C280106] current page menu items', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
it('change the current page from menu - [C280107]', async () => { it('[C280107] change the current page from menu', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-1')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('navigate to next and previous pages - [C280110]', async () => { it('[C280110] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-21')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -110,22 +107,22 @@ export function recentFilesTests(username: string) {
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-50')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('Previous button is disabled on first page - [C280108]', async () => { it('[C280108] Previous button is disabled on first page', async () => {
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page - [C280109]', async () => { it('[C280109] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -43,16 +43,16 @@ export function searchResultsTests(username: string) {
await Utils.pressEscape(); await Utils.pressEscape();
}); });
it('Pagination control default values - [C290125]', async () => { it('[C290125] Pagination control default values', async () => {
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('Items per page values - [C290126]', async () => { it('[C290126] Items per page values', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
@ -60,50 +60,47 @@ export function searchResultsTests(username: string) {
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
}); });
it('current page menu items - [C290127]', async () => { it('[C290127] current page menu items', async () => {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
it('change the current page from menu - [C290128]', async () => { it('[C290128] change the current page from menu', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForBody(); await dataTable.waitForBody();
expect(await pagination.getRange()).toContain('51-75 of 101'); expect(await pagination.getRange()).toContain('51-51 of 51');
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('navigate to next and previous pages - [C290131]', async () => { it('[C290131] navigate to next and previous pages', async () => {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForBody(); await dataTable.waitForBody();
expect(await pagination.getRange()).toContain('26-50 of 101'); expect(await pagination.getRange()).toContain('26-50 of 51');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -111,21 +108,21 @@ export function searchResultsTests(username: string) {
await dataTable.waitForBody(); await dataTable.waitForBody();
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForBody(); await dataTable.waitForBody();
expect(await pagination.getRange()).toContain('1-25 of 101'); expect(await pagination.getRange()).toContain('1-25 of 51');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
it('Previous button is disabled on first page - [C290129]', async () => { it('[C290129] Previous button is disabled on first page - ', async () => {
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page - [C290130]', async () => { it('[C290130] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page'); expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -23,17 +23,21 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { BrowsingPage, LoginPage, Utils } from '@alfresco/aca-testing-shared'; import { BrowsingPage, LoginPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
export function sharedFilesTests(username: string) { export function sharedFilesTests(username: string) {
const page = new BrowsingPage(); const page = new BrowsingPage();
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const { dataTable, pagination } = page; const { dataTable, pagination } = page;
const userApi = new RepoClient(username, username);
let sharedTotalItems: number;
describe('Pagination controls : ', () => { describe('Pagination controls : ', () => {
beforeAll(async () => { beforeAll(async () => {
await loginPage.loginWith(username); await loginPage.loginWith(username);
await page.clickSharedFilesAndWait(); await page.clickSharedFilesAndWait();
sharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
}); });
afterEach(async () => { afterEach(async () => {
@ -44,7 +48,7 @@ export function sharedFilesTests(username: string) {
expect(await pagination.getRange()).toContain('1-25'); expect(await pagination.getRange()).toContain('1-25');
expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getMaxItems()).toContain('25');
expect(await pagination.getCurrentPage()).toContain('Page 1'); expect(await pagination.getCurrentPage()).toContain('Page 1');
expect(await pagination.getTotalPages()).toContain('of 5'); expect(await pagination.getTotalPages()).toContain('of 3');
expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled'); expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
}); });
@ -61,27 +65,24 @@ export function sharedFilesTests(username: string) {
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('25'); await pagination.menu.clickMenuItem('25');
expect(await pagination.getMaxItems()).toContain('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'); expect(await pagination.getTotalPages()).toContain('of 3');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(3); expect(await pagination.menu.getItemsCount()).toBe(3);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu(); await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100'); await pagination.menu.clickMenuItem('50');
expect(await pagination.getMaxItems()).toContain('100'); expect(await pagination.getMaxItems()).toContain('50');
expect(await pagination.getTotalPages()).toContain('of 2'); expect(await pagination.getTotalPages()).toContain('of 2');
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
expect(await pagination.menu.getItemsCount()).toBe(2); expect(await pagination.menu.getItemsCount()).toBe(2);
await pagination.menu.closeMenu(); await pagination.menu.closeMenu();
await pagination.openMaxItemsMenu();
await pagination.menu.clickMenuItem('100');
expect(await pagination.getMaxItems()).toContain('100');
expect(await pagination.getTotalPages()).toContain('of 1');
await pagination.resetToDefaultPageSize(); await pagination.resetToDefaultPageSize();
}); });
@ -89,11 +90,11 @@ export function sharedFilesTests(username: string) {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(3); await pagination.menu.clickNthItem(3);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('51-75'); expect(await pagination.getRange()).toContain(`51-${sharedTotalItems}`);
expect(await pagination.getCurrentPage()).toContain('Page 3'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled'); expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled');
expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-1')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -102,7 +103,7 @@ export function sharedFilesTests(username: string) {
await pagination.clickNext(); await pagination.clickNext();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('26-50'); expect(await pagination.getRange()).toContain('26-50');
expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-21')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
@ -111,7 +112,7 @@ export function sharedFilesTests(username: string) {
await pagination.clickPrevious(); await pagination.clickPrevious();
await dataTable.waitForHeader(); await dataTable.waitForHeader();
expect(await pagination.getRange()).toContain('1-25'); expect(await pagination.getRange()).toContain('1-25');
expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page'); expect(await dataTable.isItemPresent('my-file-50')).toBe(true, 'File not found on page');
await pagination.resetToDefaultPageNumber(); await pagination.resetToDefaultPageNumber();
}); });
@ -123,8 +124,8 @@ export function sharedFilesTests(username: string) {
it('[C280100] Next button is disabled on last page', async () => { it('[C280100] Next button is disabled on last page', async () => {
await pagination.openCurrentPageMenu(); await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5); await pagination.menu.clickNthItem(3);
expect(await pagination.getCurrentPage()).toContain('Page 5'); expect(await pagination.getCurrentPage()).toContain('Page 3');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page'); expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
}); });
}); });

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils, FILES, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils, FILES, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
const moment = require('moment'); const moment = require('moment');
@ -181,6 +182,7 @@ describe('Search filters', () => {
const future = moment().add(1, 'month').format('DD-MMM-YY'); const future = moment().add(1, 'month').format('DD-MMM-YY');
afterEach(async (done) => { afterEach(async (done) => {
await createdDateFilter.expandPanel();
await createdDateFilter.resetPanel(); await createdDateFilter.resetPanel();
done(); done();
}); });
@ -283,7 +285,7 @@ describe('Search filters', () => {
describe('Filter by File type', () => { describe('Filter by File type', () => {
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
done(); done();
}); });
@ -337,7 +339,7 @@ describe('Search filters', () => {
describe('Filter by Creator', () => { describe('Filter by Creator', () => {
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
done(); done();
}); });
@ -392,7 +394,7 @@ describe('Search filters', () => {
describe('Filter by Modifier', () => { describe('Filter by Modifier', () => {
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
done(); done();
}); });
@ -447,7 +449,7 @@ describe('Search filters', () => {
describe('Filter by Location', () => { describe('Filter by Location', () => {
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
done(); done();
}); });
@ -504,7 +506,7 @@ describe('Search filters', () => {
const expectedDateFilters = ['Today (2)', 'This week (2)', 'This month (2)', 'In the last 6 months (2)', 'This year (2)']; const expectedDateFilters = ['Today (2)', 'This week (2)', 'This month (2)', 'In the last 6 months (2)', 'This year (2)'];
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
done(); done();
}); });
@ -561,9 +563,8 @@ describe('Search filters', () => {
describe('Multiple filters', () => { describe('Multiple filters', () => {
afterEach(async (done) => { afterEach(async (done) => {
await filters.resetAllButton.click(); await BrowserActions.click(filters.resetAllButton);
await sizeFilter.resetPanel(); await sizeFilter.resetPanel();
await createdDateFilter.resetPanel();
done(); done();
}); });

View File

@ -37,6 +37,7 @@ import {
ManageVersionsDialog, ManageVersionsDialog,
UploadNewVersionDialog UploadNewVersionDialog
} from '@alfresco/aca-testing-shared'; } from '@alfresco/aca-testing-shared';
import { BrowserVisibility } from '@alfresco/adf-testing';
describe('Viewer actions', () => { describe('Viewer actions', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -244,8 +245,16 @@ describe('Viewer actions', () => {
await viewer.waitForViewerToOpen(); await viewer.waitForViewerToOpen();
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
expect(await toolbar.menu.cancelEditingAction.isPresent()).toBe(true, `'Cancel Editing' button should be shown`); await BrowserVisibility.waitUntilElementIsVisible(
expect(await toolbar.menu.editOfflineAction.isPresent()).toBe(false, `'Edit Offline' shouldn't be shown`); toolbar.menu.cancelEditingAction,
BrowserVisibility.DEFAULT_TIMEOUT,
`'Cancel Editing' button should be shown`
);
await BrowserVisibility.waitUntilElementIsVisible(
toolbar.menu.editOfflineAction,
BrowserVisibility.DEFAULT_TIMEOUT,
`'Edit Offline' shouldn't be shown`
);
await toolbar.menu.clickMenuItem('Upload New Version'); await toolbar.menu.clickMenuItem('Upload New Version');
await Utils.uploadFileNewVersion(docxFile); await Utils.uploadFileNewVersion(docxFile);
@ -254,8 +263,16 @@ describe('Viewer actions', () => {
await uploadNewVersionDialog.uploadButton.click(); await uploadNewVersionDialog.uploadButton.click();
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
expect(await toolbar.menu.cancelEditingAction.isPresent()).toBe(false, `'Cancel Editing' button shouldn't be shown`); await BrowserVisibility.waitUntilElementIsVisible(
expect(await toolbar.menu.editOfflineAction.isPresent()).toBe(true, `'Edit Offline' should be shown`); toolbar.menu.cancelEditingAction,
BrowserVisibility.DEFAULT_TIMEOUT,
`'Cancel Editing' button shouldn't be shown`
);
await BrowserVisibility.waitUntilElementIsVisible(
toolbar.menu.editOfflineAction,
BrowserVisibility.DEFAULT_TIMEOUT,
`'Edit Offline' should be shown`
);
}); });
it('[C279282] Full screen action', async () => { it('[C279282] Full screen action', async () => {

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, UserActions, LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared'; import { AdminActions, UserActions, LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Viewer general', () => { describe('Viewer general', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -111,7 +112,8 @@ describe('Viewer general', () => {
it('[C279270] Viewer opens when clicking the View action for a file', async () => { it('[C279270] Viewer opens when clicking the View action for a file', async () => {
await dataTable.selectItem(xlsxFile); await dataTable.selectItem(xlsxFile);
await page.toolbar.viewButton.click(); await BrowserActions.click(page.toolbar.viewButton);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
}); });
@ -126,7 +128,7 @@ describe('Viewer general', () => {
it('[C279271] Close the viewer', async () => { it('[C279271] Close the viewer', async () => {
await dataTable.doubleClickOnRowByName(xlsxFile); await dataTable.doubleClickOnRowByName(xlsxFile);
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
await viewer.closeButton.click(); await BrowserActions.click(viewer.closeButton);
expect(await viewer.isViewerOpened()).toBe(false, 'Viewer did not close'); expect(await viewer.isViewerOpened()).toBe(false, 'Viewer did not close');
}); });

View File

@ -24,6 +24,7 @@
*/ */
import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils, Viewer, PasswordDialog } from '@alfresco/aca-testing-shared'; import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils, Viewer, PasswordDialog } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
describe('Viewer - password protected file', () => { describe('Viewer - password protected file', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
@ -83,7 +84,7 @@ describe('Viewer - password protected file', () => {
await passwordDialog.enterPassword(protectedFile.password); await passwordDialog.enterPassword(protectedFile.password);
expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled'); expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled');
await passwordDialog.submitButton.click(); await BrowserActions.click(passwordDialog.submitButton);
await passwordDialog.waitForDialogToClose(); await passwordDialog.waitForDialogToClose();
expect(await viewer.isPdfViewerContentDisplayed()).toBe(true, 'file content not displayed'); expect(await viewer.isPdfViewerContentDisplayed()).toBe(true, 'file content not displayed');
@ -92,7 +93,7 @@ describe('Viewer - password protected file', () => {
it('[C268960] Error appears when entering an incorrect password', async () => { it('[C268960] Error appears when entering an incorrect password', async () => {
await passwordDialog.enterPassword('incorrect'); await passwordDialog.enterPassword('incorrect');
expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled'); expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled');
await passwordDialog.submitButton.click(); await BrowserActions.click(passwordDialog.submitButton);
expect(await passwordDialog.getErrorMessage()).toBe('Password is wrong'); expect(await passwordDialog.getErrorMessage()).toBe('Password is wrong');
expect(await viewer.isPdfViewerContentDisplayed()).toBe(false, 'file content is displayed'); expect(await viewer.isPdfViewerContentDisplayed()).toBe(false, 'file content is displayed');

View File

@ -26,6 +26,7 @@
import { browser, by } from 'protractor'; import { browser, by } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { waitForPresence, waitForStaleness } from '../../utilities/utils'; import { waitForPresence, waitForStaleness } from '../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class DropDownBreadcrumb extends Component { export class DropDownBreadcrumb extends Component {
pathOptionCss = '.adf-dropdown-breadcrumb-path-option .mat-option-text'; pathOptionCss = '.adf-dropdown-breadcrumb-path-option .mat-option-text';
@ -47,13 +48,13 @@ export class DropDownBreadcrumb extends Component {
} }
async openPath(): Promise<void> { async openPath(): Promise<void> {
await this.trigger.click(); await BrowserActions.click(this.trigger);
await this.waitForPathListDropdownToOpen(); await this.waitForPathListDropdownToOpen();
} }
async clickPathItem(name: string): Promise<void> { async clickPathItem(name: string): Promise<void> {
const elem = browser.element(by.cssContainingText(this.pathOptionCss, name)); const elem = browser.element(by.cssContainingText(this.pathOptionCss, name));
await elem.click(); await BrowserActions.click(elem);
} }
async getPathItems(): Promise<string[]> { async getPathItems(): Promise<string[]> {

View File

@ -24,11 +24,11 @@
*/ */
import { browser, by, ElementArrayFinder, ElementFinder, protractor } from 'protractor'; import { browser, by, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { Component } from '../component'; import { Component } from '../component';
import { Menu } from '../menu/menu'; import { Menu } from '../menu/menu';
import { Utils, waitForClickable, waitForPresence } from '../../utilities/utils'; import { Utils, waitForPresence } from '../../utilities/utils';
export class DataTable extends Component { export class DataTable extends Component {
private static selectors = { private static selectors = {
@ -223,7 +223,7 @@ export class DataTable extends Component {
async doubleClickOnRowByName(name: string, location: string = ''): Promise<void> { async doubleClickOnRowByName(name: string, location: string = ''): Promise<void> {
try { try {
const item = this.getRowFirstCell(name, location); const item = this.getRowFirstCell(name, location);
await waitForClickable(item); await BrowserVisibility.waitUntilElementIsClickable(item);
await browser.actions().mouseMove(item).perform(); await browser.actions().mouseMove(item).perform();
await browser.actions().doubleClick().perform(); await browser.actions().doubleClick().perform();
} catch (error) { } catch (error) {

View File

@ -27,6 +27,7 @@ import { by, browser } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { isPresentAndDisplayed, waitForStaleness } from '../../utilities/utils'; import { isPresentAndDisplayed, waitForStaleness } from '../../utilities/utils';
const moment = require('moment'); const moment = require('moment');
import { BrowserActions } from '@alfresco/adf-testing';
export class DateTimePicker extends Component { export class DateTimePicker extends Component {
calendar = this.byCss('.mat-datetimepicker-popup', browser); calendar = this.byCss('.mat-datetimepicker-popup', browser);
@ -57,7 +58,7 @@ export class DateTimePicker extends Component {
const year = await this.headerYear.getText(); const year = await this.headerYear.getText();
const firstActiveDay = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content'; const firstActiveDay = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
const elem = this.dayPicker.element(by.cssContainingText(firstActiveDay, `${dayOfTomorrow}`)); const elem = this.dayPicker.element(by.cssContainingText(firstActiveDay, `${dayOfTomorrow}`));
await elem.click(); await BrowserActions.click(elem);
return `${date} ${year}`; return `${date} ${year}`;
} }
} }

View File

@ -25,9 +25,10 @@
import { by, browser, protractor } from 'protractor'; import { by, browser, protractor } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { Utils, isPresentAndDisplayed, waitForStaleness, waitForPresence, isPresentAndEnabled, waitForClickable } from '../../utilities/utils'; import { isPresentAndDisplayed, waitForStaleness, waitForPresence, isPresentAndEnabled } from '../../utilities/utils';
import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb'; import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
import { DataTable } from '../data-table/data-table'; import { DataTable } from '../data-table/data-table';
import { BrowserActions } from '@alfresco/adf-testing';
export class ContentNodeSelectorDialog extends GenericDialog { export class ContentNodeSelectorDialog extends GenericDialog {
cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]')); cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
@ -53,13 +54,12 @@ export class ContentNodeSelectorDialog extends GenericDialog {
} }
async selectLocation(location: string): Promise<void> { async selectLocation(location: string): Promise<void> {
await this.locationDropDown.click(); await BrowserActions.click(this.locationDropDown);
await waitForPresence(this.locationPersonalFiles);
if (location === 'Personal Files') { if (location === 'Personal Files') {
await this.locationPersonalFiles.click(); await BrowserActions.click(this.locationPersonalFiles);
} else { } else {
await this.locationFileLibraries.click(); await BrowserActions.click(this.locationFileLibraries);
} }
await this.waitForDropDownToClose(); await this.waitForDropDownToClose();
@ -67,8 +67,7 @@ export class ContentNodeSelectorDialog extends GenericDialog {
async selectDestination(folderName: string): Promise<void> { async selectDestination(folderName: string): Promise<void> {
const row = this.dataTable.getRowByName(folderName); const row = this.dataTable.getRowByName(folderName);
await waitForClickable(row); await BrowserActions.click(row);
await row.click();
await waitForPresence(browser.element(by.css('.adf-is-selected'))); await waitForPresence(browser.element(by.css('.adf-is-selected')));
} }
@ -85,7 +84,7 @@ export class ContentNodeSelectorDialog extends GenericDialog {
} }
async searchFor(text: string): Promise<void> { async searchFor(text: string): Promise<void> {
await Utils.clearFieldWithBackspace(this.searchInput); await BrowserActions.clearWithBackSpace(this.searchInput);
await this.searchInput.sendKeys(text); await this.searchInput.sendKeys(text);
await this.searchInput.sendKeys(protractor.Key.ENTER); await this.searchInput.sendKeys(protractor.Key.ENTER);
} }

View File

@ -25,15 +25,16 @@
import { by } from 'protractor'; import { by } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { isPresentAndDisplayed, waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils'; import { isPresentAndDisplayed, isPresentAndEnabled, typeText } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class CreateOrEditFolderDialog extends GenericDialog { export class CreateOrEditFolderDialog extends GenericDialog {
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create')); createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
cancelButton = this.childElement(by.id('adf-folder-cancel-button')); cancelButton = this.childElement(by.id('adf-folder-cancel-button'));
updateButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Update')); updateButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Update'));
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]')); nameInput = this.rootElem.element(by.css('input[data-placeholder="Name" i]'));
descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]')); descriptionTextArea = this.rootElem.element(by.css('textarea[data-placeholder="Description" i]'));
validationMessage = this.rootElem.element(by.css('.mat-hint span')); validationMessage = this.rootElem.element(by.css('.mat-hint span'));
constructor() { constructor() {
@ -42,7 +43,7 @@ export class CreateOrEditFolderDialog extends GenericDialog {
async waitForDialogToOpen() { async waitForDialogToOpen() {
await super.waitForDialogToOpen(); await super.waitForDialogToOpen();
await waitForClickable(this.nameInput); await BrowserVisibility.waitUntilElementIsClickable(this.nameInput);
} }
async isUpdateButtonEnabled(): Promise<boolean> { async isUpdateButtonEnabled(): Promise<boolean> {
@ -66,11 +67,11 @@ export class CreateOrEditFolderDialog extends GenericDialog {
} }
async getName(): Promise<string> { async getName(): Promise<string> {
return this.nameInput.getAttribute('value'); return BrowserActions.getInputValue(this.nameInput);
} }
async getDescription(): Promise<string> { async getDescription(): Promise<string> {
return this.descriptionTextArea.getAttribute('value'); return BrowserActions.getInputValue(this.descriptionTextArea);
} }
async enterName(name: string): Promise<void> { async enterName(name: string): Promise<void> {
@ -82,7 +83,7 @@ export class CreateOrEditFolderDialog extends GenericDialog {
} }
async clickCancel(): Promise<void> { async clickCancel(): Promise<void> {
await this.cancelButton.click(); await BrowserActions.click(this.cancelButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
} }

View File

@ -26,14 +26,15 @@
import { by } from 'protractor'; import { by } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { isPresentAndDisplayed, isPresentAndEnabled, typeText } from '../../utilities/utils'; import { isPresentAndDisplayed, isPresentAndEnabled, typeText } from '../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class CreateFromTemplateDialog extends GenericDialog { export class CreateFromTemplateDialog extends GenericDialog {
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create')); createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'CANCEL')); cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'CANCEL'));
nameInput = this.childElement(by.css('input[placeholder="Name" i]')); nameInput = this.childElement(by.css('input[data-placeholder="Name" i]'));
titleInput = this.childElement(by.css('input[placeholder="Title" i]')); titleInput = this.childElement(by.css('input[data-placeholder="Title" i]'));
descriptionTextArea = this.childElement(by.css('textarea[placeholder="Description" i]')); descriptionTextArea = this.childElement(by.css('textarea[data-placeholder="Description" i]'));
validationMessage = this.childElement(by.css('.mat-error')); validationMessage = this.childElement(by.css('.mat-error'));
constructor() { constructor() {
@ -61,11 +62,11 @@ export class CreateFromTemplateDialog extends GenericDialog {
} }
async getName(): Promise<string> { async getName(): Promise<string> {
return this.nameInput.getAttribute('value'); return BrowserActions.getInputValue(this.nameInput);
} }
async getDescription(): Promise<string> { async getDescription(): Promise<string> {
return this.descriptionTextArea.getAttribute('value'); return BrowserActions.getInputValue(this.descriptionTextArea);
} }
async enterName(name: string): Promise<void> { async enterName(name: string): Promise<void> {
@ -81,7 +82,7 @@ export class CreateFromTemplateDialog extends GenericDialog {
} }
async clickCancel(): Promise<void> { async clickCancel(): Promise<void> {
await this.cancelButton.click(); await BrowserActions.click(this.cancelButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
} }

View File

@ -25,15 +25,16 @@
import { by, ElementFinder } from 'protractor'; import { by, ElementFinder } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils'; import { isPresentAndEnabled, typeText } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class CreateLibraryDialog extends GenericDialog { export class CreateLibraryDialog extends GenericDialog {
createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create')); createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Cancel')); cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Cancel'));
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]')); nameInput = this.rootElem.element(by.css('input[data-placeholder="Name" i]'));
libraryIdInput = this.rootElem.element(by.css('input[placeholder="Library ID" i]')); libraryIdInput = this.rootElem.element(by.css('input[data-placeholder="Library ID" i]'));
descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]')); descriptionTextArea = this.rootElem.element(by.css('textarea[data-placeholder="Description" i]'));
visibilityPublic = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Public')); visibilityPublic = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Public'));
visibilityModerated = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Moderated')); visibilityModerated = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Moderated'));
visibilityPrivate = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Private')); visibilityPrivate = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Private'));
@ -46,7 +47,7 @@ export class CreateLibraryDialog extends GenericDialog {
async waitForDialogToOpen(): Promise<void> { async waitForDialogToOpen(): Promise<void> {
await super.waitForDialogToOpen(); await super.waitForDialogToOpen();
await waitForClickable(this.nameInput); await BrowserVisibility.waitUntilElementIsClickable(this.nameInput);
} }
async getErrorMessage(): Promise<string> { async getErrorMessage(): Promise<string> {
@ -77,7 +78,7 @@ export class CreateLibraryDialog extends GenericDialog {
} }
async clickCancel(): Promise<void> { async clickCancel(): Promise<void> {
await this.cancelButton.click(); await BrowserActions.click(this.cancelButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }

View File

@ -24,7 +24,8 @@
*/ */
import { ElementFinder, by, browser, Locator } from 'protractor'; import { ElementFinder, by, browser, Locator } from 'protractor';
import { isPresentAndDisplayed, waitForPresence, waitForVisibility, waitForStaleness } from '../../utilities/utils'; import { isPresentAndDisplayed, waitForPresence, waitForStaleness } from '../../utilities/utils';
import { BrowserVisibility } from '@alfresco/adf-testing';
export abstract class GenericDialog { export abstract class GenericDialog {
protected constructor(private rootCssSelector?: string) {} protected constructor(private rootCssSelector?: string) {}
@ -47,7 +48,7 @@ export abstract class GenericDialog {
async waitForDialogToOpen(): Promise<void> { async waitForDialogToOpen(): Promise<void> {
await waitForPresence(this.rootElem); await waitForPresence(this.rootElem);
await waitForVisibility(this.content); await BrowserVisibility.waitUntilElementIsVisible(this.content);
await waitForPresence(browser.element(by.css('.cdk-overlay-backdrop'))); await waitForPresence(browser.element(by.css('.cdk-overlay-backdrop')));
} }

View File

@ -25,6 +25,7 @@
import { by } from 'protractor'; import { by } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { BrowserActions } from '@alfresco/adf-testing';
export class ManageVersionsDialog extends GenericDialog { export class ManageVersionsDialog extends GenericDialog {
closeButton = this.childElement(by.cssContainingText('.mat-button', 'Close')); closeButton = this.childElement(by.cssContainingText('.mat-button', 'Close'));
@ -34,7 +35,7 @@ export class ManageVersionsDialog extends GenericDialog {
} }
async clickClose(): Promise<void> { async clickClose(): Promise<void> {
await this.closeButton.click(); await BrowserActions.click(this.closeButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
} }

View File

@ -25,7 +25,8 @@
import { by, browser } from 'protractor'; import { by, browser } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils'; import { isPresentAndEnabled, typeText } from '../../utilities/utils';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class PasswordDialog extends GenericDialog { export class PasswordDialog extends GenericDialog {
closeButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-close"]')); closeButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-close"]'));
@ -38,8 +39,7 @@ export class PasswordDialog extends GenericDialog {
} }
async waitForDialogToOpen(): Promise<void> { async waitForDialogToOpen(): Promise<void> {
await super.waitForDialogToOpen(); await BrowserVisibility.waitUntilElementIsClickable(this.passwordInput);
await waitForClickable(this.passwordInput);
} }
async isDialogOpen(): Promise<boolean> { async isDialogOpen(): Promise<boolean> {

View File

@ -28,6 +28,7 @@ import { GenericDialog } from '../dialog/generic-dialog';
import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb'; import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
import { DataTable } from '../data-table/data-table'; import { DataTable } from '../data-table/data-table';
import { isPresentAndEnabled } from '../../utilities/utils'; import { isPresentAndEnabled } from '../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class SelectTemplateDialog extends GenericDialog { export class SelectTemplateDialog extends GenericDialog {
nextButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-choose"]')); nextButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-choose"]'));
@ -49,12 +50,12 @@ export class SelectTemplateDialog extends GenericDialog {
} }
async clickCancel(): Promise<void> { async clickCancel(): Promise<void> {
await this.cancelButton.click(); await BrowserActions.click(this.cancelButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
async clickNext(): Promise<void> { async clickNext(): Promise<void> {
await this.nextButton.click(); await BrowserActions.click(this.nextButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
} }

View File

@ -27,6 +27,7 @@ import { by } from 'protractor';
import { DateTimePicker } from '../../components/datetime-picker/datetime-picker'; import { DateTimePicker } from '../../components/datetime-picker/datetime-picker';
import { GenericDialog } from '../dialog/generic-dialog'; import { GenericDialog } from '../dialog/generic-dialog';
import { isPresentAndEnabled } from '../../utilities/utils'; import { isPresentAndEnabled } from '../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class ShareDialog extends GenericDialog { export class ShareDialog extends GenericDialog {
dateTimePicker = new DateTimePicker(); dateTimePicker = new DateTimePicker();
@ -56,7 +57,7 @@ export class ShareDialog extends GenericDialog {
} }
async getLinkUrl(): Promise<string> { async getLinkUrl(): Promise<string> {
return this.url.getAttribute('value'); return BrowserActions.getInputValue(this.url);
} }
async isUrlReadOnly(): Promise<boolean> { async isUrlReadOnly(): Promise<boolean> {
@ -69,7 +70,7 @@ export class ShareDialog extends GenericDialog {
} }
async clickClose(): Promise<void> { async clickClose(): Promise<void> {
await this.closeButton.click(); await BrowserActions.click(this.closeButton);
await this.waitForDialogToClose(); await this.waitForDialogToClose();
} }
@ -90,11 +91,11 @@ export class ShareDialog extends GenericDialog {
async closeDatetimePicker(): Promise<void> { async closeDatetimePicker(): Promise<void> {
if (await this.dateTimePicker.isCalendarOpen()) { if (await this.dateTimePicker.isCalendarOpen()) {
await this.datetimePickerButton.click(); await BrowserActions.click(this.datetimePickerButton);
} }
} }
async getExpireDate(): Promise<string> { async getExpireDate(): Promise<string> {
return this.expireInput.getAttribute('value'); return BrowserActions.getInputValue(this.expireInput);
} }
} }

View File

@ -47,7 +47,7 @@ export class Header extends Component {
} }
async openMoreMenu(): Promise<void> { async openMoreMenu(): Promise<void> {
await this.moreActions.click(); await BrowserActions.click(this.moreActions);
await this.menu.waitForMenuToOpen(); await this.menu.waitForMenuToOpen();
} }
@ -63,7 +63,7 @@ export class Header extends Component {
async expandSideNav(): Promise<void> { async expandSideNav(): Promise<void> {
const expanded = await this.isSidenavExpanded(); const expanded = await this.isSidenavExpanded();
if (!expanded) { if (!expanded) {
await this.sidenavToggle.click(); await BrowserActions.click(this.sidenavToggle);
await waitElement(`[data-automation-id='expanded']`); await waitElement(`[data-automation-id='expanded']`);
} }
} }
@ -71,7 +71,7 @@ export class Header extends Component {
async collapseSideNav(): Promise<void> { async collapseSideNav(): Promise<void> {
const expanded = await this.isSidenavExpanded(); const expanded = await this.isSidenavExpanded();
if (expanded) { if (expanded) {
await this.sidenavToggle.click(); await BrowserActions.click(this.sidenavToggle);
await waitElement(`[data-automation-id='collapsed']`); await waitElement(`[data-automation-id='collapsed']`);
} }
} }

View File

@ -25,6 +25,7 @@
import { Menu } from '../menu/menu'; import { Menu } from '../menu/menu';
import { Component } from '../component'; import { Component } from '../component';
import { BrowserActions } from '@alfresco/adf-testing';
export class UserInfo extends Component { export class UserInfo extends Component {
fullName = this.byCss('.current-user__full-name'); fullName = this.byCss('.current-user__full-name');
@ -37,7 +38,7 @@ export class UserInfo extends Component {
} }
async openMenu(): Promise<Menu> { async openMenu(): Promise<Menu> {
await this.avatar.click(); await BrowserActions.click(this.avatar);
await this.menu.wait(); await this.menu.wait();
return this.menu; return this.menu;

View File

@ -26,7 +26,8 @@
import { by, browser, until } from 'protractor'; import { by, browser, until } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { waitForVisibility, typeText } from '../../utilities/utils'; import { typeText } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class CommentsTab extends Component { export class CommentsTab extends Component {
commentsContainer = this.byCss('.adf-comments-container'); commentsContainer = this.byCss('.adf-comments-container');
@ -44,7 +45,7 @@ export class CommentsTab extends Component {
} }
async waitForCommentsContainer() { async waitForCommentsContainer() {
await waitForVisibility(this.commentsContainer); await BrowserVisibility.waitUntilElementIsVisible(this.commentsContainer);
} }
async getCommentsTabHeaderText(): Promise<string> { async getCommentsTabHeaderText(): Promise<string> {
@ -111,10 +112,10 @@ export class CommentsTab extends Component {
} }
async clickAddButton(): Promise<void> { async clickAddButton(): Promise<void> {
await this.addCommentButton.click(); await BrowserActions.click(this.addCommentButton);
} }
async getCommentTextFromTextArea(): Promise<string> { async getCommentTextFromTextArea(): Promise<string> {
return this.commentTextarea.getAttribute('value'); return BrowserActions.getInputValue(this.commentTextarea);
} }
} }

View File

@ -25,7 +25,8 @@
import { by, browser, ElementFinder } from 'protractor'; import { by, browser, ElementFinder } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { isPresentAndEnabled, isPresentAndDisplayed, waitForVisibility } from '../../utilities/utils'; import { isPresentAndEnabled, isPresentAndDisplayed } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class ContentMetadata extends Component { export class ContentMetadata extends Component {
expandedPanel = this.byCss('.mat-expansion-panel.mat-expanded'); expandedPanel = this.byCss('.mat-expansion-panel.mat-expanded');
@ -47,7 +48,7 @@ export class ContentMetadata extends Component {
} }
async waitForImagePropertiesPanelToExpand(): Promise<void> { async waitForImagePropertiesPanelToExpand(): Promise<void> {
await waitForVisibility(this.expandedImagePropertiesPanel); await BrowserVisibility.waitUntilElementIsVisible(this.expandedImagePropertiesPanel);
} }
async getVisiblePropertiesLabels(): Promise<string[]> { async getVisiblePropertiesLabels(): Promise<string[]> {
@ -95,7 +96,7 @@ export class ContentMetadata extends Component {
const tagName = await elem.getTagName(); const tagName = await elem.getTagName();
if (tagName === 'input' || tagName === 'textarea') { if (tagName === 'input' || tagName === 'textarea') {
return elem.getAttribute('value'); return BrowserActions.getInputValue(elem);
} }
return elem.getText(); return elem.getText();

View File

@ -24,7 +24,7 @@
*/ */
import { by, browser } from 'protractor'; import { by, browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserActions, Logger } from '@alfresco/adf-testing';
import { Component } from '../component'; import { Component } from '../component';
import { waitForPresence, waitForStaleness, typeText } from '../../utilities/utils'; import { waitForPresence, waitForStaleness, typeText } from '../../utilities/utils';
@ -83,7 +83,7 @@ export class LibraryMetadata extends Component {
} }
private async clickButton(button: string) { private async clickButton(button: string) {
await this.getButton(button).click(); await BrowserActions.click(this.getButton(button));
} }
async waitForVisibilityDropDownToClose() { async waitForVisibilityDropDownToClose() {
@ -155,15 +155,15 @@ export class LibraryMetadata extends Component {
async setVisibility(visibility: string) { async setVisibility(visibility: string) {
const val = visibility.toLowerCase(); const val = visibility.toLowerCase();
await this.visibilityDropDown.click(); await BrowserActions.click(this.visibilityDropDown);
await waitForPresence(this.visibilityDropDown); await waitForPresence(this.visibilityDropDown);
if (val === 'public') { if (val === 'public') {
await this.visibilityPublic.click(); await BrowserActions.click(this.visibilityPublic);
} else if (val === 'private') { } else if (val === 'private') {
await this.visibilityPrivate.click(); await BrowserActions.click(this.visibilityPrivate);
} else if (val === 'moderated') { } else if (val === 'moderated') {
await this.visibilityModerated.click(); await BrowserActions.click(this.visibilityModerated);
} else { } else {
Logger.error('----- invalid visibility', val); Logger.error('----- invalid visibility', val);
} }

View File

@ -24,12 +24,12 @@
*/ */
import { by, browser } from 'protractor'; import { by, browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { Component } from '../component'; import { Component } from '../component';
import { CommentsTab } from './info-drawer-comments-tab'; import { CommentsTab } from './info-drawer-comments-tab';
import { LibraryMetadata } from './info-drawer-metadata-library'; import { LibraryMetadata } from './info-drawer-metadata-library';
import { ContentMetadata } from './info-drawer-metadata-content'; import { ContentMetadata } from './info-drawer-metadata-content';
import { waitForVisibility, waitForInvisibility, waitForPresence } from '../../utilities/utils'; import { waitForPresence } from '../../utilities/utils';
export class InfoDrawer extends Component { export class InfoDrawer extends Component {
commentsTab = new CommentsTab('adf-info-drawer'); commentsTab = new CommentsTab('adf-info-drawer');
@ -89,7 +89,7 @@ export class InfoDrawer extends Component {
} }
async clickTab(title: string) { async clickTab(title: string) {
await this.getTabByTitle(title).click(); await BrowserActions.click(this.getTabByTitle(title));
} }
async getComponentIdOfTab(): Promise<string> { async getComponentIdOfTab(): Promise<string> {
@ -118,9 +118,12 @@ export class InfoDrawer extends Component {
async clickCommentsTab() { async clickCommentsTab() {
try { try {
await this.getTabByTitle('Comments').click(); await BrowserActions.click(this.getTabByTitle('Comments'));
await this.commentsTab.waitForCommentsContainer(); await this.commentsTab.waitForCommentsContainer();
await Promise.all([waitForVisibility(this.commentsTab.component), waitForInvisibility(this.propertiesTab.component)]); await Promise.all([
BrowserVisibility.waitUntilElementIsVisible(this.commentsTab.component),
BrowserVisibility.waitUntilElementIsNotVisible(this.propertiesTab.component)
]);
} catch (error) { } catch (error) {
Logger.error('--- info-drawer clickCommentsTab catch error: ', error); Logger.error('--- info-drawer clickCommentsTab catch error: ', error);
} }

View File

@ -24,9 +24,9 @@
*/ */
import { ElementFinder, by, browser } from 'protractor'; import { ElementFinder, by, browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { Logger, BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { Component } from '../component'; import { Component } from '../component';
import { Utils, isPresentAndEnabled, waitForPresence, waitForVisibility, waitForStaleness, waitForClickable } from '../../utilities/utils'; import { Utils, isPresentAndEnabled, waitForPresence, waitForStaleness } from '../../utilities/utils';
export class Menu extends Component { export class Menu extends Component {
items = this.allByCss('.mat-menu-item'); items = this.allByCss('.mat-menu-item');
@ -72,7 +72,7 @@ export class Menu extends Component {
async waitForMenuToOpen(): Promise<void> { async waitForMenuToOpen(): Promise<void> {
await waitForPresence(browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))); await waitForPresence(browser.element(by.css('.cdk-overlay-container .mat-menu-panel')));
await waitForVisibility(this.items.get(0)); await BrowserVisibility.waitUntilElementIsVisible(this.items.get(0));
} }
async waitForMenuToClose(): Promise<void> { async waitForMenuToClose(): Promise<void> {
@ -126,7 +126,7 @@ export class Menu extends Component {
async clickNthItem(nth: number): Promise<void> { async clickNthItem(nth: number): Promise<void> {
try { try {
const elem = this.getNthItem(nth); const elem = this.getNthItem(nth);
await waitForClickable(elem); await BrowserVisibility.waitUntilElementIsClickable(elem);
await browser.actions().mouseMove(elem).perform(); await browser.actions().mouseMove(elem).perform();
await browser.actions().click().perform(); await browser.actions().click().perform();
await this.waitForMenuToClose(); await this.waitForMenuToClose();
@ -138,8 +138,7 @@ export class Menu extends Component {
async clickMenuItem(menuItem: string): Promise<void> { async clickMenuItem(menuItem: string): Promise<void> {
try { try {
const elem = this.getItemByLabel(menuItem); const elem = this.getItemByLabel(menuItem);
await waitForClickable(elem); await BrowserActions.click(elem);
await elem.click();
} catch (e) { } catch (e) {
Logger.error('___click menu item catch___', e); Logger.error('___click menu item catch___', e);
} }
@ -148,7 +147,7 @@ export class Menu extends Component {
async mouseOverMenuItem(menuItem: string): Promise<void> { async mouseOverMenuItem(menuItem: string): Promise<void> {
try { try {
const elem = this.getItemByLabel(menuItem); const elem = this.getItemByLabel(menuItem);
await waitForClickable(elem); await BrowserVisibility.waitUntilElementIsClickable(elem);
await browser.actions().mouseMove(elem).perform(); await browser.actions().mouseMove(elem).perform();
await browser.sleep(500); await browser.sleep(500);
} catch (error) { } catch (error) {
@ -159,7 +158,7 @@ export class Menu extends Component {
async hasSubMenu(menuItem: string): Promise<boolean> { async hasSubMenu(menuItem: string): Promise<boolean> {
try { try {
const elem = this.getItemByLabel(menuItem); const elem = this.getItemByLabel(menuItem);
await waitForClickable(elem); await BrowserVisibility.waitUntilElementIsClickable(elem);
const elemClass = await elem.getAttribute('class'); const elemClass = await elem.getAttribute('class');
return elemClass.includes('mat-menu-item-submenu-trigger'); return elemClass.includes('mat-menu-item-submenu-trigger');
} catch (error) { } catch (error) {
@ -171,8 +170,7 @@ export class Menu extends Component {
async clickSubMenuItem(subMenuItem: string): Promise<void> { async clickSubMenuItem(subMenuItem: string): Promise<void> {
try { try {
const elem = this.getSubItemByLabel(subMenuItem); const elem = this.getSubItemByLabel(subMenuItem);
await waitForClickable(elem); await BrowserActions.click(elem);
await elem.click();
} catch (e) { } catch (e) {
Logger.error('___click submenu item catch___', e); Logger.error('___click submenu item catch___', e);
} }

View File

@ -24,10 +24,9 @@
*/ */
import { browser } from 'protractor'; import { browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserActions, Logger } from '@alfresco/adf-testing';
import { Menu } from '../menu/menu'; import { Menu } from '../menu/menu';
import { Component } from '../component'; import { Component } from '../component';
import { waitForClickable } from '../../utilities/utils';
export class Pagination extends Component { export class Pagination extends Component {
range = this.byCss('.adf-pagination__range'); range = this.byCss('.adf-pagination__range');
@ -47,8 +46,7 @@ export class Pagination extends Component {
async openMaxItemsMenu() { async openMaxItemsMenu() {
try { try {
await waitForClickable(this.maxItemsButton, 'timeout waiting for maxItemsButton to be clickable'); await BrowserActions.click(this.maxItemsButton);
await this.maxItemsButton.click();
await this.menu.waitForMenuToOpen(); await this.menu.waitForMenuToOpen();
} catch (error) { } catch (error) {
Logger.error('____ open max items catch ___', error); Logger.error('____ open max items catch ___', error);
@ -57,8 +55,7 @@ export class Pagination extends Component {
async openCurrentPageMenu() { async openCurrentPageMenu() {
try { try {
await waitForClickable(this.pagesButton, 'timeout waiting for pagesButton to be clickable'); await BrowserActions.click(this.pagesButton);
await this.pagesButton.click();
await this.menu.waitForMenuToOpen(); await this.menu.waitForMenuToOpen();
} catch (error) { } catch (error) {
Logger.error('____ open current page menu ___', error); Logger.error('____ open current page menu ___', error);
@ -86,11 +83,11 @@ export class Pagination extends Component {
} }
async clickNext() { async clickNext() {
await this.nextButton.click(); await BrowserActions.click(this.nextButton);
} }
async clickPrevious() { async clickPrevious() {
await this.previousButton.click(); await BrowserActions.click(this.previousButton);
} }
async isNextEnabled() { async isNextEnabled() {

View File

@ -25,7 +25,8 @@
import { ElementFinder, by, protractor } from 'protractor'; import { ElementFinder, by, protractor } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel'; import { GenericFilterPanel } from './generic-filter-panel';
import { Utils, isPresentAndDisplayed } from '../../../utilities/utils'; import { isPresentAndDisplayed } from '../../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class CreatedDateFilter extends GenericFilterPanel { export class CreatedDateFilter extends GenericFilterPanel {
constructor() { constructor() {
@ -67,22 +68,18 @@ export class CreatedDateFilter extends GenericFilterPanel {
async clickClearButton(): Promise<void> { async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) { if (await this.isClearButtonEnabled()) {
await this.clearButton.click(); await BrowserActions.click(this.clearButton);
} }
} }
async clickApplyButton(): Promise<void> { async clickApplyButton(): Promise<void> {
if (await this.isApplyButtonEnabled()) { if (await this.isApplyButtonEnabled()) {
await this.applyButton.click(); await BrowserActions.click(this.applyButton);
} }
} }
async getFromValue(): Promise<string> { async getFromValue(): Promise<string> {
try { return BrowserActions.getInputValue(this.fromInput);
return await this.fromInput.getAttribute('value');
} catch (error) {
return '';
}
} }
async getFromError(): Promise<string> { async getFromError(): Promise<string> {
@ -94,11 +91,7 @@ export class CreatedDateFilter extends GenericFilterPanel {
} }
async getToValue(): Promise<string> { async getToValue(): Promise<string> {
try { return BrowserActions.getInputValue(this.fromInput);
return await this.toInput.getAttribute('value');
} catch (err) {
return '';
}
} }
async getToError(): Promise<string> { async getToError(): Promise<string> {
@ -121,13 +114,13 @@ export class CreatedDateFilter extends GenericFilterPanel {
async enterFromDate(date: string): Promise<void> { async enterFromDate(date: string): Promise<void> {
await this.expandPanel(); await this.expandPanel();
await Utils.clearFieldWithBackspace(this.fromInput); await BrowserActions.clearWithBackSpace(this.fromInput);
await this.fromInput.sendKeys(date, protractor.Key.TAB); await this.fromInput.sendKeys(date, protractor.Key.TAB);
} }
async enterToDate(date: string): Promise<void> { async enterToDate(date: string): Promise<void> {
await this.expandPanel(); await this.expandPanel();
await Utils.clearFieldWithBackspace(this.toInput); await BrowserActions.clearWithBackSpace(this.toInput);
await this.toInput.sendKeys(date, protractor.Key.TAB); await this.toInput.sendKeys(date, protractor.Key.TAB);
} }
} }

View File

@ -25,13 +25,14 @@
import { ElementFinder, ElementArrayFinder, by, browser } from 'protractor'; import { ElementFinder, ElementArrayFinder, by, browser } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel'; import { GenericFilterPanel } from './generic-filter-panel';
import { BrowserActions } from '@alfresco/adf-testing';
export class FacetFilter extends GenericFilterPanel { export class FacetFilter extends GenericFilterPanel {
private readonly locators = { private readonly locators = {
checkbox: '.mat-checkbox', checkbox: '.mat-checkbox',
checkboxChecked: '.mat-checkbox.mat-checkbox-checked', checkboxChecked: '.mat-checkbox.mat-checkbox-checked',
button: '.adf-facet-buttons button', button: '.adf-facet-buttons button',
categoryInput: 'input[placeholder="Filter category"', categoryInput: 'input[data-placeholder="Filter category"',
facetsFilter: '.adf-facet-result-filter' facetsFilter: '.adf-facet-result-filter'
}; };
@ -67,7 +68,7 @@ export class FacetFilter extends GenericFilterPanel {
if ((await this.selectedFacets.count()) > 0) { if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel(); await this.expandPanel();
await this.selectedFacets.each(async (elem) => { await this.selectedFacets.each(async (elem) => {
await elem.click(); await BrowserActions.click(elem);
}); });
} }
await this.expandPanel(); await this.expandPanel();
@ -83,7 +84,7 @@ export class FacetFilter extends GenericFilterPanel {
async clickClearButton(): Promise<void> { async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) { if (await this.isClearButtonEnabled()) {
await this.clearButton.click(); await BrowserActions.click(this.clearButton);
} }
} }

View File

@ -25,6 +25,7 @@
import { ElementFinder, by, browser } from 'protractor'; import { ElementFinder, by, browser } from 'protractor';
import { isPresentAndDisplayed } from '../../../utilities/utils'; import { isPresentAndDisplayed } from '../../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class GenericFilterPanel { export class GenericFilterPanel {
private filterName: string; private filterName: string;
@ -52,7 +53,7 @@ export class GenericFilterPanel {
} }
async clickPanelHeader(): Promise<void> { async clickPanelHeader(): Promise<void> {
await this.panelHeader.click(); await BrowserActions.click(this.panelHeader);
} }
async isPanelDisplayed(): Promise<boolean> { async isPanelDisplayed(): Promise<boolean> {

View File

@ -25,6 +25,7 @@
import { ElementFinder, by, ElementArrayFinder } from 'protractor'; import { ElementFinder, by, ElementArrayFinder } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel'; import { GenericFilterPanel } from './generic-filter-panel';
import { BrowserActions } from '@alfresco/adf-testing';
export class SizeFilter extends GenericFilterPanel { export class SizeFilter extends GenericFilterPanel {
constructor() { constructor() {
@ -51,7 +52,7 @@ export class SizeFilter extends GenericFilterPanel {
if ((await this.selectedFacets.count()) > 0) { if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel(); await this.expandPanel();
await this.selectedFacets.each(async (elem) => { await this.selectedFacets.each(async (elem) => {
await elem.click(); await BrowserActions.click(elem);
}); });
} }
await this.collapsePanel(); await this.collapsePanel();
@ -63,27 +64,27 @@ export class SizeFilter extends GenericFilterPanel {
async clickClearButton(): Promise<void> { async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) { if (await this.isClearButtonEnabled()) {
await this.clearButton.click(); await BrowserActions.click(this.clearButton);
} }
} }
async checkSizeSmall(): Promise<void> { async checkSizeSmall(): Promise<void> {
const small = this.facets.filter(async (elem) => (await elem.getText()) === 'Small').first(); const small = this.facets.filter(async (elem) => (await elem.getText()) === 'Small').first();
await small.click(); await BrowserActions.click(small);
} }
async checkSizeMedium(): Promise<void> { async checkSizeMedium(): Promise<void> {
const medium = this.facets.filter(async (elem) => (await elem.getText()) === 'Medium').first(); const medium = this.facets.filter(async (elem) => (await elem.getText()) === 'Medium').first();
await medium.click(); await BrowserActions.click(medium);
} }
async checkSizeLarge(): Promise<void> { async checkSizeLarge(): Promise<void> {
const large = this.facets.filter(async (elem) => (await elem.getText()) === 'Large').first(); const large = this.facets.filter(async (elem) => (await elem.getText()) === 'Large').first();
await large.click(); await BrowserActions.click(large);
} }
async checkSizeHuge(): Promise<void> { async checkSizeHuge(): Promise<void> {
const huge = this.facets.filter(async (elem) => (await elem.getText()) === 'Huge').first(); const huge = this.facets.filter(async (elem) => (await elem.getText()) === 'Huge').first();
await huge.click(); await BrowserActions.click(huge);
} }
} }

View File

@ -25,7 +25,8 @@
import { browser, by, protractor } from 'protractor'; import { browser, by, protractor } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { Utils, waitForPresence, waitForClickable, waitElement } from '../../utilities/utils'; import { waitForPresence, waitElement } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class SearchInput extends Component { export class SearchInput extends Component {
searchButton = this.component.element(by.css('.app-search-button')); searchButton = this.component.element(by.css('.app-search-button'));
@ -47,7 +48,7 @@ export class SearchInput extends Component {
} }
async waitForSearchInputToBeInteractive() { async waitForSearchInputToBeInteractive() {
await waitForClickable(this.searchControl); await BrowserVisibility.waitUntilElementIsClickable(this.searchControl);
} }
async isSearchContainerDisplayed() { async isSearchContainerDisplayed() {
@ -58,8 +59,7 @@ export class SearchInput extends Component {
} }
async clickSearchButton() { async clickSearchButton() {
await waitForClickable(this.searchButton); await BrowserActions.click(this.searchButton);
await this.searchButton.click();
await this.waitForSearchControl(); await this.waitForSearchControl();
} }
@ -69,18 +69,15 @@ export class SearchInput extends Component {
} }
async clickFilesOption() { async clickFilesOption() {
await waitForClickable(this.searchFilesOption); await BrowserActions.click(this.searchFilesOption);
await this.searchFilesOption.click();
} }
async clickFoldersOption() { async clickFoldersOption() {
await waitForClickable(this.searchFoldersOption); await BrowserActions.click(this.searchFoldersOption);
await this.searchFoldersOption.click();
} }
async clickLibrariesOption() { async clickLibrariesOption() {
await waitForClickable(this.searchLibrariesOption); await BrowserActions.click(this.searchLibrariesOption);
await this.searchLibrariesOption.click();
} }
async isFilesOptionEnabled() { async isFilesOptionEnabled() {
@ -131,7 +128,7 @@ export class SearchInput extends Component {
async clickClearSearchButton() { async clickClearSearchButton() {
if (await this.isClearSearchButtonPresent()) { if (await this.isClearSearchButtonPresent()) {
await this.clearSearchButton.click(); await BrowserActions.click(this.clearSearchButton);
} }
} }
@ -158,7 +155,7 @@ export class SearchInput extends Component {
async searchFor(text: string) { async searchFor(text: string) {
await this.waitForSearchInputToBeInteractive(); await this.waitForSearchInputToBeInteractive();
await Utils.clearFieldWithBackspace(this.searchInput); await BrowserActions.clearWithBackSpace(this.searchInput);
await this.searchInput.sendKeys(text); await this.searchInput.sendKeys(text);
await this.searchInput.sendKeys(protractor.Key.ENTER); await this.searchInput.sendKeys(protractor.Key.ENTER);
} }

View File

@ -25,7 +25,8 @@
import { by, browser } from 'protractor'; import { by, browser } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { isPresentAndDisplayed, waitForVisibility } from '../../utilities/utils'; import { isPresentAndDisplayed } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export type SortByType = 'Relevance' | 'Title' | 'Filename' | 'Modified date' | 'Modifier' | 'Created date' | 'Size' | 'Type'; export type SortByType = 'Relevance' | 'Title' | 'Filename' | 'Modified date' | 'Modifier' | 'Created date' | 'Size' | 'Type';
export type SortOrderType = 'ASC' | 'DESC' | ''; export type SortOrderType = 'ASC' | 'DESC' | '';
@ -41,7 +42,11 @@ export class SearchSortingPicker extends Component {
} }
async waitForSortByDropdownToExpand(): Promise<void> { async waitForSortByDropdownToExpand(): Promise<void> {
await waitForVisibility(this.sortByDropdownExpanded, 'Timeout waiting for sortBy dropdown to expand'); await BrowserVisibility.waitUntilElementIsVisible(
this.sortByDropdownExpanded,
BrowserVisibility.DEFAULT_TIMEOUT,
'Timeout waiting for sortBy dropdown to expand'
);
} }
async isSortOrderButtonDisplayed(): Promise<boolean> { async isSortOrderButtonDisplayed(): Promise<boolean> {
@ -73,7 +78,7 @@ export class SearchSortingPicker extends Component {
} }
async clickSortByDropdown(): Promise<void> { async clickSortByDropdown(): Promise<void> {
await this.sortByDropdownCollapsed.click(); await BrowserActions.click(this.sortByDropdownCollapsed);
await this.waitForSortByDropdownToExpand(); await this.waitForSortByDropdownToExpand();
} }
@ -88,18 +93,18 @@ export class SearchSortingPicker extends Component {
await this.clickSortByDropdown(); await this.clickSortByDropdown();
} }
const elem = browser.element(by.cssContainingText('.mat-option .mat-option-text', option)); const elem = browser.element(by.cssContainingText('.mat-option .mat-option-text', option));
await elem.click(); await BrowserActions.click(elem);
} }
async setSortOrderASC(): Promise<void> { async setSortOrderASC(): Promise<void> {
if ((await this.getSortOrder()) !== 'ASC') { if ((await this.getSortOrder()) !== 'ASC') {
await this.sortOrderButton.click(); await BrowserActions.click(this.sortOrderButton);
} }
} }
async setSortOrderDESC(): Promise<void> { async setSortOrderDESC(): Promise<void> {
if ((await this.getSortOrder()) !== 'DESC') { if ((await this.getSortOrder()) !== 'DESC') {
await this.sortOrderButton.click(); await BrowserActions.click(this.sortOrderButton);
} }
} }
} }

View File

@ -28,7 +28,6 @@ import { Logger, BrowserActions } from '@alfresco/adf-testing';
import { SIDEBAR_LABELS, BROWSER_WAIT_TIMEOUT } from '../../configs'; import { SIDEBAR_LABELS, BROWSER_WAIT_TIMEOUT } from '../../configs';
import { Menu } from '../menu/menu'; import { Menu } from '../menu/menu';
import { Component } from '../component'; import { Component } from '../component';
import { waitForClickable } from '../../utilities/utils';
export class Sidenav extends Component { export class Sidenav extends Component {
links = this.component.all(by.css('.item')); links = this.component.all(by.css('.item'));
@ -55,8 +54,7 @@ export class Sidenav extends Component {
return Promise.resolve(); return Promise.resolve();
} else { } else {
const link = this.getLink(name); const link = this.getLink(name);
await waitForClickable(link); await BrowserActions.click(link);
await link.click();
await element(by.css('.mat-expansion-panel-body')).isPresent(); await element(by.css('.mat-expansion-panel-body')).isPresent();
} }
} catch (e) { } catch (e) {
@ -65,7 +63,7 @@ export class Sidenav extends Component {
} }
async openNewMenu(): Promise<void> { async openNewMenu(): Promise<void> {
await this.newButton.click(); await BrowserActions.click(this.newButton.first());
await this.menu.waitForMenuToOpen(); await this.menu.waitForMenuToOpen();
} }
@ -76,22 +74,22 @@ export class Sidenav extends Component {
async openCreateFolderDialog(): Promise<void> { async openCreateFolderDialog(): Promise<void> {
await this.openNewMenu(); await this.openNewMenu();
await this.menu.createFolderAction.click(); await BrowserActions.click(this.menu.createFolderAction);
} }
async openCreateLibraryDialog(): Promise<void> { async openCreateLibraryDialog(): Promise<void> {
await this.openNewMenu(); await this.openNewMenu();
await this.menu.createLibraryAction.click(); await BrowserActions.click(this.menu.createLibraryAction);
} }
async openCreateFileFromTemplateDialog(): Promise<void> { async openCreateFileFromTemplateDialog(): Promise<void> {
await this.openNewMenu(); await this.openNewMenu();
await this.menu.createFileFromTemplateAction.click(); await BrowserActions.click(this.menu.createFileFromTemplateAction);
} }
async openCreateFolderFromTemplateDialog(): Promise<void> { async openCreateFolderFromTemplateDialog(): Promise<void> {
await this.openNewMenu(); await this.openNewMenu();
await this.menu.createFolderFromTemplateAction.click(); await BrowserActions.click(this.menu.createFolderFromTemplateAction);
} }
async isActive(name: string): Promise<boolean> { async isActive(name: string): Promise<boolean> {
@ -144,8 +142,7 @@ export class Sidenav extends Component {
async clickLink(name: string): Promise<void> { async clickLink(name: string): Promise<void> {
try { try {
const link = this.getLinkLabel(name); const link = this.getLinkLabel(name);
await waitForClickable(link); await BrowserActions.click(link);
await link.click();
} catch (error) { } catch (error) {
Logger.error('---- sidebar navigation clickLink catch error: ', error); Logger.error('---- sidebar navigation clickLink catch error: ', error);
} }

View File

@ -102,7 +102,7 @@ export class Toolbar extends Component {
} }
async clickButton(title: string): Promise<void> { async clickButton(title: string): Promise<void> {
await this.getButtonByTitleAttribute(title).click(); await BrowserActions.click(this.getButtonByTitleAttribute(title));
} }
async isPrintPresent() { async isPrintPresent() {

View File

@ -28,6 +28,7 @@ import { Page } from './page';
import { APP_ROUTES } from '../configs'; import { APP_ROUTES } from '../configs';
import { waitForPresence } from '../utilities/utils'; import { waitForPresence } from '../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class LoginPage extends Page { export class LoginPage extends Page {
login = new LoginComponent(this.appRoot); login = new LoginComponent(this.appRoot);
@ -45,7 +46,7 @@ export class LoginPage extends Page {
const pass = password || username; const pass = password || username;
await this.load(); await this.load();
await this.login.enterCredentials(username, pass); await this.login.enterCredentials(username, pass);
await this.login.submitButton.click(); await BrowserActions.click(this.login.submitButton);
return super.waitForApp(); return super.waitForApp();
} }
@ -58,7 +59,7 @@ export class LoginPage extends Page {
const pass = password || username; const pass = password || username;
await this.load(); await this.load();
await this.login.enterCredentials(username, pass); await this.login.enterCredentials(username, pass);
await this.login.submitButton.click(); await BrowserActions.click(this.login.submitButton);
await waitForPresence(this.login.errorMessage); await waitForPresence(this.login.errorMessage);
} }
} }

View File

@ -24,9 +24,9 @@
*/ */
import { browser, by, ElementFinder } from 'protractor'; import { browser, by, ElementFinder } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { USE_HASH_STRATEGY } from './../configs'; import { USE_HASH_STRATEGY } from './../configs';
import { Utils, waitElement, waitForPresence, waitForVisibility, isPresentAndDisplayed } from '../utilities/utils'; import { Utils, waitElement, waitForPresence, isPresentAndDisplayed } from '../utilities/utils';
export abstract class Page { export abstract class Page {
appRoot = 'app-root'; appRoot = 'app-root';
@ -61,7 +61,7 @@ export abstract class Page {
} }
async waitForDialog() { async waitForDialog() {
await waitForVisibility(this.dialogContainer); await BrowserVisibility.waitUntilElementIsVisible(this.dialogContainer);
} }
async isDialogOpen() { async isDialogOpen() {
@ -80,7 +80,7 @@ export abstract class Page {
async closeUploadDialog(): Promise<void> { async closeUploadDialog(): Promise<void> {
if (await this.isUploadDialogOpen()) { if (await this.isUploadDialogOpen()) {
await this.closeUploadButton.click(); await BrowserActions.click(this.closeUploadButton);
} }
} }
@ -96,8 +96,7 @@ export abstract class Page {
async clickSnackBarAction(): Promise<void> { async clickSnackBarAction(): Promise<void> {
try { try {
const action = await waitElement('.mat-simple-snackbar-action button'); await BrowserActions.click(this.byCss('.mat-simple-snackbar-action button'));
await action.click();
} catch (e) { } catch (e) {
Logger.error(e, '.......failed on click snack bar action.........'); Logger.error(e, '.......failed on click snack bar action.........');
} }

View File

@ -27,6 +27,7 @@ import { browser, by, By } from 'protractor';
import { BrowsingPage } from './browsing-page'; import { BrowsingPage } from './browsing-page';
import { SearchSortingPicker } from '../components/search/search-sorting-picker'; import { SearchSortingPicker } from '../components/search/search-sorting-picker';
import { SearchFilters } from '../components/search/search-filters'; import { SearchFilters } from '../components/search/search-filters';
import { BrowserActions } from '@alfresco/adf-testing';
export class SearchResultsPage extends BrowsingPage { export class SearchResultsPage extends BrowsingPage {
root = this.byCss('aca-search-results'); root = this.byCss('aca-search-results');
@ -54,6 +55,6 @@ export class SearchResultsPage extends BrowsingPage {
async removeChip(chipName: string): Promise<void> { async removeChip(chipName: string): Promise<void> {
const chip = browser.element(By.cssContainingText('.mat-chip', chipName)); const chip = browser.element(By.cssContainingText('.mat-chip', chipName));
const closeChip = chip.element(by.css('.mat-chip-remove')); const closeChip = chip.element(by.css('.mat-chip-remove'));
await closeChip.click(); await BrowserActions.click(closeChip);
} }
} }

View File

@ -77,15 +77,19 @@ export class FavoritesApi extends RepoApi {
} }
} }
async addFavoritesByIds(nodeType: 'file' | 'folder' | 'site', ids: string[]) { async addFavoritesByIds(nodeType: 'file' | 'folder' | 'site', ids: string[]): Promise<FavoriteEntry[]> {
const favorites: FavoriteEntry[] = [];
try { try {
return await ids.reduce(async (previous, current) => { if (ids && ids.length > 0) {
await previous; for (const id of ids) {
await this.addFavoriteById(nodeType, current); const favorite = await this.addFavoriteById(nodeType, id);
}, Promise.resolve()); favorites.push(favorite);
}
}
} catch (error) { } catch (error) {
this.handleError(`FavoritesApi addFavoritesByIds : catch : `, error); this.handleError(`FavoritesApi addFavoritesByIds : catch : `, error);
} }
return favorites;
} }
async getFavorites() { async getFavorites() {

View File

@ -49,15 +49,19 @@ export class SharedLinksApi extends RepoApi {
} }
} }
async shareFilesByIds(ids: string[]) { async shareFilesByIds(ids: string[]): Promise<SharedLinkEntry[]> {
const sharedLinks: SharedLinkEntry[] = [];
try { try {
return await ids.reduce(async (previous: any, current: any) => { if (ids && ids.length > 0) {
await previous; for (const id of ids) {
return this.shareFileById(current); const sharedLink = await this.shareFileById(id);
}, Promise.resolve()); sharedLinks.push(sharedLink);
}
}
} catch (error) { } catch (error) {
this.handleError(`SharedLinksApi shareFilesByIds : catch : `, error); this.handleError(`SharedLinksApi shareFilesByIds : catch : `, error);
} }
return sharedLinks;
} }
async getSharedIdOfNode(name: string): Promise<string> { async getSharedIdOfNode(name: string): Promise<string> {

View File

@ -139,15 +139,19 @@ export class SitesApi extends RepoApi {
return this.createSite(title, SITE_VISIBILITY.MODERATED, description, siteId); return this.createSite(title, SITE_VISIBILITY.MODERATED, description, siteId);
} }
async createSites(titles: string[], visibility?: string): Promise<any> { async createSites(siteNames: string[], visibility?: string): Promise<SiteEntry[]> {
const sites: SiteEntry[] = [];
try { try {
return titles.reduce(async (previous: any, current: any) => { if (siteNames && siteNames.length > 0) {
await previous; for (const siteName of siteNames) {
return this.createSite(current, visibility); const site = await this.createSite(siteName, visibility);
}, Promise.resolve()); sites.push(site);
}
}
} catch (error) { } catch (error) {
this.handleError(`SitesApi createSites : catch : `, error); this.handleError(`SitesApi createSites : catch : `, error);
} }
return sites;
} }
async createSitesPrivate(siteNames: string[]): Promise<any> { async createSitesPrivate(siteNames: string[]): Promise<any> {

View File

@ -24,7 +24,7 @@
*/ */
import { browser, protractor, ElementFinder, ExpectedConditions as EC, by, logging, until, WebElement } from 'protractor'; import { browser, protractor, ElementFinder, ExpectedConditions as EC, by, logging, until, WebElement } from 'protractor';
import { Logger } from '@alfresco/adf-testing'; import { BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { BROWSER_WAIT_TIMEOUT } from '../configs'; import { BROWSER_WAIT_TIMEOUT } from '../configs';
import * as path from 'path'; import * as path from 'path';
import * as fs from 'fs'; import * as fs from 'fs';
@ -45,26 +45,6 @@ export async function waitElement(css: string, errorMessage?: string): Promise<W
return browser.wait(until.elementLocated(by.css(css)), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element: ${css}`); return browser.wait(until.elementLocated(by.css(css)), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element: ${css}`);
} }
export async function waitForClickable(element: ElementFinder, errorMessage?: string): Promise<void> {
await browser.wait(
EC.elementToBeClickable(element),
BROWSER_WAIT_TIMEOUT,
errorMessage || `Timeout waiting for element to be clickable: ${element.locator()}`
);
}
export async function waitForVisibility(element: ElementFinder, errorMessage?: string): Promise<void> {
await browser.wait(EC.visibilityOf(element), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element visibility: ${element.locator()}`);
}
export async function waitForInvisibility(element: ElementFinder, errorMessage?: string): Promise<void> {
await browser.wait(
EC.invisibilityOf(element),
BROWSER_WAIT_TIMEOUT,
errorMessage || `Timeout waiting for element visibility: ${element.locator()}`
);
}
export async function waitForPresence(element: ElementFinder, errorMessage?: string): Promise<void> { export async function waitForPresence(element: ElementFinder, errorMessage?: string): Promise<void> {
await browser.wait(EC.presenceOf(element), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element presence: ${element.locator()}`); await browser.wait(EC.presenceOf(element), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element presence: ${element.locator()}`);
} }
@ -74,23 +54,21 @@ export async function waitForStaleness(element: ElementFinder, errorMessage?: st
} }
export const isPresentAndEnabled = async (element: ElementFinder): Promise<boolean> => { export const isPresentAndEnabled = async (element: ElementFinder): Promise<boolean> => {
const isPresent = await element.isPresent(); try {
await BrowserVisibility.waitUntilElementIsPresent(element);
if (isPresent) {
return element.isEnabled(); return element.isEnabled();
} catch (error) {
return false;
} }
return false;
}; };
export const isPresentAndDisplayed = async (element: ElementFinder): Promise<boolean> => { export const isPresentAndDisplayed = async (element: ElementFinder): Promise<boolean> => {
const isPresent = await element.isPresent(); try {
await BrowserVisibility.waitUntilElementIsVisible(element);
if (isPresent) { return true;
return element.isDisplayed(); } catch (error) {
return false;
} }
return false;
}; };
export class Utils { export class Utils {
@ -129,13 +107,6 @@ export class Utils {
return run(retry); return run(retry);
} }
static async clearFieldWithBackspace(elem: ElementFinder): Promise<void> {
const text = await elem.getAttribute('value');
for (let i = 0; i < text.length; i++) {
await elem.sendKeys(protractor.Key.BACK_SPACE);
}
}
static async fileExistsOnOS(fileName: string, folderName: string = '', subFolderName: string = ''): Promise<any> { static async fileExistsOnOS(fileName: string, folderName: string = '', subFolderName: string = ''): Promise<any> {
const config = await browser.getProcessedConfig(); const config = await browser.getProcessedConfig();
const filePath = path.join(config.params.downloadFolder, folderName, subFolderName, fileName); const filePath = path.join(config.params.downloadFolder, folderName, subFolderName, fileName);

View File

@ -1,17 +1,7 @@
{ {
"extends": "../../tslint.json", "extends": "../../tslint.json",
"rules": { "rules": {
"directive-selector": [ "directive-selector": [true, "attribute", "lib", "camelCase"],
true, "component-selector": [true, "element", "lib", "kebab-case"]
"attribute",
"lib",
"camelCase"
],
"component-selector": [
true,
"element",
"lib",
"kebab-case"
]
} }
} }

View File

@ -17,7 +17,7 @@ const downloadFolder = path.join(__dirname, 'e2e-downloads');
const screenshotsFolder = path.resolve(__dirname, 'e2e-output'); const screenshotsFolder = path.resolve(__dirname, 'e2e-output');
const e2eFolder = path.resolve(projectRoot, 'e2e'); const e2eFolder = path.resolve(projectRoot, 'e2e');
const E2E_HOST = process.env.E2E_HOST || 'http://localhost:4200'; const E2E_HOST = process.env.E2E_HOST || 'http://localhost:4200';
const BROWSER_RUN = process.env.BROWSER_RUN; const BROWSER_RUN = !!process.env.BROWSER_RUN;
const width = 1366; const width = 1366;
const height = 768; const height = 768;
@ -26,21 +26,6 @@ const API_CONTENT_HOST = process.env.API_CONTENT_HOST || 'http://localhost:8080'
const MAXINSTANCES = process.env.MAXINSTANCES || 1; const MAXINSTANCES = process.env.MAXINSTANCES || 1;
const MAX_RETRIES = process.env.MAX_RETRIES || 1; const MAX_RETRIES = process.env.MAX_RETRIES || 1;
function rmDir(dirPath) {
try {
const files = fs.readdirSync(dirPath);
} catch (e) {
return;
}
if (files.length > 0)
for (let i = 0; i < files.length; i++) {
const filePath = dirPath + '/' + files[i];
if (fs.statSync(filePath).isFile()) fs.unlinkSync(filePath);
else rmDir(filePath);
}
fs.rmdirSync(dirPath);
}
const appConfig = { const appConfig = {
hostEcm: API_CONTENT_HOST, hostEcm: API_CONTENT_HOST,
providers: 'ECM', providers: 'ECM',
@ -139,12 +124,12 @@ exports.config = {
} }
}, },
args: [ args: [
'--incognito',
`--window-size=${width},${height}`, `--window-size=${width},${height}`,
'--disable-gpu', '--disable-gpu',
'--no-sandbox', '--no-sandbox',
'--disable-web-security', '--disable-web-security',
'--disable-browser-side-navigation', '--disable-browser-side-navigation',
'--allow-running-insecure-content',
...(BROWSER_RUN === true ? [] : ['--headless']) ...(BROWSER_RUN === true ? [] : ['--headless'])
] ]
} }
@ -217,14 +202,12 @@ exports.config = {
jasmine.getEnv().addReporter( jasmine.getEnv().addReporter(
new SpecReporter({ new SpecReporter({
spec: { spec: {
displayStacktrace: 'pretty', displayStacktrace: 'raw',
displayDuration: true displayDuration: true
} }
}) })
); );
rmDir(downloadFolder);
browser.driver.sendChromiumCommand('Page.setDownloadBehavior', { browser.driver.sendChromiumCommand('Page.setDownloadBehavior', {
behavior: 'allow', behavior: 'allow',
downloadPath: downloadFolder downloadPath: downloadFolder

View File

@ -4,6 +4,11 @@ FROM=$1;
TO=$2; TO=$2;
PARAMS=$3; PARAMS=$3;
echo "====== Check content UP ====="
./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$API_CONTENT_HOST" -u "$ADMIN_EMAIL" -p "$ADMIN_PASSWORD" || exit 1
echo "====== Download artifacts ====="
# Download built application artifact from S3 # Download built application artifact from S3
./scripts/ci/utils/artifact-from-s3.sh -a "$FROM" -o "$TO" ./scripts/ci/utils/artifact-from-s3.sh -a "$FROM" -o "$TO"
node "./scripts/app-config-replace.js" --config="$TO/app.config.json" $PARAMS node "./scripts/app-config-replace.js" --config="$TO/app.config.json" $PARAMS