Use hash strategy in demo shell as the other apps (#6402)

* hash startegy

* use hash in e2e

* trigger build

* fix

* fix

* remove children router overwrite crazynes

* Update login.module.ts

* revert not needed changes

* some fixes

* fix

* remove fdescribe

* fix

* fix

* Update share-file.e2e.ts

* Update lock-file.e2e.ts

* Update share-file.e2e.ts

* some fix

* some other fixes

* username as id

* fix after rebase

* username

* fix usernamee

* Fix the errorComponent

* Attempt to fix unit test - to check

* * Fixed circular dependency error while building adf-testing package

* * Fixed failing UT

* fix

* use username

* some fixes

* some fix

* fix

Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com>
Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
This commit is contained in:
Eugenio Romano
2020-12-16 18:46:56 +00:00
committed by GitHub
co-authored by Maurizio Vitale Vito Albano sivakumar414ram
parent 3734151338
commit 1c51b2a1a6
195 changed files with 1774 additions and 1460 deletions
@@ -35,7 +35,7 @@ describe('Datatable component - selection', () => {
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToDatatable();
});
@@ -50,7 +50,7 @@ describe('Datatable component', () => {
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
+6 -14
View File
@@ -17,29 +17,21 @@
import { ApiService, BrowserActions, ErrorPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { ContentServicesPage } from './pages/content-services.page';
describe('Error Component', () => {
const acsUser = new UserModel();
const loginPage = new LoginPage();
const errorPage = new ErrorPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const contentServicesPage = new ContentServicesPage();
const acsUser = new UserModel();
const errorPage = new ErrorPage();
const loginPage = new LoginPage();
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.username, acsUser.password);
});
it('[C277302] Should display the error 403 when access to unauthorized page - My Change', async () => {
+1 -1
View File
@@ -47,7 +47,7 @@ describe('Header Component', () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
beforeEach(async () => {
+1 -1
View File
@@ -32,7 +32,7 @@ describe('Universal Icon component', () => {
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
+2 -2
View File
@@ -62,12 +62,12 @@ describe('Enable infinite scrolling', () => {
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
fileNames = StringUtil.generateFilesNames(1, nrOfFiles, files.base, files.extension);
deleteFileNames = StringUtil.generateFilesNames(1, nrOfDeletedFiles, files.base, files.extension);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(folderModel.name, '-my-');
emptyFolderModel = await uploadActions.createFolder('emptyFolder', '-my-');
+11 -8
View File
@@ -59,24 +59,27 @@ describe('Login component', () => {
await usersActions.createUser(userA);
await usersActions.createUser(userB);
});
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C276746] Should display the right information in user-info when a different users logs in', async () => {
await LocalStorageUtil.setStorageItem('providers', 'ECM');
await loginPage.login(userA.email, userA.password);
await loginPage.login(userA.username, userA.password);
await userInfoPage.clickUserProfile();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(userA.firstName + ' ' + userA.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(userA.email);
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(`${userA.firstName} ${userA.lastName}`);
await loginPage.login(userB.email, userB.password);
await navigationBarPage.clickLogoutButton();
await loginPage.login(userB.username, userB.password);
await userInfoPage.clickUserProfile();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(userB.firstName + ' ' + userB.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(userB.email);
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(`${userB.firstName} ${userB.lastName}`);
});
it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => {
await loginPage.login(userA.email, userA.password);
await loginPage.login(userA.username, userA.password);
await navigationBarPage.navigateToProcessServicesCloudPage();
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
+5 -4
View File
@@ -15,22 +15,23 @@
* limitations under the License.
*/
import { BrowserActions, LoginPage, SettingsPage } from '@alfresco/adf-testing';
import { LoginPage, SettingsPage } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../pages/navigation-bar.page';
describe('Logout component - SSO', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
it('[C280665] Should be possible change the logout redirect URL', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId, '/login');
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId, '#/login');
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]');
await browser.sleep(2000);
await navigationBarPage.clickLogoutButton();
const actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.baseUrl + '/login');
+2 -2
View File
@@ -35,9 +35,9 @@ describe('Notifications Component', () => {
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await notificationPage.goToNotificationsPage();
});
+2 -2
View File
@@ -29,8 +29,8 @@ export class CommentsPage {
commentInput = element(by.id('comment-input'));
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
async getTotalNumberOfComments(): Promise<string> {
return BrowserActions.getText(this.numberOfComments);
async getTotalNumberOfComments(text: string): Promise<void> {
await BrowserVisibility.waitUntilElementHasText(this.numberOfComments, text);
}
async checkUserIconIsDisplayed(): Promise<void> {
+2 -11
View File
@@ -132,15 +132,14 @@ export class ContentServicesPage {
async checkDeleteIsDisabled(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
}
async deleteContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.deleteContentElement);
await this.checkContentIsNotDisplayed(content);
}
async clickDeleteOnToolbar(): Promise<void> {
@@ -153,13 +152,11 @@ export class ContentServicesPage {
async metadataContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.metadataAction);
}
async versionManagerContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.versionManagerAction);
}
@@ -178,13 +175,6 @@ export class ContentServicesPage {
await BrowserActions.click(this.lockContentElement);
}
async waitForContentOptions(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.copyContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.moveContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.deleteContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.downloadContent);
}
async clickFileHyperlink(fileName): Promise<void> {
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
await BrowserActions.click(hyperlink);
@@ -641,6 +631,7 @@ export class ContentServicesPage {
}
async clickShareButton(): Promise<void> {
await browser.sleep(2000);
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.shareNodeButton);
}
+2 -1
View File
@@ -16,7 +16,7 @@
*/
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
import { Locator, element, by } from 'protractor';
import { Locator, element, by, browser } from 'protractor';
export class TrashcanPage {
@@ -49,6 +49,7 @@ export class TrashcanPage {
async clickRestore(): Promise<void> {
await BrowserActions.click(this.restoreButton);
await browser.sleep(2000);
}
async checkRestoreButtonIsNotDisplayed(): Promise<void> {
@@ -77,7 +77,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
fileNames = StringUtil.generateFilesNames(1, nrOfFiles, files.base, files.extension);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(folderModel.name, '-my-');
@@ -93,7 +93,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, lastFolderResponse.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
+1 -1
View File
@@ -38,7 +38,7 @@ describe('User Info - SSO', () => {
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId);
await loginSSOPage.loginSSOIdentityService(identityUser.email, identityUser.password);
await loginSSOPage.loginSSOIdentityService(identityUser.username, identityUser.password);
});
it('[C290066] Should display UserInfo when login using SSO', async () => {
@@ -57,10 +57,10 @@ describe('Viewer', () => {
visibility: 'PUBLIC'
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -76,7 +76,7 @@ describe('Viewer', () => {
beforeAll(async () => {
archiveFolderUploaded = await uploadActions.createFolder(archiveFolderInfo.name, '-my-');
uploadedArchives = await uploadActions.uploadFolder(archiveFolderInfo.location, archiveFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -69,11 +69,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
});
@@ -81,11 +81,10 @@ describe('Viewer', () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.getInstance().core.sitesApi.deleteSite(site.entry.id, { permanent: true });
await navigationBarPage.clickLogoutButton();
});
it('[C272813] Should be redirected to site when opening and closing a file in a site', async () => {
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.goToSite(site);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -95,6 +94,7 @@ describe('Viewer', () => {
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickCloseButton();
await navigationBarPage.clickLogoutButton();
});
describe('Other Folder Uploaded', () => {
@@ -102,11 +102,12 @@ describe('Viewer', () => {
let otherFolderUploaded;
beforeAll(async () => {
await apiService.login(acsUser.username, acsUser.password);
otherFolderUploaded = await uploadActions.createFolder(otherFolderInfo.name, '-my-');
uploadedOthers = await uploadActions.uploadFolder(otherFolderInfo.location, otherFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -56,11 +56,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -77,7 +77,7 @@ describe('Viewer', () => {
uploadedExcels = await uploadActions.uploadFolder(excelFolderInfo.location, excelFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -62,11 +62,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -87,7 +87,7 @@ describe('Viewer', () => {
uploadedImgRenditionFolderInfo = await uploadActions.uploadFolder(imgRenditionFolderInfo.location, imgFolderRenditionUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -58,11 +58,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -79,7 +79,7 @@ describe('Viewer', () => {
uploadedPpt = await uploadActions.uploadFolder(pptFolderInfo.location, pptFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -56,11 +56,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -77,7 +77,7 @@ describe('Viewer', () => {
uploadedTexts = await uploadActions.uploadFolder(textFolderInfo.location, textFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -58,11 +58,11 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
@@ -80,7 +80,7 @@ describe('Viewer', () => {
uploadedWords = await uploadActions.uploadFolder(wordFolderInfo.location, wordFolderUploaded.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -92,7 +92,7 @@ describe('Content Services Viewer', () => {
await usersActions.createUser(acsUser);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
const pdfFileUploaded = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
Object.assign(pdfFile, pdfFileUploaded.entry);
@@ -115,7 +115,7 @@ describe('Content Services Viewer', () => {
const unsupportedFileUploaded = await uploadActions.uploadFile(unsupportedFile.location, unsupportedFile.name, '-my-');
Object.assign(unsupportedFile, unsupportedFileUploaded.entry);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
@@ -51,11 +51,11 @@ describe('Viewer', () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
txtFileUploaded = await uploadActions.uploadFile(txtFileInfo.location, txtFileInfo.name, '-my-');
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
+94 -82
View File
@@ -29,7 +29,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
describe('Viewer - properties', () => {
describe('Viewer', () => {
const acsUser = new UserModel();
const viewerPage = new ViewerPage();
@@ -56,7 +56,7 @@ describe('Viewer - properties', () => {
await usersActions.createUser(acsUser);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
let pngFileUploaded = await uploadActions.uploadFile(pngFile.location, pngFile.name, '-my-');
Object.assign(pngFile, pngFileUploaded.entry);
@@ -64,126 +64,137 @@ describe('Viewer - properties', () => {
pngFileUploaded = await uploadActions.uploadFile(fileForOverlay.location, fileForOverlay.name, '-my-');
Object.assign(fileForOverlay, pngFileUploaded.entry);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await viewerPage.viewFile(pngFile.name);
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
});
});
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pngFile.getId());
await navigationBarPage.clickLogoutButton();
});
it('[C260066] Should Show/Hide viewer toolbar when showToolbar is true/false', async () => {
await viewerPage.checkToolbarIsDisplayed();
await viewerPage.disableToolbar();
await viewerPage.checkToolbarIsNotDisplayed();
await viewerPage.enableToolbar();
});
it('[C260076] Should Show/Hide back button when allowGoBack is true/false', async () => {
await viewerPage.checkGoBackIsDisplayed();
await viewerPage.disableGoBack();
await viewerPage.checkGoBackIsNotDisplayed();
await viewerPage.enableGoBack();
});
describe('properties', () => {
it('[C260077] Should Show toolbar options dropdown when adf-viewer-open-with directive is used', async () => {
await viewerPage.checkToolbarOptionsIsNotDisplayed();
await viewerPage.enableToolbarOptions();
await viewerPage.checkToolbarOptionsIsDisplayed();
await viewerPage.disableToolbarOptions();
});
beforeAll(async () => {
await viewerPage.viewFile(pngFile.name);
it('[C260079] Should Show/Hide download button when allowDownload is true/false', async () => {
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.disableDownload();
await viewerPage.checkDownloadButtonIsNotDisplayed();
await viewerPage.enableDownload();
});
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
});
it('[C260082] Should Show/Hide print button when allowPrint is true/false', async () => {
await viewerPage.checkPrintButtonIsDisplayed();
await viewerPage.disablePrint();
await viewerPage.checkPrintButtonIsNotDisplayed();
await viewerPage.enablePrint();
});
afterAll(async () => {
await viewerPage.clickCloseButton();
});
it('[C260092] Should show adf-viewer-toolbar-actions directive buttons when adf-viewer-toolbar-actions is used', async () => {
await viewerPage.checkMoreActionsDisplayed();
it('[C260066] Should Show/Hide viewer toolbar when showToolbar is true/false', async () => {
await viewerPage.checkToolbarIsDisplayed();
await viewerPage.disableToolbar();
await viewerPage.checkToolbarIsNotDisplayed();
await viewerPage.enableToolbar();
});
await viewerPage.disableMoreActions();
it('[C260076] Should Show/Hide back button when allowGoBack is true/false', async () => {
await viewerPage.checkGoBackIsDisplayed();
await viewerPage.disableGoBack();
await viewerPage.checkGoBackIsNotDisplayed();
await viewerPage.enableGoBack();
});
await viewerPage.checkMoreActionsIsNotDisplayed();
it('[C260077] Should Show toolbar options dropdown when adf-viewer-open-with directive is used', async () => {
await viewerPage.checkToolbarOptionsIsNotDisplayed();
await viewerPage.enableToolbarOptions();
await viewerPage.checkToolbarOptionsIsDisplayed();
await viewerPage.disableToolbarOptions();
});
await viewerPage.enableMoreActions();
});
it('[C260079] Should Show/Hide download button when allowDownload is true/false', async () => {
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.disableDownload();
await viewerPage.checkDownloadButtonIsNotDisplayed();
await viewerPage.enableDownload();
});
it('[C260074] Should show a custom file name when displayName property is used', async () => {
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
it('[C260082] Should Show/Hide print button when allowPrint is true/false', async () => {
await viewerPage.checkPrintButtonIsDisplayed();
await viewerPage.disablePrint();
await viewerPage.checkPrintButtonIsNotDisplayed();
await viewerPage.enablePrint();
});
await viewerPage.enableCustomName();
it('[C260092] Should show adf-viewer-toolbar-actions directive buttons when adf-viewer-toolbar-actions is used', async () => {
await viewerPage.checkMoreActionsDisplayed();
await viewerPage.enterCustomName('test custom title');
await viewerPage.checkFileNameIsDisplayed('test custom title');
await viewerPage.disableMoreActions();
await viewerPage.disableCustomName();
});
await viewerPage.checkMoreActionsIsNotDisplayed();
it('[C260090] Should showSidebar allow right info-drawer to be shown', async () => {
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.enableMoreActions();
});
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
it('[C260074] Should show a custom file name when displayName property is used', async () => {
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
it('[C286442] Should showLeftSidebar allow left info-drawer to be shown', async () => {
await viewerPage.clickToggleLeftSidebar();
await viewerPage.checkLeftSideBarIsNotDisplayed();
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
});
await viewerPage.enableCustomName();
it('[C260089] Should Show/Hide info-drawer if allowSidebar true/false', async () => {
await viewerPage.clickInfoButton();
await viewerPage.enterCustomName('test custom title');
await viewerPage.checkFileNameIsDisplayed('test custom title');
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.disableCustomName();
});
await viewerPage.disableAllowSidebar();
it('[C260090] Should showSidebar allow right info-drawer to be shown', async () => {
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.checkInfoButtonIsNotDisplayed();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
it('[C286596] Should Show/Hide left info-drawer if allowLeftSidebar true/false', async () => {
await viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.checkLeftSideBarButtonIsDisplayed();
it('[C286442] Should showLeftSidebar allow left info-drawer to be shown', async () => {
await viewerPage.clickToggleLeftSidebar();
await viewerPage.checkLeftSideBarIsNotDisplayed();
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
});
await viewerPage.disableAllowLeftSidebar();
it('[C260089] Should Show/Hide info-drawer if allowSidebar true/false', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.disableAllowSidebar();
await viewerPage.checkInfoButtonIsNotDisplayed();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
it('[C286596] Should Show/Hide left info-drawer if allowLeftSidebar true/false', async () => {
await viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.checkLeftSideBarButtonIsDisplayed();
await viewerPage.disableAllowLeftSidebar();
await viewerPage.checkLeftSideBarButtonIsNotDisplayed();
await viewerPage.checkLeftSideBarIsNotDisplayed();
});
await viewerPage.checkLeftSideBarButtonIsNotDisplayed();
await viewerPage.checkLeftSideBarIsNotDisplayed();
});
it('[C260100] Should be possible to disable Overlay viewer', async () => {
await viewerPage.clickCloseButton();
await navigationBarPage.clickOverlayViewerButton();
await dataTable.doubleClickRow('Name', fileForOverlay.name);
await viewerPage.checkOverlayViewerIsDisplayed();
await viewerPage.clickCloseButton();
await dataTable.doubleClickRow('Name', pngFile.name);
await viewerPage.checkOverlayViewerIsDisplayed();
await viewerPage.clickCloseButton();
await viewerPage.disableOverlay();
await dataTable.doubleClickRow('Name', fileForOverlay.name);
await viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkInlineViewerIsDisplayed();
@@ -191,4 +202,5 @@ describe('Viewer - properties', () => {
await viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkInlineViewerIsDisplayed();
});
});
})
;
+5 -5
View File
@@ -71,15 +71,15 @@ describe('Viewer', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
wordFileUploaded = await uploadActions.uploadFile(wordFileInfo.location, wordFileInfo.name, '-my-');
@@ -88,12 +88,12 @@ describe('Viewer', () => {
afterAll(async () => {
await apiService.getInstance().core.sitesApi.deleteSite(site.entry.id, { permanent: true });
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
await uploadActions.deleteFileOrFolder(wordFileUploaded.entry.id);
});
beforeEach(async () => {
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
it('[C260105] Should be able to open an image file shared via API', async () => {