mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3442] create library dialog (#4018)
* library dialog * integrate with demo shell * update resources * fix license * auto focus for the first input * update e2e tests * try close the dialog between tests * fix afterEach * Revert "try close the dialog between tests" This reverts commit 63464f2b03c226c606d09b18c7d2782e3bb52c0a. * update code due to css lint issues * csslint settings for vs code * missing import lint fix remove not used import convert errorPage js to ts convert tasklistpage js to ts fix redirection creation folder in root fix lint issue fix e2e * e2e fix * fix PS tests * navigation import * fix tests tooltip convert paginapage to ts * fix lint * fix lock files e2e filterspage to ts * fix lint * fix cs cre git dept 3 and not 50 as default in travis * quiet log git download * add some delay and change the delete lock * fix node entry * convert searchDialog to typescript parallel protractor * disable browser execute * restote test * change search tests * move search in a separate e2e folder * experiment fix e2e * change util presence change protractor conf * fix unshare test * improve query viewerPage using css over xpath * waitForAngularEnabled before browser redirect * convert util to ts and more * convert other files to ts * convert to ts other files * trigger build * function fixes use arrow function * process service fixes * lint fix review timeout default * fix failing tests * restore timeout * share dialog fix * remove * use configuration admin * fix APS 2 login sso
This commit is contained in:
committed by
Eugenio Romano
parent
9fd564a78e
commit
058d23d57f
1
e2e/Util.kt
Normal file
1
e2e/Util.kt
Normal file
@@ -0,0 +1 @@
|
||||
var Util = require('../../util/util');var Util = require('../../util/util');
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
import User = require('../models/APS/User');
|
||||
import { Tenant } from '../models/APS/Tenant';
|
||||
import { User } from '../models/APS/User';
|
||||
import TestConfig = require('../test.config');
|
||||
import path = require('path');
|
||||
import fs = require('fs');
|
||||
|
@@ -20,8 +20,8 @@ import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { CommentsPage } from '../../pages/adf/commentsPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
@@ -17,18 +17,15 @@
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import CreateFolderDialog = require('../../pages/adf/dialog/createFolderDialog');
|
||||
import { CreateFolderDialog } from '../../pages/adf/dialog/createFolderDialog';
|
||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||
import MetadataViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { browser, Key } from 'protractor';
|
||||
|
||||
describe('Create folder directive', function () {
|
||||
|
||||
@@ -58,8 +55,14 @@ describe('Create folder directive', function () {
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260154] Should not create the folder if cancel button is clicked', () => {
|
||||
@@ -125,13 +128,24 @@ describe('Create folder directive', function () {
|
||||
});
|
||||
|
||||
it('[C260159] Should not be possible create a folder with banned character', () => {
|
||||
let bannedChar = ['* ', '<', '>', '\\', '/', '?', ':', '|'];
|
||||
|
||||
browser.refresh();
|
||||
contentServicesPage.clickOnCreateNewFolder();
|
||||
|
||||
bannedChar.forEach((currentChar) => {
|
||||
createFolderDialog.addFolderName(currentChar);
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
});
|
||||
createFolderDialog.addFolderName('*');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('<');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('>');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('\\');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('/');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('?');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName(':');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
createFolderDialog.addFolderName('|');
|
||||
createFolderDialog.checkCreateBtnIsDisabled();
|
||||
});
|
||||
});
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import Util = require('../../util/util');
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
describe('Document List Component - Actions', () => {
|
||||
|
||||
|
@@ -19,14 +19,14 @@ import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import ErrorPage = require('../../pages/adf/errorPage');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { ErrorPage } from '../../pages/adf/errorPage';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import moment from 'moment-es6';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
@@ -75,7 +75,7 @@ describe('Document List Component', () => {
|
||||
acsUser = new AcsUserModel();
|
||||
let siteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`;
|
||||
let folderName = `MEESEEKS_${Util.generateRandomString(5)}`;
|
||||
let privateSiteBody = { visibility: 'PRIVATE' , title: siteName};
|
||||
let privateSiteBody = { visibility: 'PRIVATE', title: siteName };
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('Document List Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async(done) => {
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
|
||||
done();
|
||||
});
|
||||
@@ -303,7 +303,7 @@ describe('Document List Component', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260121] Should show the spinner on content loading', async (done) => {
|
||||
xit('[C260121] Should show the spinner on content loading', async (done) => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
@@ -511,17 +511,17 @@ describe('Document List Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach( () => {
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
it('[C260108] Should display tooltip for file\'s name', () => {
|
||||
expect(contentServicesPage.getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
||||
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
||||
});
|
||||
|
||||
it('[C260109] Should display tooltip for folder\'s name', () => {
|
||||
expect(contentServicesPage.getTooltip(folderName)).toEqual(folderName);
|
||||
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
|
||||
});
|
||||
|
||||
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
|
||||
@@ -560,7 +560,7 @@ describe('Document List Component', () => {
|
||||
describe('Gallery View', () => {
|
||||
|
||||
let cardProperties = {
|
||||
DISPLAY_NAME : 'Display name',
|
||||
DISPLAY_NAME: 'Display name',
|
||||
SIZE: 'Size',
|
||||
LOCK: 'Lock',
|
||||
CREATED_BY: 'Created by',
|
||||
@@ -600,7 +600,7 @@ describe('Document List Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach( () => {
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.clickGridViewButton();
|
||||
|
@@ -17,14 +17,14 @@
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import PaginationPage = require('../../pages/adf/paginationPage');
|
||||
import { PaginationPage } from '../../pages/adf/paginationPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
@@ -16,28 +16,29 @@
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../pages/adf/NavigationBarPage';
|
||||
import ContentList = require('../pages/adf/dialog/contentList');
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { ContentListPage } from '../pages/adf/dialog/contentListPage';
|
||||
|
||||
import { LockFilePage } from '../pages/adf/lockFilePage';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import Util = require('../util/util');
|
||||
import { Util } from '../util/util';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Lock File', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentList = new ContentList();
|
||||
const contentList = new ContentListPage();
|
||||
const lockFilePage = new LockFilePage();
|
||||
|
||||
let adminUser = new AcsUserModel();
|
||||
@@ -128,7 +129,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286604] Should be able to open Lock file option by clicking the lock image', () => {
|
||||
contentList.clickContentLockIcon(pngFileModel.name);
|
||||
contentList.lockContent(pngFileModel.name);
|
||||
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.checkCancelButtonIsDisplayed();
|
||||
@@ -136,7 +137,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286625] Should be able to click Cancel to cancel lock file operation', () => {
|
||||
contentList.clickContentLockIcon(pngFileModel.name);
|
||||
contentList.lockContent(pngFileModel.name);
|
||||
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickCancelButton();
|
||||
@@ -145,7 +146,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286603] Should be able to click on Lock file checkbox and lock a file', () => {
|
||||
contentList.clickContentLockIcon(pngFileToLock.name);
|
||||
contentList.lockContent(pngFileToLock.name);
|
||||
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
@@ -155,14 +156,14 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', () => {
|
||||
contentList.clickContentLockIcon(pngFileModel.name);
|
||||
contentList.lockContent(pngFileModel.name);
|
||||
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
contentList.checkLockedIcon(pngFileModel.name);
|
||||
contentList.clickContentLockIcon(pngFileModel.name);
|
||||
contentList.lockContent(pngFileModel.name);
|
||||
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
@@ -197,7 +198,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286610] Should not be able to delete a locked file', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -213,7 +214,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286611] Should not be able to rename a locked file', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -229,7 +230,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286612] Should not be able to move a locked file', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -244,7 +245,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286613] Should not be able to update a new version on a locked file', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -262,8 +263,10 @@ describe('Lock File', () => {
|
||||
|
||||
describe('Locked file with owner permissions', () => {
|
||||
|
||||
let pngFileToBeLocked;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||
pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||
|
||||
lockedFileNodeId = pngFileToBeLocked.entry.id;
|
||||
|
||||
@@ -291,8 +294,8 @@ describe('Lock File', () => {
|
||||
|
||||
});
|
||||
|
||||
it('[C286614] Owner of the locked file should be able to rename if "Allow owner to modify" is checked', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => {
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -304,8 +307,8 @@ describe('Lock File', () => {
|
||||
expect(response.entry.name).toEqual('My new name');
|
||||
});
|
||||
|
||||
it('[C286615] Owner of the locked file should be able to update a new version if "Allow owner to modify" is checked', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => {
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -317,8 +320,8 @@ describe('Lock File', () => {
|
||||
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
|
||||
});
|
||||
|
||||
it('[C286616] Owner of the locked file should be able to move if "Allow owner to modify" is checked', async () => {
|
||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
||||
it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => {
|
||||
await contentList.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
@@ -333,29 +336,21 @@ describe('Lock File', () => {
|
||||
|
||||
});
|
||||
|
||||
it('[C286617] Owner of the locked file should be able to delete if "Allow owner to modify" is checked', async () => {
|
||||
|
||||
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
await contentList.clickContentLockIcon(pngFileToLock.name);
|
||||
contentList.lockContent(pngFileToLock.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickAllowOwnerCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickAllowOwnerCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
await this.alfrescoJsApi.core.nodesApi.deleteNode(lockedFileNodeId);
|
||||
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.getNode(lockedFileNodeId);
|
||||
|
||||
} catch (error) {
|
||||
expect(error.status).toEqual(404);
|
||||
}
|
||||
contentList.deleteContent(pngFileToBeLocked.entry.name);
|
||||
contentList.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../test.config');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { NotificationPage } from '../pages/adf/notificationPage';
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { PermissionsPage } from '../pages/adf/permissionsPage';
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import ContentListPage = require('../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../pages/adf/dialog/contentListPage';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import Util = require('../util/util');
|
||||
import { Util } from '../util/util';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Permissions Component', function () {
|
||||
|
@@ -17,13 +17,13 @@
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -81,8 +81,8 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
describe('Shared link dialog', () => {
|
||||
afterEach(async (done) => {
|
||||
await browser.refresh();
|
||||
afterEach( (done) => {
|
||||
browser.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -141,9 +141,9 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
describe('Shared link preview', () => {
|
||||
afterEach(async (done) => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await contentServicesPage.navigateToDocumentList();
|
||||
afterEach( (done) => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
done();
|
||||
});
|
||||
|
||||
|
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import ErrorPage = require('../../pages/adf/errorPage');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { ErrorPage } from '../../pages/adf/errorPage';
|
||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
@@ -51,7 +51,7 @@ describe('Unshare file', () => {
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async(done) => {
|
||||
beforeAll(async (done) => {
|
||||
const site = {
|
||||
title: siteName,
|
||||
visibility: 'PRIVATE',
|
||||
@@ -142,10 +142,10 @@ describe('Unshare file', () => {
|
||||
shareDialog.clickUnShareFile();
|
||||
shareDialog.confirmationDialogIsDisplayed();
|
||||
shareDialog.clickConfirmationDialogRemoveButton();
|
||||
shareDialog.shareToggleButtonIsChecked();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C280556] Should redirect to 404 when trying to access an unshared file', async() => {
|
||||
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { TagPage } from '../pages/adf/tagPage';
|
||||
@@ -28,7 +28,7 @@ import resources = require('../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
||||
import Util = require('../util/util');
|
||||
import { Util } from '../util/util';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Tag component', () => {
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { TrashcanPage } from '../pages/adf/trashcanPage';
|
||||
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
import { PaginationPage } from '../pages/adf/paginationPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FolderModel = require('../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FolderModel } from '../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import Util = require('../util/util');
|
||||
import { Util } from '../util/util';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
@@ -19,7 +19,7 @@ import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { TreeViewPage } from '../pages/adf/content_services/treeViewPage';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
|
||||
|
@@ -19,13 +19,13 @@ import { element, by, browser } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
@@ -19,12 +19,12 @@ import { element, by, browser } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
@@ -17,18 +17,18 @@
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
@@ -19,18 +19,18 @@ import { by, element } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import path = require('path');
|
||||
|
||||
describe('Version component actions', () => {
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -34,7 +34,7 @@ import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { NodeActions } from '../../actions/ACS/node.actions';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Version component permissions', () => {
|
||||
|
@@ -19,18 +19,18 @@ import { by, element } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
describe('Version Properties', () => {
|
||||
|
||||
|
@@ -19,18 +19,18 @@ import { browser } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
describe('Version component', () => {
|
||||
|
||||
|
@@ -19,12 +19,12 @@ import { browser } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -37,7 +37,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const configEditorPage = new ConfigEditorPage();
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
@@ -71,13 +71,13 @@ describe('Aspect oriented config', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async(done) => {
|
||||
beforeEach(async (done) => {
|
||||
navigationBarPage.clickConfigEditorButton();
|
||||
configEditorPage.clickClearButton();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async(done) => {
|
||||
afterEach(async (done) => {
|
||||
viewerPage.clickCloseButton();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
browser.refresh();
|
||||
@@ -96,7 +96,8 @@ describe('Aspect oriented config', () => {
|
||||
' }' +
|
||||
' ]' +
|
||||
' }]' +
|
||||
' }');
|
||||
' }' +
|
||||
' }');
|
||||
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
@@ -148,7 +149,7 @@ describe('Aspect oriented config', () => {
|
||||
metadataViewPage.checkMetadataGroupIsNotPresent('exists');
|
||||
});
|
||||
|
||||
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided' , () => {
|
||||
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided', () => {
|
||||
|
||||
configEditorPage.enterConfiguration('{ }');
|
||||
|
||||
@@ -172,7 +173,7 @@ describe('Aspect oriented config', () => {
|
||||
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
||||
});
|
||||
|
||||
it('[C260182] Should show all the aspects if the default configuration contains the star symbol' , () => {
|
||||
it('[C260182] Should show all the aspects if the default configuration contains the star symbol', () => {
|
||||
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
@@ -201,7 +202,7 @@ describe('Aspect oriented config', () => {
|
||||
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
||||
});
|
||||
|
||||
it('[C268899] Should be possible use a Translation key as Title of a metadata group' , () => {
|
||||
it('[C268899] Should be possible use a Translation key as Title of a metadata group', () => {
|
||||
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
@@ -251,7 +252,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
});
|
||||
|
||||
it('[C279968] Should be possible use a custom preset' , () => {
|
||||
it('[C279968] Should be possible use a custom preset', () => {
|
||||
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
|
@@ -19,22 +19,21 @@ import { element, by } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import CardViewPageComponent = require('../../pages/adf/cardViewPageComponent');
|
||||
import Util = require('../../util/util');
|
||||
import { CardViewComponentPage } from '../../pages/adf/cardViewComponentPage';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
describe('CardView Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const cardViewPageComponent = new CardViewPageComponent();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const cardViewPageComponent = new CardViewComponentPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
|
||||
const app = resources.Files.APP_WITH_PROCESSES;
|
||||
|
||||
@@ -69,7 +68,7 @@ describe('CardView Component', () => {
|
||||
describe('key-value pair ', () => {
|
||||
|
||||
it('[C279938] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -91,7 +90,7 @@ describe('CardView Component', () => {
|
||||
describe('SelectBox', () => {
|
||||
|
||||
it('[C279939] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-select-label-select"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-select-label-select"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -108,7 +107,7 @@ describe('CardView Component', () => {
|
||||
describe('Text', () => {
|
||||
|
||||
it('[C279937] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-name"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-textitem-label-name"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -139,7 +138,7 @@ describe('CardView Component', () => {
|
||||
describe('Int', () => {
|
||||
|
||||
it('[C279940] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-int"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -213,7 +212,7 @@ describe('CardView Component', () => {
|
||||
describe('Float', () => {
|
||||
|
||||
it('[C279941] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-float"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -263,7 +262,7 @@ describe('CardView Component', () => {
|
||||
describe('Boolean', () => {
|
||||
|
||||
it('[C279942] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-boolean-label-boolean"]'));
|
||||
let label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
});
|
||||
@@ -282,11 +281,11 @@ describe('CardView Component', () => {
|
||||
describe('Date and DateTime', () => {
|
||||
|
||||
it('[C279961] Should the label be present', () => {
|
||||
let labelDate = element(by.xpath('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
let labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(labelDate);
|
||||
|
||||
let labelDatetime = element(by.xpath('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
let labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(labelDatetime);
|
||||
});
|
||||
@@ -301,11 +300,11 @@ describe('CardView Component', () => {
|
||||
it('[C279936] Should not be possible edit any parameter when editable property is false', () => {
|
||||
cardViewPageComponent.disableEdit();
|
||||
|
||||
let editIconText = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
|
||||
let editIconInt = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
|
||||
let editIconFloat = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-float"]'));
|
||||
let editIconKey = element(by.xpath('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
||||
let editIconData = element(by.xpath('mat-datetimepicker-toggle'));
|
||||
let editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
|
||||
let editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
|
||||
let editIconFloat = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-float"]'));
|
||||
let editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
||||
let editIconData = element(by.css('mat-datetimepicker-toggle'));
|
||||
|
||||
Util.waitUntilElementIsNotVisible(editIconText);
|
||||
Util.waitUntilElementIsNotVisible(editIconInt);
|
||||
|
@@ -17,11 +17,11 @@
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -29,7 +29,7 @@ import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('permissions', () => {
|
||||
@@ -49,7 +49,7 @@ describe('permissions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let consumerUser = new AcsUserModel();
|
||||
|
@@ -18,10 +18,10 @@
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -47,7 +47,7 @@ describe('CardView Component - properties', () => {
|
||||
let loginPage = new LoginPage();
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
let viewerPage = new ViewerPage();
|
||||
let metadataViewPage = new CardViewPage();
|
||||
let metadataViewPage = new MetadataViewPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
||||
|
@@ -20,11 +20,11 @@ import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
@@ -51,7 +51,7 @@ describe('Metadata component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
@@ -16,17 +16,19 @@
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
||||
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Datatable component - selection', () => {
|
||||
|
||||
let dataTablePage = new DataTablePage();
|
||||
let loginPage = new LoginPage();
|
||||
let acsUser = new AcsUserModel();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
@@ -40,7 +42,7 @@ describe('Datatable component - selection', () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
dataTablePage.goToDatatable();
|
||||
navigationBarPage.navigateToDatatable();
|
||||
|
||||
done();
|
||||
});
|
||||
|
@@ -16,17 +16,19 @@
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Datatable component', () => {
|
||||
|
||||
let dataTablePage = new DataTablePage();
|
||||
let loginPage = new LoginPage();
|
||||
let acsUser = new AcsUserModel();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
@@ -40,7 +42,7 @@ describe('Datatable component', () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
dataTablePage.goToDatatable();
|
||||
navigationBarPage.navigateToDatatable();
|
||||
|
||||
done();
|
||||
});
|
||||
|
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../test.config');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import ErrorPage = require('../pages/adf/errorPage');
|
||||
import { ErrorPage } from '../pages/adf/errorPage';
|
||||
import { browser } from '../../node_modules/protractor';
|
||||
|
||||
describe('Error Component', () => {
|
||||
|
@@ -18,11 +18,11 @@
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FolderModel = require('../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FolderModel } from '../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import Util = require('../util/util');
|
||||
import { Util } from '../util/util';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginAPSPage } from '../../../pages/adf/loginApsPage';
|
||||
import { LoginSSOPage } from '../../../pages/adf/loginSSOPage';
|
||||
import { SettingsPage } from '../../../pages/adf/settingsPage';
|
||||
import TestConfig = require('../../../test.config');
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../../pages/adf/NavigationBarPage';
|
||||
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Login component - SSO', () => {
|
||||
|
||||
const settingsPage = new SettingsPage();
|
||||
const loginApsPage = new LoginAPSPage();
|
||||
const loginApsPage = new LoginSSOPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const path = '/auth/realms/springboot';
|
||||
let silentLogin;
|
||||
@@ -33,19 +33,17 @@ describe('Login component - SSO', () => {
|
||||
navigationBarPage.clickLogoutButton();
|
||||
browser.executeScript('window.sessionStorage.clear();');
|
||||
browser.executeScript('window.localStorage.clear();');
|
||||
});
|
||||
|
||||
it('[C261050] Should be possible login in the PS with SSO', async () => {
|
||||
silentLogin = false;
|
||||
await settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path, silentLogin);
|
||||
await loginApsPage.clickOnSSOButton();
|
||||
browser.ignoreSynchronization = true;
|
||||
await loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
|
||||
it ('[C280667] Should be redirect directly to keycloak without show the login page with silent login', async () => {
|
||||
await settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path);
|
||||
browser.ignoreSynchronization = true;
|
||||
await loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
it('[C261050] Should be possible login in the PS with SSO', () => {
|
||||
silentLogin = false;
|
||||
settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path, silentLogin);
|
||||
loginApsPage.clickOnSSOButton();
|
||||
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
|
||||
it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => {
|
||||
settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path);
|
||||
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
});
|
||||
|
@@ -25,12 +25,12 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { UserInfoDialog } from '../../pages/adf/dialog/userInfoDialog';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import { SettingsPage } from '../../pages/adf/settingsPage';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
describe('Login component', () => {
|
||||
|
||||
@@ -234,7 +234,6 @@ describe('Login component', () => {
|
||||
|
||||
browser.getAllWindowHandles().then((handles) => {
|
||||
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.switchTo().window(handles[1]).then(() => {
|
||||
browser.get(TestConfig.adf.url + '/activiti');
|
||||
processServicesPage.checkApsContainer();
|
||||
|
@@ -23,13 +23,13 @@ import { ProcessServicesPage } from '../../pages/adf/process_services/processSer
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import { SettingsPage } from '../../pages/adf/settingsPage';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
describe('Login component - Redirect', () => {
|
||||
@@ -40,14 +40,17 @@ describe('Login component - Redirect', () => {
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
let loginPage = new LoginPage();
|
||||
let user = new AcsUserModel();
|
||||
let userFolderOwner = new AcsUserModel();
|
||||
let adminUserModel = new AcsUserModel({
|
||||
'id': TestConfig.adf.adminUser,
|
||||
'password': TestConfig.adf.adminPassword
|
||||
});
|
||||
let uploadedFolder;
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ALL',
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url,
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
@@ -55,6 +58,11 @@ describe('Login component - Redirect', () => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(user);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(userFolderOwner);
|
||||
|
||||
await this.alfrescoJsApi.login(user.id, user.password);
|
||||
|
||||
uploadedFolder = await uploadActions.uploadFolder(this.alfrescoJsApi, 'protecteFolder' + Util.generateRandomString(), '-my-');
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -100,16 +108,10 @@ describe('Login component - Redirect', () => {
|
||||
});
|
||||
|
||||
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', () => {
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
let uploadedFolder;
|
||||
let folderName = Util.generateRandomString();
|
||||
|
||||
settingsPage.setProviderEcm();
|
||||
loginPage.login(user.id, user.password);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
uploadedFolder = await uploadActions.uploadFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
|
||||
|
@@ -17,13 +17,13 @@
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
import { PaginationPage } from '../pages/adf/paginationPage';
|
||||
import { Util } from '../util/util';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FolderModel = require('../models/ACS/folderModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FolderModel } from '../models/ACS/folderModel';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
@@ -20,8 +20,8 @@ import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { UserInfoDialog } from '../pages/adf/dialog/userInfoDialog';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
|
||||
import PeopleAPI = require('../restAPI/ACS/PeopleAPI');
|
||||
|
||||
|
@@ -21,16 +21,16 @@ import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||
|
||||
import resources = require('../../util/resources');
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
@@ -25,8 +25,8 @@ import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
@@ -23,8 +23,8 @@ import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
@@ -21,12 +21,12 @@ import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
||||
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
@@ -17,12 +17,12 @@
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import AnalyticsPage = require('../pages/adf/process_services/analyticsPage');
|
||||
import { AnalyticsPage } from '../pages/adf/process_services/analyticsPage';
|
||||
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
|
||||
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
|
||||
import TestConfig = require('../test.config');
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
import User = require('../models/APS/User');
|
||||
import { Tenant } from '../models/APS/Tenant';
|
||||
import { User } from '../models/APS/User';
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
|
@@ -15,42 +15,43 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
var AcsUserModel = function (details) {
|
||||
export class AcsUserModel {
|
||||
|
||||
this.firstName = Util.generateRandomString();
|
||||
this.lastName = Util.generateRandomString();
|
||||
this.password = Util.generateRandomString();
|
||||
this.email = Util.generateRandomString();
|
||||
this.id = Util.generateRandomString();
|
||||
this.jobTitle = "N/A";
|
||||
firstName = Util.generateRandomString();
|
||||
lastName = Util.generateRandomString();
|
||||
password = Util.generateRandomString();
|
||||
email = Util.generateRandomString();
|
||||
id = Util.generateRandomString();
|
||||
jobTitle = 'N/A';
|
||||
|
||||
this.getFirstName = function () {
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
getFirstName = function () {
|
||||
return this.firstName;
|
||||
};
|
||||
|
||||
this.getLastName = function () {
|
||||
getLastName = function () {
|
||||
return this.lastName;
|
||||
};
|
||||
|
||||
this.getPassword = function () {
|
||||
getPassword = function () {
|
||||
return this.password;
|
||||
};
|
||||
|
||||
this.getEmail = function () {
|
||||
getEmail = function () {
|
||||
return this.email;
|
||||
};
|
||||
|
||||
this.getId = function () {
|
||||
getId = function () {
|
||||
return this.id;
|
||||
};
|
||||
|
||||
this.getJobTitle = function () {
|
||||
getJobTitle = function () {
|
||||
return this.jobTitle;
|
||||
};
|
||||
|
||||
Object.assign(this, details);
|
||||
|
||||
};
|
||||
module.exports = AcsUserModel;
|
||||
}
|
@@ -15,22 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
var AcsUserModel = function (details) {
|
||||
export class CreatedByModel {
|
||||
displayName = Util.generateRandomString();
|
||||
id = Util.generateRandomString();
|
||||
|
||||
this.displayName = Util.generateRandomString();
|
||||
this.id = Util.generateRandomString();
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
this.getId = function () {
|
||||
getId() {
|
||||
return this.id;
|
||||
};
|
||||
}
|
||||
|
||||
this.getDisplayName = function () {
|
||||
getDisplayName() {
|
||||
return this.displayName;
|
||||
};
|
||||
}
|
||||
|
||||
Object.assign(this, details);
|
||||
|
||||
};
|
||||
module.exports = AcsUserModel;
|
||||
}
|
@@ -1,116 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
var resources = require('../../util/resources');
|
||||
var CreatedByModel = require('./createdByModel');
|
||||
var ContentModel = require('./contentModel');
|
||||
var ContentPropertiesModel = require('./contentProperties');
|
||||
|
||||
var FileModel = function (details) {
|
||||
|
||||
this.id = Util.generateRandomString();
|
||||
this.name = Util.generateRandomString();
|
||||
this.shortName = this.name;
|
||||
this.location = resources.Files.ADF_DOCUMENTS.PDF.file_location;
|
||||
this.tooltip = this.name;
|
||||
this.version = "";
|
||||
this.firstPageText = resources.Files.ADF_DOCUMENTS.PDF.first_page_text;
|
||||
this.lastPageText = resources.Files.ADF_DOCUMENTS.PDF.last_page_text;
|
||||
this.secondPageText = resources.Files.ADF_DOCUMENTS.PDF.second_page_text;
|
||||
this.lastPageNumber = resources.Files.ADF_DOCUMENTS.PDF.last_page_number;
|
||||
this.createdAt = "";
|
||||
this.createdByUser = {};
|
||||
this.modifiedByUser = {};
|
||||
this.content = {};
|
||||
this.properties = {};
|
||||
|
||||
this.getName = function () {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
this.setVersion = function (ver) {
|
||||
this.version = "-" + ver;
|
||||
};
|
||||
|
||||
this.getVersionName = function () {
|
||||
var extension = this.name.split(".")[1];
|
||||
var name = this.name.split(".")[0];
|
||||
return name + this.version + "." + extension;
|
||||
};
|
||||
|
||||
this.getShortName = function () {
|
||||
return this.shortName;
|
||||
};
|
||||
|
||||
this.getLocation = function () {
|
||||
return this.location;
|
||||
};
|
||||
|
||||
this.getTooltip = function () {
|
||||
return this.tooltip;
|
||||
};
|
||||
|
||||
this.getId = function () {
|
||||
return this.id;
|
||||
};
|
||||
|
||||
this.getFirstPageText = function () {
|
||||
return this.firstPageText;
|
||||
};
|
||||
|
||||
this.getLastPageText = function () {
|
||||
return this.lastPageText;
|
||||
};
|
||||
|
||||
this.getSecondPageText = function () {
|
||||
return this.secondPageText;
|
||||
};
|
||||
|
||||
this.getLastPageNumber = function () {
|
||||
return this.lastPageNumber;
|
||||
};
|
||||
|
||||
this.getCreatedByUser = function () {
|
||||
return this.createdByUser;
|
||||
};
|
||||
|
||||
this.getModifiedByUser = function () {
|
||||
return this.modifiedByUser;
|
||||
};
|
||||
|
||||
this.getContent = function () {
|
||||
return this.content;
|
||||
};
|
||||
|
||||
this.getProperties = function () {
|
||||
return this.properties;
|
||||
};
|
||||
|
||||
this.update = function(details) {
|
||||
Object.assign(this, {
|
||||
createdByUser: new CreatedByModel(details.createdByUser),
|
||||
modifiedByUser: new CreatedByModel(details.modifiedByUser),
|
||||
content: new ContentModel(details.content),
|
||||
properties: new ContentPropertiesModel(details.properties)
|
||||
})
|
||||
}
|
||||
|
||||
Object.assign(this, details);
|
||||
|
||||
};
|
||||
module.exports = FileModel;
|
116
e2e/models/ACS/fileModel.ts
Normal file
116
e2e/models/ACS/fileModel.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import resources = require('../../util/resources');
|
||||
import ContentModel = require('./contentModel');
|
||||
import ContentPropertiesModel = require('./contentProperties');
|
||||
import { CreatedByModel } from './createdByModel';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
export class FileModel {
|
||||
|
||||
id = Util.generateRandomString();
|
||||
name = Util.generateRandomString();
|
||||
shortName = this.name;
|
||||
location = resources.Files.ADF_DOCUMENTS.PDF.file_location;
|
||||
tooltip = this.name;
|
||||
version = '';
|
||||
firstPageText = resources.Files.ADF_DOCUMENTS.PDF.first_page_text;
|
||||
lastPageText = resources.Files.ADF_DOCUMENTS.PDF.last_page_text;
|
||||
secondPageText = resources.Files.ADF_DOCUMENTS.PDF.second_page_text;
|
||||
lastPageNumber = resources.Files.ADF_DOCUMENTS.PDF.last_page_number;
|
||||
createdAt = '';
|
||||
createdByUser = {};
|
||||
modifiedByUser = {};
|
||||
content = {};
|
||||
properties = {};
|
||||
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
setVersion(ver) {
|
||||
this.version = '-' + ver;
|
||||
}
|
||||
|
||||
getVersionName() {
|
||||
let extension = this.name.split('.')[1];
|
||||
let name = this.name.split('.')[0];
|
||||
return name + this.version + '.' + extension;
|
||||
}
|
||||
|
||||
getShortName() {
|
||||
return this.shortName;
|
||||
}
|
||||
|
||||
getLocation() {
|
||||
return this.location;
|
||||
}
|
||||
|
||||
getTooltip() {
|
||||
return this.tooltip;
|
||||
}
|
||||
|
||||
getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
getFirstPageText() {
|
||||
return this.firstPageText;
|
||||
}
|
||||
|
||||
getLastPageText() {
|
||||
return this.lastPageText;
|
||||
}
|
||||
|
||||
getSecondPageText() {
|
||||
return this.secondPageText;
|
||||
}
|
||||
|
||||
getLastPageNumber() {
|
||||
return this.lastPageNumber;
|
||||
}
|
||||
|
||||
getCreatedByUser() {
|
||||
return this.createdByUser;
|
||||
}
|
||||
|
||||
getModifiedByUser() {
|
||||
return this.modifiedByUser;
|
||||
}
|
||||
|
||||
getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
getProperties() {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
update(details) {
|
||||
Object.assign(this, {
|
||||
createdByUser: new CreatedByModel(details.createdByUser),
|
||||
modifiedByUser: new CreatedByModel(details.modifiedByUser),
|
||||
content: new ContentModel(details.content),
|
||||
properties: new ContentPropertiesModel(details.properties)
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var FileModel = require('./fileModel');
|
||||
|
||||
var FilesModel = function () {
|
||||
|
||||
var files = null;
|
||||
|
||||
this.setFiles = function (arr) {
|
||||
files = arr.map(function(item) {
|
||||
return new FileModel(item.entry);
|
||||
});
|
||||
};
|
||||
|
||||
this.getFiles = function () {
|
||||
return files;
|
||||
};
|
||||
};
|
||||
module.exports = FilesModel;
|
@@ -15,39 +15,39 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
var FolderModel = function (details) {
|
||||
export class FolderModel {
|
||||
|
||||
this.id = Util.generateRandomString();
|
||||
this.name = Util.generateRandomString();
|
||||
this.shortName = this.name;
|
||||
this.tooltip = this.name;
|
||||
this.location = "";
|
||||
this.description= "";
|
||||
id = Util.generateRandomString();
|
||||
name = Util.generateRandomString();
|
||||
shortName = this.name;
|
||||
tooltip = this.name;
|
||||
location = '';
|
||||
description = '';
|
||||
|
||||
this.getName = function () {
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
};
|
||||
}
|
||||
|
||||
this.getShortName = function () {
|
||||
getShortName() {
|
||||
return this.shortName;
|
||||
};
|
||||
}
|
||||
|
||||
this.getTooltip = function () {
|
||||
getTooltip() {
|
||||
return this.tooltip;
|
||||
};
|
||||
}
|
||||
|
||||
this.getId = function () {
|
||||
getId() {
|
||||
return this.id;
|
||||
};
|
||||
}
|
||||
|
||||
this.getLocation = function () {
|
||||
getLocation() {
|
||||
return this.location;
|
||||
};
|
||||
|
||||
Object.assign(this, details);
|
||||
|
||||
};
|
||||
module.exports = FolderModel;
|
||||
}
|
||||
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
/**
|
||||
* Create Group Object
|
||||
*
|
||||
* @param details - Group object used to overwrite the default values
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
var Group = function (details) {
|
||||
|
||||
this.name = Util.generateRandomString();
|
||||
this.type = "1";
|
||||
this.parentGroupId = null;
|
||||
this.tenantId = "1";
|
||||
|
||||
Object.assign(this, details);
|
||||
};
|
||||
|
||||
module.exports = Group;
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
/**
|
||||
* Create Json Object for standalone task
|
||||
@@ -23,11 +23,12 @@ var Util = require('../../util/util');
|
||||
* @param details - JSON object used to overwrite the default values
|
||||
* @constructor
|
||||
*/
|
||||
export class StandaloneTask {
|
||||
|
||||
var StandaloneTask = function (details) {
|
||||
name = Util.generateRandomString();
|
||||
|
||||
this.name = Util.generateRandomString();
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
Object.assign(this, details);
|
||||
};
|
||||
module.exports = StandaloneTask;
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
/**
|
||||
* Create tenant JSON Object
|
||||
@@ -23,14 +23,16 @@ var Util = require('../../util/util');
|
||||
* @param details - JSON object used to overwrite the default values
|
||||
* @constructor
|
||||
*/
|
||||
var Tenant = function (details) {
|
||||
this.active = true;
|
||||
this.configuration = "DefaultConfig";
|
||||
this.domain = "DefaultDomain";
|
||||
this.maxUsers = 10;
|
||||
this.name = Util.generateRandomString();
|
||||
export class Tenant {
|
||||
|
||||
Object.assign(this, details);
|
||||
};
|
||||
active = true;
|
||||
configuration = 'DefaultConfig';
|
||||
domain = 'DefaultDomain';
|
||||
maxUsers = 10;
|
||||
name = Util.generateRandomString();
|
||||
|
||||
module.exports = Tenant;
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
|
||||
}
|
@@ -15,25 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
/**
|
||||
* Create User JSON Object
|
||||
* Create tenant JSON Object
|
||||
*
|
||||
* @param details - JSON object used to overwrite the default values
|
||||
* @constructor
|
||||
*/
|
||||
export class User {
|
||||
|
||||
var User = function (details) {
|
||||
email = Util.generateRandomEmail();
|
||||
firstName = Util.generateRandomString();
|
||||
lastName = Util.generateRandomString();
|
||||
password = Util.generatePasswordString();
|
||||
type = 'enterprise';
|
||||
tenantId = '1';
|
||||
company = null;
|
||||
|
||||
this.email = Util.generateRandomEmail();
|
||||
this.firstName = Util.generateRandomString();
|
||||
this.lastName = Util.generateRandomString();
|
||||
this.password = Util.generatePasswordString();
|
||||
this.type = 'enterprise';
|
||||
this.tenantId = "1";
|
||||
this.company = null;
|
||||
|
||||
Object.assign(this, details);
|
||||
};
|
||||
module.exports = User;
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
}
|
||||
}
|
236
e2e/pages/adf/cardViewComponentPage.ts
Normal file
236
e2e/pages/adf/cardViewComponentPage.ts
Normal file
@@ -0,0 +1,236 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
keyValueRow = 'card-view__key-value-pairs__row';
|
||||
selectValue = 'mat-option';
|
||||
textField = element(by.css(`input[data-automation-id='card-textitem-editinput-name']`));
|
||||
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
||||
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog = element(by.className('adf-console'));
|
||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
select = element(by.css('mat-select[data-automation-class="select-box"]'));
|
||||
checkbox = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
|
||||
resetButton = element(by.css(`#adf-reset-card-log`));
|
||||
selectedValue = element(by.css('.mat-select-value-text span'));
|
||||
listContent = element(by.className('mat-select-content'));
|
||||
editableSwitch = element(by.id('adf-toggle-editable'));
|
||||
|
||||
clickOnAddButton() {
|
||||
Util.waitUntilElementIsVisible(this.addButton);
|
||||
this.addButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnResetButton() {
|
||||
Util.waitUntilElementIsVisible(this.resetButton);
|
||||
this.resetButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnTextField() {
|
||||
let toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(this.textField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnTextClearIcon() {
|
||||
let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
}
|
||||
|
||||
clickOnTextSaveIcon() {
|
||||
let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
}
|
||||
|
||||
getTextFieldText() {
|
||||
let textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
}
|
||||
|
||||
enterTextField(text) {
|
||||
Util.waitUntilElementIsVisible(this.textField);
|
||||
this.textField.sendKeys('');
|
||||
this.textField.clear();
|
||||
this.textField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnIntField() {
|
||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(this.intField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnIntClearIcon() {
|
||||
let clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
}
|
||||
|
||||
clickOnIntSaveIcon() {
|
||||
let saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
}
|
||||
|
||||
enterIntField(text) {
|
||||
Util.waitUntilElementIsVisible(this.intField);
|
||||
this.intField.sendKeys('');
|
||||
this.intField.clear();
|
||||
this.intField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
getIntFieldText() {
|
||||
let textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
}
|
||||
|
||||
getErrorInt() {
|
||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
Util.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
}
|
||||
|
||||
clickOnFloatField() {
|
||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(this.floatField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnFloatClearIcon() {
|
||||
let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
}
|
||||
|
||||
clickOnFloatSaveIcon() {
|
||||
let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
}
|
||||
|
||||
enterFloatField(text) {
|
||||
Util.waitUntilElementIsVisible(this.floatField);
|
||||
this.floatField.sendKeys('');
|
||||
this.floatField.clear();
|
||||
this.floatField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
getFloatFieldText() {
|
||||
let textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
}
|
||||
|
||||
getErrorFloat() {
|
||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
Util.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
}
|
||||
|
||||
setName(name) {
|
||||
Util.waitUntilElementIsVisible(this.nameInputField);
|
||||
this.nameInputField.sendKeys(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
setValue(value) {
|
||||
Util.waitUntilElementIsVisible(this.valueInputField);
|
||||
this.valueInputField.sendKeys(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
waitForOutput() {
|
||||
Util.waitUntilElementIsVisible(this.consoleLog);
|
||||
return this;
|
||||
}
|
||||
|
||||
getOutputText(index) {
|
||||
return this.consoleLog.all(by.css('p')).get(index).getText();
|
||||
}
|
||||
|
||||
deletePairsValues() {
|
||||
Util.waitUntilElementIsVisible(this.deleteButton);
|
||||
this.deleteButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkNameAndValueVisibility(index) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getKeyValueRow(index));
|
||||
return this;
|
||||
}
|
||||
|
||||
getKeyValueRow(index) {
|
||||
return element.all(by.css(this.keyValueRow)).get(index);
|
||||
|
||||
}
|
||||
|
||||
getMatSelectValue(index) {
|
||||
return element.all(by.className(this.selectValue)).get(index);
|
||||
}
|
||||
|
||||
clickSelectBox() {
|
||||
this.select.click();
|
||||
Util.waitUntilElementIsVisible(this.listContent);
|
||||
}
|
||||
|
||||
checkboxClick() {
|
||||
this.checkbox.click();
|
||||
}
|
||||
|
||||
selectValueFromComboBox(index) {
|
||||
this.getMatSelectValue(index).click();
|
||||
Util.waitUntilElementIsVisible(this.consoleLog);
|
||||
return this;
|
||||
}
|
||||
|
||||
getSelectionValue() {
|
||||
return this.selectedValue.getText();
|
||||
}
|
||||
|
||||
disableEdit() {
|
||||
Util.waitUntilElementIsVisible(this.editableSwitch);
|
||||
this.editableSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.editableSwitch.click();
|
||||
expect(this.editableSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@@ -1,234 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var CardViewComponentPage = function () {
|
||||
|
||||
const addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
const keyValueRow = 'card-view__key-value-pairs__row';
|
||||
const selectValue = 'mat-option';
|
||||
const textField = element(by.css("input[data-automation-id='card-textitem-editinput-name']"));
|
||||
const intField = element(by.css("input[data-automation-id='card-textitem-editinput-int']"));
|
||||
const floatField = element(by.css("input[data-automation-id='card-textitem-editinput-float']"));
|
||||
const valueInputField = element(by.xpath("//*[contains(@id,'input') and @placeholder='Value']"));
|
||||
const nameInputField = element(by.xpath("//*[contains(@id,'input') and @placeholder='Name']"));
|
||||
const consoleLog = element(by.className('adf-console'));
|
||||
const deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
const select = element(by.css('mat-select[data-automation-class="select-box"]'));
|
||||
const checkbox = element(by.css("mat-checkbox[data-automation-id='card-boolean-boolean']"));
|
||||
const resetButton = element(by.css("#adf-reset-card-log"));
|
||||
const selectedValue = element(by.css('.mat-select-value-text span'));
|
||||
const listContent = element(by.className('mat-select-content'));
|
||||
const editableSwitch = element(by.id('adf-toggle-editable'));
|
||||
|
||||
this.clickOnAddButton = function () {
|
||||
Util.waitUntilElementIsVisible(addButton);
|
||||
addButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnResetButton= function () {
|
||||
Util.waitUntilElementIsVisible(resetButton);
|
||||
resetButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnTextField = function () {
|
||||
let toggleText = element(by.css("div[data-automation-id='card-textitem-edit-toggle-name']"));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnTextClearIcon = function () {
|
||||
let clearIcon = element(by.css("mat-icon[data-automation-id=\"card-textitem-reset-name\"]"));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
};
|
||||
|
||||
this.clickOnTextSaveIcon = function () {
|
||||
let saveIcon = element(by.css("mat-icon[data-automation-id=\"card-textitem-update-name\"]"));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
};
|
||||
|
||||
this.getTextFieldText = function () {
|
||||
var textField = element(by.css("span[data-automation-id='card-textitem-value-name']"));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
};
|
||||
|
||||
this.enterTextField = function (text) {
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnIntField = function () {
|
||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(intField);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnIntClearIcon = function () {
|
||||
let clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
};
|
||||
|
||||
this.clickOnIntSaveIcon = function () {
|
||||
let saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
};
|
||||
|
||||
this.enterIntField = function (text) {
|
||||
Util.waitUntilElementIsVisible(intField);
|
||||
intField.sendKeys('');
|
||||
intField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getIntFieldText = function () {
|
||||
var textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
};
|
||||
|
||||
this.getErrorInt = function () {
|
||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
Util.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
};
|
||||
|
||||
this.clickOnFloatField = function () {
|
||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
|
||||
Util.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
Util.waitUntilElementIsVisible(floatField);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnFloatClearIcon = function () {
|
||||
let clearIcon = element(by.css("mat-icon[data-automation-id='card-textitem-reset-float']"));
|
||||
Util.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
};
|
||||
|
||||
this.clickOnFloatSaveIcon = function () {
|
||||
let saveIcon = element(by.css("mat-icon[data-automation-id='card-textitem-update-float']"));
|
||||
Util.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
};
|
||||
|
||||
this.enterFloatField = function (text) {
|
||||
Util.waitUntilElementIsVisible(floatField);
|
||||
floatField.sendKeys('');
|
||||
floatField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getFloatFieldText = function () {
|
||||
var textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
};
|
||||
|
||||
this.getErrorFloat = function () {
|
||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
Util.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
};
|
||||
|
||||
this.setName = function (name) {
|
||||
Util.waitUntilElementIsVisible(nameInputField);
|
||||
nameInputField.sendKeys(name);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.setValue = function (value) {
|
||||
Util.waitUntilElementIsVisible(valueInputField);
|
||||
valueInputField.sendKeys(value);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
this.waitForOutput = function () {
|
||||
Util.waitUntilElementIsVisible(consoleLog);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getOutputText = function (index) {
|
||||
return consoleLog.all(by.css('p')).get(index).getText();
|
||||
};
|
||||
|
||||
this.deletePairsValues = function () {
|
||||
Util.waitUntilElementIsVisible(deleteButton);
|
||||
deleteButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkNameAndValueVisibility = (index) => {
|
||||
Util.waitUntilElementIsNotOnPage(this.getKeyValueRow(index));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getKeyValueRow = (index) => {
|
||||
return element.all(by.css(keyValueRow)).get(index);
|
||||
|
||||
};
|
||||
|
||||
this.getMatSelectValue = (index) => {
|
||||
return element.all(by.className(selectValue)).get(index);
|
||||
};
|
||||
|
||||
this.clickSelectBox = () => {
|
||||
select.click();
|
||||
Util.waitUntilElementIsVisible(listContent);
|
||||
};
|
||||
|
||||
this.checkboxClick = () => {
|
||||
checkbox.click();
|
||||
};
|
||||
|
||||
this.selectValueFromComboBox = (index) => {
|
||||
this.getMatSelectValue(index).click();
|
||||
Util.waitUntilElementIsVisible(consoleLog);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getSelectionValue = () => {
|
||||
return selectedValue.getText();
|
||||
};
|
||||
|
||||
this.disableEdit = function () {
|
||||
Util.waitUntilElementIsVisible(editableSwitch);
|
||||
editableSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
editableSwitch.click();
|
||||
expect(editableSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
}
|
||||
module.exports = CardViewComponentPage;
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import { TabsPage } from './material/tabsPage';
|
||||
|
||||
export class CommentsPage {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
export class ConfigEditorPage {
|
||||
|
||||
@@ -30,6 +30,7 @@ export class ConfigEditorPage {
|
||||
enterBigConfigurationText(text) {
|
||||
let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
|
||||
browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + text + '`)');
|
||||
return this;
|
||||
}
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import ContentList = require('./dialog/contentList');
|
||||
import CreateFolderDialog = require('./dialog/createFolderDialog');
|
||||
import TestConfig = require('../../test.config');
|
||||
import { Util } from '../../util/util';
|
||||
import { ContentListPage } from './dialog/contentListPage';
|
||||
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
||||
import { NavigationBarPage } from './navigationBarPage';
|
||||
import { by, element, protractor, $$, browser } from 'protractor';
|
||||
|
||||
@@ -26,15 +26,14 @@ import path = require('path');
|
||||
|
||||
export class ContentServicesPage {
|
||||
|
||||
contentList = new ContentList();
|
||||
contentList = new ContentListPage();
|
||||
createFolderDialog = new CreateFolderDialog();
|
||||
uploadBorder = element(by.id('document-list-container'));
|
||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
contentServices = element(by.css('a[data-automation-id="Content Services"]'));
|
||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||
createFolderButton = element(by.cssContainingText('mat-icon', 'create_new_folder'));
|
||||
activeBreadcrumb = element(by.css('div[class*="adf-active"]'));
|
||||
tooltip = by.css('div[class*="--text adf-full-width"] span');
|
||||
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||
uploadFileButton = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
||||
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
||||
@@ -57,7 +56,7 @@ export class ContentServicesPage {
|
||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer = element(by.css('div.adf-document-list-container div.adf-data-table-card'));
|
||||
copyButton = element(by.css('button[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"'));
|
||||
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"]'));
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
|
||||
getElementsDisplayed() {
|
||||
@@ -82,7 +81,7 @@ export class ContentServicesPage {
|
||||
checkElementsSortedByNameAsc(elements) {
|
||||
browser.controlFlow().execute(async () => {
|
||||
let numberOfElements = await this.numberOfResultsDisplayed();
|
||||
for (let i = 0; i < (numberOfElements - 1) ; i++ ) {
|
||||
for (let i = 0; i < (numberOfElements - 1); i++) {
|
||||
expect(JSON.stringify(elements[i]) <= JSON.stringify(elements[i + 1])).toEqual(true);
|
||||
}
|
||||
});
|
||||
@@ -92,7 +91,7 @@ export class ContentServicesPage {
|
||||
checkElementsSortedByNameDesc(elements) {
|
||||
browser.controlFlow().execute(async () => {
|
||||
let numberOfElements = await this.numberOfResultsDisplayed();
|
||||
for (let i = 0; i < (numberOfElements - 1) ; i++ ) {
|
||||
for (let i = 0; i < (numberOfElements - 1); i++) {
|
||||
expect(JSON.stringify(elements[i]) >= JSON.stringify(elements[i + 1])).toEqual(true);
|
||||
}
|
||||
});
|
||||
@@ -173,12 +172,8 @@ export class ContentServicesPage {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
getTooltip(content) {
|
||||
return this.contentList.getRowByRowName(content).element(this.tooltip).getAttribute('title');
|
||||
}
|
||||
|
||||
getBreadcrumbTooltip(content) {
|
||||
return element(by.css('nav[data-automation-id="breadcrumb"] div[title="' + content + '"]')).getAttribute('title');
|
||||
getBreadcrumbTooltip(nodeName: string) {
|
||||
return element(by.css(`nav[data-automation-id="breadcrumb"] div[title="${nodeName}"]`)).getAttribute('title');
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
@@ -259,6 +254,7 @@ export class ContentServicesPage {
|
||||
createNewFolder(folder) {
|
||||
this.clickOnCreateNewFolder();
|
||||
this.createFolderDialog.addFolderName(folder);
|
||||
browser.sleep(200);
|
||||
this.createFolderDialog.clickOnCreateButton();
|
||||
return this;
|
||||
}
|
||||
@@ -351,7 +347,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
checkItemInDocList(fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.css('div[data-automation-id="text_' + fileName + '"]')));
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="text_${fileName}"]`)));
|
||||
}
|
||||
|
||||
enableInfiniteScrolling() {
|
||||
@@ -376,7 +372,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
enableThumbnails() {
|
||||
let thumbnailSlide = element(by.css('#adf-thumbnails-upload-switch'));
|
||||
let thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
Util.waitUntilElementIsVisible(thumbnailSlide);
|
||||
thumbnailSlide.click();
|
||||
return this;
|
||||
@@ -427,7 +423,7 @@ export class ContentServicesPage {
|
||||
getColumnValueForRow(file, columnName) {
|
||||
let row = this.contentList.getRowByRowName(file);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
let rowColumn = row.element(by.css('div[title="' + columnName + '"] span'));
|
||||
let rowColumn = row.element(by.css(`div[title="${columnName}"] span`));
|
||||
Util.waitUntilElementIsVisible(rowColumn);
|
||||
return rowColumn.getText();
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../../../util/util');
|
||||
import { Util } from '../../../../../util/util';
|
||||
import { by, browser, protractor } from 'protractor';
|
||||
import { DatePickerPage } from '../../../material/datePickerPage';
|
||||
|
||||
|
@@ -14,8 +14,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Util = require('../../../../../util/util');
|
||||
import { by, protractor, browser } from 'protractor';
|
||||
import { Util } from '../../../../../util/util';
|
||||
import { by, protractor } from 'protractor';
|
||||
|
||||
export class NumberRangeFilterPage {
|
||||
|
||||
|
@@ -15,24 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../../../util/util');
|
||||
import { element, by } from 'protractor';
|
||||
import { Util } from '../../../../../util/util';
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
|
||||
export class SearchCheckListPage {
|
||||
|
||||
filter;
|
||||
filter: ElementFinder;
|
||||
inputBy = by.css('div[class*="mat-expansion-panel-content"] input');
|
||||
showMoreBy = by.css('button[title="Show more"]');
|
||||
showLessBy = by.css('button[title="Show less"]');
|
||||
clearAllButton = by.css('button');
|
||||
|
||||
constructor(filter) {
|
||||
constructor(filter: ElementFinder) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
clickCheckListOption(option) {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`));
|
||||
let result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first();
|
||||
Util.waitUntilElementIsVisible(result);
|
||||
Util.waitUntilElementIsClickable(result);
|
||||
result.click();
|
||||
@@ -63,16 +63,16 @@ export class SearchCheckListPage {
|
||||
}
|
||||
|
||||
checkSearchFilterInputIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.filter.element(this.inputBy));
|
||||
Util.waitUntilElementIsVisible(this.filter.all(this.inputBy).first());
|
||||
}
|
||||
|
||||
searchInFilter(option) {
|
||||
let inputElement = this.filter.element(this.inputBy);
|
||||
let inputElement = this.filter.all(this.inputBy).first();
|
||||
Util.waitUntilElementIsClickable(this.filter);
|
||||
Util.waitUntilElementIsClickable(inputElement);
|
||||
|
||||
inputElement.clear();
|
||||
this.filter.element(this.inputBy).sendKeys(option);
|
||||
this.filter.all(this.inputBy).first().sendKeys(option);
|
||||
}
|
||||
|
||||
checkShowLessButtonIsNotDisplayed() {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../../../util/util');
|
||||
import { Util } from '../../../../../util/util';
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
export class SearchRadioPage {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, protractor } from 'protractor';
|
||||
import Util = require('../../../../../util/util');
|
||||
import { Util } from '../../../../../util/util';
|
||||
|
||||
export class SearchSliderPage {
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../../../util/util');
|
||||
import { Util } from '../../../../../util/util';
|
||||
import { protractor, by } from 'protractor';
|
||||
|
||||
export class SearchTextPage {
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../../util/util');
|
||||
import { by } from 'protractor';
|
||||
import { Util } from '../../../../util/util';
|
||||
import { by, ElementFinder } from 'protractor';
|
||||
import { SearchTextPage } from './components/search-text';
|
||||
import { SearchCheckListPage } from './components/search-checkList';
|
||||
import { SearchRadioPage } from './components/search-radio';
|
||||
@@ -26,56 +26,56 @@ import { SearchSliderPage } from './components/search-slider.page';
|
||||
|
||||
export class SearchCategoriesPage {
|
||||
|
||||
checkListFiltersPage(filter) {
|
||||
checkListFiltersPage(filter: ElementFinder) {
|
||||
return new SearchCheckListPage(filter);
|
||||
}
|
||||
|
||||
textFiltersPage(filter) {
|
||||
textFiltersPage(filter: ElementFinder) {
|
||||
return new SearchTextPage(filter);
|
||||
}
|
||||
|
||||
radioFiltersPage(filter) {
|
||||
radioFiltersPage(filter: ElementFinder) {
|
||||
return new SearchRadioPage(filter);
|
||||
}
|
||||
|
||||
dateRangeFilter(filter) {
|
||||
dateRangeFilter(filter: ElementFinder) {
|
||||
return new DateRangeFilterPage(filter);
|
||||
}
|
||||
|
||||
numberRangeFilter(filter) {
|
||||
numberRangeFilter(filter: ElementFinder) {
|
||||
return new NumberRangeFilterPage(filter);
|
||||
}
|
||||
|
||||
sliderFilter(filter) {
|
||||
sliderFilter(filter: ElementFinder) {
|
||||
return new SearchSliderPage(filter);
|
||||
}
|
||||
|
||||
checkFilterIsDisplayed(filter) {
|
||||
checkFilterIsDisplayed(filter: ElementFinder) {
|
||||
Util.waitUntilElementIsVisible(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickFilter(filter) {
|
||||
clickFilter(filter: ElementFinder) {
|
||||
Util.waitUntilElementIsVisible(filter);
|
||||
filter.element(by.css('mat-expansion-panel-header')).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickFilterHeader(filter) {
|
||||
clickFilterHeader(filter: ElementFinder) {
|
||||
let fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsClickable(fileSizeFilterHeader);
|
||||
fileSizeFilterHeader.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFilterIsCollapsed(filter) {
|
||||
checkFilterIsCollapsed(filter: ElementFinder) {
|
||||
filter.getAttribute('class').then((elementClass) => {
|
||||
expect(elementClass).not.toContain('mat-expanded');
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFilterIsExpanded(filter) {
|
||||
checkFilterIsExpanded(filter: ElementFinder) {
|
||||
filter.getAttribute('class').then((elementClass) => {
|
||||
expect(elementClass).toContain('mat-expanded');
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
export class TreeViewPage {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class HeaderPage {
|
||||
|
||||
|
@@ -1,354 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
var TestConfig = require('../../test.config');
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var DataTablePage = function (rootElement = element(by.css("adf-datatable"))) {
|
||||
|
||||
var dataTableURL = TestConfig.adf.url + TestConfig.adf.port + "/datatable";
|
||||
|
||||
var contents = element.all(by.css('div[class="adf-datatable-body"] span'));
|
||||
var multiSelect = element(by.css("div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']"));
|
||||
var selectionButton = element(by.css("div[class='mat-select-arrow']"));
|
||||
var selectionDropDown = element(by.css("div[class*='ng-trigger-transformPanel']"));
|
||||
var allSelectedRows = element.all(by.css("div[class*='is-selected']"));
|
||||
var selectedRowNumber = element(by.css("div[class*='is-selected'] div[data-automation-id*='text_']"));
|
||||
var selectAll = element(by.css("div[class*='header'] label"));
|
||||
var list = rootElement.all(by.css("div[class*=adf-datatable-body] div[class*=adf-datatable-row]"));
|
||||
var addRow = element(by.xpath("//span[contains(text(),'Add row')]/.."));
|
||||
var replaceRows = element(by.xpath("//span[contains(text(),'Replace rows')]/.."));
|
||||
var reset = element(by.xpath("//span[contains(text(),'Reset to default')]/.."));
|
||||
var replaceColumns = element(by.xpath("//span[contains(text(),'Replace columns')]/.."));
|
||||
var createdOnColumn = element(by.css("div[data-automation-id='auto_id_createdOn']"));
|
||||
var pageLoaded = element(by.css("div[data-automation-id='auto_id_id']"));
|
||||
var tableBody = element.all(by.css("div[class='adf-datatable-body']")).first();
|
||||
var spinner = element(by.css('mat-progress-spinner'));
|
||||
var rows = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row']");
|
||||
var nameColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Name'] span");
|
||||
|
||||
this.goToDatatable = function () {
|
||||
browser.driver.get(dataTableURL);
|
||||
Util.waitUntilElementIsVisible(pageLoaded);
|
||||
};
|
||||
|
||||
this.getAllDisplayedRows = function () {
|
||||
return element.all(rows).count();
|
||||
};
|
||||
|
||||
this.getAllRowsNameColumn = function () {
|
||||
return this.getAllRowsColumnValues(nameColumn);
|
||||
};
|
||||
|
||||
this.getAllRowsColumnValues = function (locator) {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
var initialList = [];
|
||||
|
||||
element.all(locator).each(function (element) {
|
||||
element.getText().then(function (text) {
|
||||
if (text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve row by row number
|
||||
*
|
||||
* @param rowNumber
|
||||
*/
|
||||
this.getRowByRowNumber = function (rowNumber) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='text_" + rowNumber + "']")));
|
||||
return element(by.css("div[data-automation-id='text_" + rowNumber + "']"));
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the checkbox of the row
|
||||
*
|
||||
* @param rowNumber
|
||||
*/
|
||||
this.getRowCheckbox = function (rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]"));
|
||||
};
|
||||
|
||||
/**
|
||||
* Click multiselect option
|
||||
* */
|
||||
this.clickMultiSelect = function () {
|
||||
Util.waitUntilElementIsVisible(multiSelect);
|
||||
multiSelect.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Click reset option
|
||||
* */
|
||||
this.clickReset = function () {
|
||||
Util.waitUntilElementIsVisible(reset);
|
||||
reset.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Click specific checkbox in row
|
||||
* @method clickCheckbox
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.clickCheckbox = function (rowNumber) {
|
||||
var checkbox = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label"));
|
||||
Util.waitUntilElementIsVisible(checkbox);
|
||||
checkbox.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific row
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.selectRow = function (rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific row using command key
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.selectRowWithKeyboard = function (rowNumber) {
|
||||
let row = this.getRowByRowNumber(rowNumber);
|
||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific selection mode
|
||||
* @method selectSelectionMode
|
||||
* @param {String} selection mode
|
||||
*/
|
||||
this.selectSelectionMode = function (selectionMode) {
|
||||
let selectMode = element(by.cssContainingText("span[class='mat-option-text']", selectionMode));
|
||||
selectionButton.click();
|
||||
Util.waitUntilElementIsVisible(selectionDropDown);
|
||||
selectMode.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a specific row is selected
|
||||
* @method checkRowIsSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsSelected = function (rowNumber) {
|
||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'is-selected')]"));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a specific row is not selected
|
||||
* @method checkRowIsNotSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsNotSelected = function (rowNumber) {
|
||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]"));
|
||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check no row is selected
|
||||
* @method checkNoRowIsSelected
|
||||
*/
|
||||
this.checkNoRowIsSelected = function () {
|
||||
Util.waitUntilElementIsNotOnPage(selectedRowNumber);
|
||||
};
|
||||
|
||||
this.checkAllRows = function () {
|
||||
Util.waitUntilElementIsVisible(selectAll);
|
||||
selectAll.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Check specfic row is checked
|
||||
* @method checkRowIsChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsChecked = function (rowNumber) {
|
||||
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||
};
|
||||
|
||||
/**
|
||||
* Check specfic row is not checked
|
||||
* @method checkRowIsNotChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsNotChecked = function (rowNumber) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a row to the table
|
||||
* @method addRow
|
||||
*/
|
||||
this.addRow = function () {
|
||||
Util.waitUntilElementIsVisible(addRow);
|
||||
addRow.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the number of rows of the table
|
||||
* @method getNumberOfRows
|
||||
*/
|
||||
this.getNumberOfRows = function () {
|
||||
return list.count();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the number of selected rows of the table
|
||||
* @method getNumberOfSelectedRows
|
||||
*/
|
||||
this.getNumberOfSelectedRows = function () {
|
||||
return allSelectedRows.count();
|
||||
};
|
||||
|
||||
/**
|
||||
* replace rows
|
||||
* @method replaceRows
|
||||
* @param {String} id
|
||||
*/
|
||||
this.replaceRows = function (id) {
|
||||
let rowID = this.getRowByRowNumber(id);
|
||||
Util.waitUntilElementIsVisible(rowID);
|
||||
replaceRows.click();
|
||||
Util.waitUntilElementIsNotOnPage(rowID);
|
||||
};
|
||||
|
||||
/**
|
||||
* replace columns
|
||||
* @method replaceColumns
|
||||
*/
|
||||
this.replaceColumns = function () {
|
||||
Util.waitUntilElementIsVisible(replaceColumns);
|
||||
replaceColumns.click();
|
||||
Util.waitUntilElementIsNotOnPage(createdOnColumn);
|
||||
};
|
||||
|
||||
this.getRowsName = function (content) {
|
||||
let row = element(by.css("div[data-automation-id*='" + content + "']"));
|
||||
Util.waitUntilElementIsPresent(row);
|
||||
return row;
|
||||
};
|
||||
|
||||
this.doubleClickRow = function (rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(row.all(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")).first());
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getRowByRowName = function (content) {
|
||||
let rowByRowName = by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]");
|
||||
Util.waitUntilElementIsPresent(this.getRowsName(content).element(rowByRowName));
|
||||
return this.getRowsName(content).element(rowByRowName);
|
||||
};
|
||||
|
||||
this.waitForTableBody = function () {
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
this.insertFilter = function (filterText) {
|
||||
let inputFilter = element(by.xpath("//*[@id=\"adf-datatable-filter-input\"]"));
|
||||
inputFilter.clear();
|
||||
return inputFilter.sendKeys(filterText);
|
||||
};
|
||||
|
||||
this.getNodeIdFirstElement = function () {
|
||||
let firstNode = element.all(by.css('adf-datatable div[title="Node id"] span')).first();
|
||||
return firstNode.getText();
|
||||
};
|
||||
|
||||
this.sortByColumn = function (sortOrder, locator) {
|
||||
Util.waitUntilElementIsVisible(element(locator));
|
||||
return element(locator).getAttribute('class').then(function (result) {
|
||||
if (sortOrder === true) {
|
||||
if (!result.includes('sorted-asc')) {
|
||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (result.includes('sorted-asc')) {
|
||||
element(locator).click();
|
||||
} else if (result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
this.checkContentIsDisplayed = function(content) {
|
||||
var row = by.cssContainingText("span", content);
|
||||
Util.waitUntilElementIsVisible(tableBody.all(row).first());
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkContentIsNotDisplayed = function(content) {
|
||||
var row = by.cssContainingText("span", content);
|
||||
Util.waitUntilElementIsNotOnPage(tableBody.all(row).first());
|
||||
return this;
|
||||
};
|
||||
|
||||
this.selectRowByContentName = function(content) {
|
||||
var row = by.cssContainingText("span", content);
|
||||
Util.waitUntilElementIsVisible(tableBody.element(row));
|
||||
tableBody.element(row).click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.contentInPosition = function (position){
|
||||
Util.waitUntilElementIsVisible(contents);
|
||||
return contents.get(position -1).getText();
|
||||
};
|
||||
|
||||
this.checkSpinnerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsPresent(spinner);
|
||||
};
|
||||
|
||||
this.checkRowIsDisplayedByName = function (name) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[filename='"+name+"']")));
|
||||
};
|
||||
|
||||
this.checkRowIsNotDisplayedByName = function (taskName) {
|
||||
Util.waitUntilElementIsNotOnPage(element(by.css("div[filename='"+taskName+"']")));
|
||||
};
|
||||
|
||||
this.getNumberOfRowsDisplayedWithSameName = function (taskName) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[filename='"+taskName+"']")));
|
||||
return element.all(by.css("div[title='Name'][filename='"+taskName+"']")).count();
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = DataTablePage;
|
271
e2e/pages/adf/dataTablePage.ts
Normal file
271
e2e/pages/adf/dataTablePage.ts
Normal file
@@ -0,0 +1,271 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { Util } from '../../util/util';
|
||||
import { ElementFinder } from 'protractor/built/element';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
list: ElementFinder;
|
||||
contents = element.all(by.css('div[class="adf-datatable-body"] span'));
|
||||
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
|
||||
selectionButton = element(by.css(`div[class='mat-select-arrow']`));
|
||||
selectionDropDown = element(by.css(`div[class*='ng-trigger-transformPanel']`));
|
||||
allSelectedRows = element.all(by.css(`div[class*='is-selected']`));
|
||||
selectedRowNumber = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll = element(by.css(`div[class*='header'] label`));
|
||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||
pageLoaded = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||
tableBody = element.all(by.css(`div[class='adf-datatable-body']`)).first();
|
||||
spinner = element(by.css('mat-progress-spinner'));
|
||||
rows = by.css(`adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row']`);
|
||||
nameColumn = by.css(`adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Name'] span`);
|
||||
|
||||
constructor(rootElement: ElementFinder = element(by.css('adf-datatable'))) {
|
||||
this.rootElement = rootElement;
|
||||
this.list = this.rootElement.all(by.css(`div[class*=adf-datatable-body] div[class*=adf-datatable-row]`));
|
||||
|
||||
}
|
||||
|
||||
getAllDisplayedRows() {
|
||||
return element.all(this.rows).count();
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
return this.getAllRowsColumnValues(this.nameColumn);
|
||||
}
|
||||
|
||||
getAllRowsColumnValues(locator) {
|
||||
let deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
let initialList = [];
|
||||
|
||||
element.all(locator).each(function (currentElement) {
|
||||
currentElement.getText().then(function (text) {
|
||||
if (text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
getRowByRowNumber(rowNumber) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[data-automation-id='text_` + rowNumber + `']`)));
|
||||
return element(by.css(`div[data-automation-id='text_` + rowNumber + `']`));
|
||||
}
|
||||
|
||||
getRowCheckbox(rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
|
||||
}
|
||||
|
||||
clickMultiSelect() {
|
||||
Util.waitUntilElementIsVisible(this.multiSelect);
|
||||
this.multiSelect.click();
|
||||
}
|
||||
|
||||
clickReset() {
|
||||
Util.waitUntilElementIsVisible(this.reset);
|
||||
this.reset.click();
|
||||
}
|
||||
|
||||
clickCheckbox(rowNumber) {
|
||||
let checkbox = this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||
Util.waitUntilElementIsVisible(checkbox);
|
||||
checkbox.click();
|
||||
}
|
||||
|
||||
selectRow(rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).click();
|
||||
}
|
||||
|
||||
selectRowWithKeyboard(rowNumber) {
|
||||
let row = this.getRowByRowNumber(rowNumber);
|
||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||
}
|
||||
|
||||
selectSelectionMode(selectionMode) {
|
||||
let selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
|
||||
this.selectionButton.click();
|
||||
Util.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectMode.click();
|
||||
}
|
||||
|
||||
checkRowIsSelected(rowNumber) {
|
||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
}
|
||||
|
||||
checkRowIsNotSelected(rowNumber) {
|
||||
let isRowSelected = this.getRowByRowNumber(rowNumber)
|
||||
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||
}
|
||||
|
||||
checkNoRowIsSelected() {
|
||||
Util.waitUntilElementIsNotOnPage(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
checkAllRows() {
|
||||
Util.waitUntilElementIsVisible(this.selectAll);
|
||||
this.selectAll.click();
|
||||
}
|
||||
|
||||
checkRowIsChecked(rowNumber) {
|
||||
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
checkRowIsNotChecked(rowNumber) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
addRow() {
|
||||
Util.waitUntilElementIsVisible(this.addRowElement);
|
||||
this.addRowElement.click();
|
||||
}
|
||||
|
||||
getNumberOfRows() {
|
||||
return this.list.count();
|
||||
}
|
||||
|
||||
getNumberOfSelectedRows() {
|
||||
return this.allSelectedRows.count();
|
||||
}
|
||||
|
||||
replaceRows(id) {
|
||||
let rowID = this.getRowByRowNumber(id);
|
||||
Util.waitUntilElementIsVisible(rowID);
|
||||
this.replaceRowsElement.click();
|
||||
Util.waitUntilElementIsNotOnPage(rowID);
|
||||
}
|
||||
|
||||
replaceColumns() {
|
||||
Util.waitUntilElementIsVisible(this.replaceColumnsElement);
|
||||
this.replaceColumnsElement.click();
|
||||
Util.waitUntilElementIsNotOnPage(this.createdOnColumn);
|
||||
}
|
||||
|
||||
getRowsName(content) {
|
||||
let row = element(by.css(`div[data-automation-id*='` + content + `']`));
|
||||
Util.waitUntilElementIsPresent(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
doubleClickRow(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(row.all(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)).first());
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
getRowByRowName(content) {
|
||||
let rowByRowName = by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`);
|
||||
Util.waitUntilElementIsPresent(this.getRowsName(content).element(rowByRowName));
|
||||
return this.getRowsName(content).element(rowByRowName);
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
Util.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
insertFilter(filterText) {
|
||||
let inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||
inputFilter.clear();
|
||||
return inputFilter.sendKeys(filterText);
|
||||
}
|
||||
|
||||
getNodeIdFirstElement() {
|
||||
let firstNode = element.all(by.css('adf-datatable div[title="Node id"] span')).first();
|
||||
return firstNode.getText();
|
||||
}
|
||||
|
||||
sortByColumn(sortOrder, locator) {
|
||||
Util.waitUntilElementIsVisible(element(locator));
|
||||
return element(locator).getAttribute('class').then(function (result) {
|
||||
if (sortOrder === true) {
|
||||
if (!result.includes('sorted-asc')) {
|
||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (result.includes('sorted-asc')) {
|
||||
element(locator).click();
|
||||
} else if (result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(content) {
|
||||
let row = by.cssContainingText(`span`, content);
|
||||
Util.waitUntilElementIsVisible(this.tableBody.all(row).first());
|
||||
return this;
|
||||
}
|
||||
|
||||
checkContentIsNotDisplayed(content) {
|
||||
let row = by.cssContainingText(`span`, content);
|
||||
Util.waitUntilElementIsNotOnPage(this.tableBody.all(row).first());
|
||||
return this;
|
||||
}
|
||||
|
||||
selectRowByContentName(content) {
|
||||
let row = by.cssContainingText(`span`, content);
|
||||
Util.waitUntilElementIsVisible(this.tableBody.element(row));
|
||||
this.tableBody.element(row).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
contentInPosition(position) {
|
||||
Util.waitUntilElementIsVisible(this.contents);
|
||||
return this.contents.get(position - 1).getText();
|
||||
}
|
||||
|
||||
checkSpinnerIsDisplayed() {
|
||||
Util.waitUntilElementIsPresent(this.spinner);
|
||||
}
|
||||
|
||||
checkRowIsDisplayedByName(filename) {
|
||||
Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||
}
|
||||
|
||||
checkRowIsNotDisplayedByName(filename) {
|
||||
Util.waitUntilElementIsNotOnPage(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||
}
|
||||
|
||||
getNumberOfRowsDisplayedWithSameName(filename) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[filename="${filename}"]`)));
|
||||
return element.all(by.css(`div[title='Name'][filename="${filename}"]`)).count();
|
||||
}
|
||||
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { TaskFiltersPage } from '../process_services/taskFiltersPage';
|
||||
|
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import DataTable = require('../dataTablePage');
|
||||
import TaskListPage = require('../process_services/tasksListPage');
|
||||
import PaginationPage = require('../paginationPage');
|
||||
import { Util } from '../../../util/util';
|
||||
import { TasksListPage } from '../process_services/tasksListPage';
|
||||
import { PaginationPage } from '../paginationPage';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class TaskListDemoPage {
|
||||
|
||||
taskListPage: TasksListPage = new TasksListPage();
|
||||
appId = element(by.css("input[data-automation-id='appId input']"));
|
||||
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
|
||||
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
||||
@@ -40,10 +40,11 @@ export class TaskListDemoPage {
|
||||
sortDropDownArrow = element(by.css("mat-form-field[data-automation-id='sort'] div[class*='arrow']"));
|
||||
sortSelector = element(by.css("div[class*='mat-select-content']"));
|
||||
processDefinitionIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Definition Id'] span");
|
||||
processInstanceIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Instance Id'] span");
|
||||
processInstanceIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='a" +
|
||||
"df-datatable-row'] div[title='Process Instance Id'] span");
|
||||
|
||||
taskList() {
|
||||
return new TaskListPage();
|
||||
taskList(): TasksListPage {
|
||||
return this.taskListPage;
|
||||
}
|
||||
|
||||
paginationPage() {
|
||||
@@ -161,11 +162,6 @@ export class TaskListDemoPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
getDueAfter() {
|
||||
Util.waitUntilElementIsVisible(this.dueAfter);
|
||||
return this.dueAfter.getAttribute('value');
|
||||
}
|
||||
|
||||
typeDueBefore(input) {
|
||||
Util.waitUntilElementIsVisible(this.dueBefore);
|
||||
this.clearText(this.dueBefore);
|
||||
@@ -173,14 +169,9 @@ export class TaskListDemoPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
getDueBefore() {
|
||||
Util.waitUntilElementIsVisible(this.dueBefore);
|
||||
return this.dueBefore.getAttribute('value');
|
||||
}
|
||||
|
||||
clearText(input) {
|
||||
clearText(input) {
|
||||
Util.waitUntilElementIsVisible(input);
|
||||
return input.clear();
|
||||
return input.clear();
|
||||
}
|
||||
|
||||
clickResetButton() {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
import { TaskFiltersCloudComponent } from '../process_cloud/taskFiltersCloudComponent';
|
||||
import { TaskListCloudComponent } from '../process_cloud/taskListCloudComponent';
|
||||
|
@@ -1,391 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
|
||||
var ContentList = function () {
|
||||
|
||||
var deleteContent = element(by.css("button[data-automation-id*='DELETE']"));
|
||||
var metadataAction = element(by.css("button[data-automation-id*='METADATA']"));
|
||||
var versionManagerAction = element(by.css("button[data-automation-id*='VERSIONS']"));
|
||||
var moveContent = element(by.css("button[data-automation-id*='MOVE']"));
|
||||
var copyContent = element(by.css("button[data-automation-id*='COPY']"));
|
||||
var downloadContent = element(by.css("button[data-automation-id*='DOWNLOAD']"));
|
||||
var actionMenu = element(by.css("div[role='menu']"));
|
||||
var optionButton = by.css("button[data-automation-id*='action_menu_']");
|
||||
var rowByRowName = by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]");
|
||||
var nameColumn = by.css('div[class*="datatable-body"] div[class*="adf-data-table-cell"][title="Display name"]');
|
||||
var nameColumnHeader = by.css("div[data-automation-id='auto_id_name']");
|
||||
var createdByColumn = by.css("div[class*='--text'][title='Created by'] span");
|
||||
var sizeColumn = by.css("div[id*='document-list-container'] div[class*='adf-datatable-row'] .adf-filesize-cell");
|
||||
var createdByColumnHeader = by.css("div[data-automation-id*='auto_id_createdByUser']");
|
||||
var createdColumn = by.css("div[class*='--date'] span");
|
||||
var createdColumnHeader = by.css("div[data-automation-id*='auto_id_createdAt']");
|
||||
var rows = by.css("div[id='document-list-container'] div[class*='adf-datatable-body'] div[class*='adf-datatable-row']");
|
||||
var emptyFolderMessage = element(by.css("div[class='adf-empty-folder-this-space-is-empty']"));
|
||||
var table = element(by.css("div[class*='upload-border']"));
|
||||
var tableBody = element.all(by.css("adf-document-list div[class='adf-datatable-body']")).first();
|
||||
|
||||
this.getRowsName = function (content) {
|
||||
var row = element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + content + "']")).first();
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
};
|
||||
|
||||
this.getRowByRowName = function (content) {
|
||||
Util.waitUntilElementIsOnPage(this.getRowsName(content).element(rowByRowName));
|
||||
Util.waitUntilElementIsVisible(this.getRowsName(content).element(rowByRowName));
|
||||
return this.getRowsName(content).element(rowByRowName);
|
||||
};
|
||||
|
||||
this.getAllDisplayedRows = function () {
|
||||
return element.all(rows).count();
|
||||
};
|
||||
|
||||
this.getAllRowsNameColumn = function () {
|
||||
return this.getAllRowsColumnValues(nameColumn);
|
||||
};
|
||||
|
||||
this.getAllRowsColumnValues = function (locator) {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
var initialList = [];
|
||||
|
||||
element.all(locator).each(function (element) {
|
||||
element.getText().then(function (text) {
|
||||
if (text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.deleteContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
deleteContent.click();
|
||||
};
|
||||
|
||||
this.checkDeleteIsDisabled = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
let disabledDelete = element(by.css("button[data-automation-id*='DELETE'][disabled='true']"));
|
||||
Util.waitUntilElementIsVisible(disabledDelete);
|
||||
};
|
||||
|
||||
this.metadataContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
metadataAction.click();
|
||||
};
|
||||
|
||||
this.versionManagerContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
versionManagerAction.click();
|
||||
};
|
||||
|
||||
this.moveContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
moveContent.click();
|
||||
};
|
||||
|
||||
this.copyContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
copyContent.click();
|
||||
};
|
||||
|
||||
this.waitForContentOptions = function () {
|
||||
Util.waitUntilElementIsVisible(copyContent);
|
||||
Util.waitUntilElementIsVisible(moveContent);
|
||||
Util.waitUntilElementIsVisible(deleteContent);
|
||||
Util.waitUntilElementIsVisible(downloadContent);
|
||||
};
|
||||
|
||||
this.clickOnActionMenu = function (content) {
|
||||
this.getRowByRowName(content).element(optionButton).click();
|
||||
Util.waitUntilElementIsVisible(actionMenu);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.sortByColumn = function (sortOrder, locator) {
|
||||
Util.waitUntilElementIsVisible(element(locator));
|
||||
return element(locator).getAttribute('class').then(function (result) {
|
||||
if (sortOrder === true) {
|
||||
if (!result.includes('sorted-asc')) {
|
||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (result.includes('sorted-asc')) {
|
||||
element(locator).click();
|
||||
} else if (result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Sort the list by name column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
this.sortByName = function (sortOrder) {
|
||||
this.sortByColumn(sortOrder, nameColumnHeader);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sort the list by author column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
this.sortByAuthor = function (sortOrder) {
|
||||
this.sortByColumn(sortOrder, createdByColumnHeader);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sort the list by created column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
this.sortByCreated = function (sortOrder) {
|
||||
this.sortByColumn(sortOrder, createdColumnHeader);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check the list is sorted by name column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
this.checkListIsOrderedByNameColumn = function (sortOrder) {
|
||||
var deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, nameColumn));
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check the list is sorted by author column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
this.checkListIsOrderedByAuthorColumn = function (sortOrder) {
|
||||
var deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, createdByColumn));
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.checkListIsOrderedBySizeColumn = function (sortOrder) {
|
||||
var deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, sizeColumn));
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check the list is sorted by created column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
this.checkListIsOrderedByCreatedColumn = function (sortOrder) {
|
||||
var deferred = protractor.promise.defer();
|
||||
var lastValue;
|
||||
var sorted = true;
|
||||
|
||||
element.all(createdColumn).map(function (element) {
|
||||
return element.getText();
|
||||
}).then(function (texts) {
|
||||
texts.forEach(function (text) {
|
||||
if (lastValue !== undefined) {
|
||||
var currentDate = new Date(text);
|
||||
var lastDate = new Date(lastValue);
|
||||
if (sortOrder === true && currentDate.getTime() < lastDate.getTime()) {
|
||||
sorted = false;
|
||||
}
|
||||
if (sortOrder === false && currentDate.getTime() > lastDate.getTime()) {
|
||||
sorted = false;
|
||||
}
|
||||
}
|
||||
lastValue = text;
|
||||
});
|
||||
deferred.fulfill(sorted);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check the list is sorted.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @param locator: locator for column
|
||||
* @return 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
this.checkListIsSorted = function (sortOrder, locator) {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
var initialList = [];
|
||||
element.all(locator).each(function (element) {
|
||||
element.getText().then(function (text) {
|
||||
initialList.push(text);
|
||||
});
|
||||
}).then(function () {
|
||||
var sortedList = initialList;
|
||||
sortedList = sortedList.sort();
|
||||
if (sortOrder === false) {
|
||||
sortedList = sortedList.reverse();
|
||||
}
|
||||
deferred.fulfill(initialList.toString() === sortedList.toString());
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.navigateToFolder = function (folder) {
|
||||
var row = this.getRowsName(folder);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsOnPage(row);
|
||||
row.click();
|
||||
this.checkRowIsSelected(folder);
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.doubleClickRow = function (selectRow) {
|
||||
var row = this.getRowsName(selectRow);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")));
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.doubleClickEntireRow = function (selectRow) {
|
||||
var row = this.getRowByRowName(selectRow);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")));
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkRowIsSelected = function (content) {
|
||||
var isRowSelected = this.getRowsName(content).element(by.xpath("ancestor::div[contains(@class, 'is-selected')]"));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
};
|
||||
|
||||
this.checkContentIsDisplayed = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkContentIsNotDisplayed = function (filename) {
|
||||
Util.waitUntilElementIsNotVisible(element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + filename + "']")).first());
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getNodeIdByFilename = function (filename) {
|
||||
var nodeIdColumn = element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + filename + "' and @title='Node id']"));
|
||||
var text = nodeIdColumn.getText();
|
||||
return text;
|
||||
};
|
||||
|
||||
this.getAllNodeIdInList = async function (filename) {
|
||||
var nodeIdColumns = await element.all(by.xpath("//div[@id='document-list-container']//div[@title='Node id']"));
|
||||
return await nodeIdColumns.map(async (currentElement) => {
|
||||
return await currentElement.getText().then((nodeText)=>{
|
||||
return nodeText;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.checkEmptyFolderMessageIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(emptyFolderMessage);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.tableIsLoaded = function () {
|
||||
Util.waitUntilElementIsVisible(table);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkIconColumn = function (file, extension) {
|
||||
var row = this.getRowByRowName(file);
|
||||
Util.waitUntilElementIsVisible(row.element(by.css("div[class*='--image'] img[alt*='" + extension + "']")));
|
||||
};
|
||||
|
||||
this.rightClickOnRowNamed = function (rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
};
|
||||
|
||||
this.checkContextActionIsVisible = function (actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
Util.waitUntilElementIsClickable(actionButton);
|
||||
return actionButton;
|
||||
};
|
||||
|
||||
this.pressContextMenuActionNamed = function (actionName) {
|
||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
};
|
||||
|
||||
this.clickRowToSelect = function (rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelected(rowName);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickContentLockIcon = function (content) {
|
||||
var lockIcon = element(by.css('div[filename="'+ content +'"] button'));
|
||||
Util.waitUntilElementIsClickable(lockIcon);
|
||||
lockIcon.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkLockedIcon = function (content) {
|
||||
var lockIcon = element(by.cssContainingText('div[filename="'+ content +'"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkUnlockedIcon = function (content) {
|
||||
var lockIcon = element(by.cssContainingText('div[filename="'+ content +'"] mat-icon', 'lock_open'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.waitForTableBody = function () {
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = ContentList;
|
454
e2e/pages/adf/dialog/contentListPage.ts
Normal file
454
e2e/pages/adf/dialog/contentListPage.ts
Normal file
@@ -0,0 +1,454 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class ContentListPage {
|
||||
|
||||
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
||||
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
|
||||
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
|
||||
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
||||
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
||||
actionMenu = element(by.css('div[role="menu"]'));
|
||||
optionButton = by.css('button[data-automation-id*="action_menu_"]');
|
||||
rowByRowName = by.xpath('ancestor::div[contains(@class, "adf-datatable-row")]');
|
||||
nameColumn = by.css('div[class*="datatable-body"] div[class*="adf-data-table-cell"][title="Display name"]');
|
||||
nameColumnHeader = by.css('div[data-automation-id="auto_id_name"]');
|
||||
createdByColumn = by.css('div[class*="--text"][title="Created by"] span');
|
||||
sizeColumn = by.css('div[id*="document-list-container"] div[class*="adf-datatable-row"] .adf-filesize-cell');
|
||||
createdByColumnHeader = by.css('div[data-automation-id*="auto_id_createdByUser"]');
|
||||
createdColumn = by.css('div[class*="--date"] span');
|
||||
createdColumnHeader = by.css('div[data-automation-id*="auto_id_createdAt"]');
|
||||
rows = by.css('div[id="document-list-container"] div[class*="adf-datatable-body"] div[class*="adf-datatable-row"]');
|
||||
emptyFolderMessage = element(by.css('div[class="adf-empty-folder-this-space-is-empty"]'));
|
||||
table = element(by.css('div[class*="upload-border"]'));
|
||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
|
||||
getTooltip(nodeName) {
|
||||
return this.getRowByRowName(nodeName).element(by.css(`#document-list-container span[title="${nodeName}"]`)).getAttribute('title');
|
||||
}
|
||||
|
||||
getRowsName(content) {
|
||||
let row = element.all(by.css(`#document-list-container span[title='${content}']`)).first();
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
getRowByRowName(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowsName(content).element(this.rowByRowName));
|
||||
return this.getRowsName(content).element(this.rowByRowName);
|
||||
}
|
||||
|
||||
getAllDisplayedRows() {
|
||||
return element.all(this.rows).count();
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
return this.getAllRowsColumnValues(this.nameColumn);
|
||||
}
|
||||
|
||||
getAllRowsColumnValues(locator) {
|
||||
let deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
let initialList = [];
|
||||
|
||||
element.all(locator).each(function (currentElement) {
|
||||
currentElement.getText().then(function (text) {
|
||||
if (text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
deleteContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.deleteContentElement.click();
|
||||
}
|
||||
|
||||
checkDeleteIsDisabled(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
let disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
Util.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
metadataContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.metadataAction.click();
|
||||
}
|
||||
|
||||
versionManagerContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.versionManagerAction.click();
|
||||
}
|
||||
|
||||
moveContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.moveContentElement.click();
|
||||
}
|
||||
|
||||
copyContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.copyContentElement.click();
|
||||
}
|
||||
|
||||
lockContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.lockContentElement.click();
|
||||
}
|
||||
|
||||
waitForContentOptions() {
|
||||
Util.waitUntilElementIsVisible(this.copyContentElement);
|
||||
Util.waitUntilElementIsVisible(this.moveContentElement);
|
||||
Util.waitUntilElementIsVisible(this.deleteContentElement);
|
||||
Util.waitUntilElementIsVisible(this.downloadContent);
|
||||
}
|
||||
|
||||
clickOnActionMenu(content) {
|
||||
this.getRowByRowName(content).element(this.optionButton).click();
|
||||
Util.waitUntilElementIsVisible(this.actionMenu);
|
||||
browser.sleep(500);
|
||||
return this;
|
||||
}
|
||||
|
||||
sortByColumn(sortOrder, locator) {
|
||||
Util.waitUntilElementIsVisible(element(locator));
|
||||
return element(locator).getAttribute('class').then(function (result) {
|
||||
if (sortOrder === true) {
|
||||
if (!result.includes('sorted-asc')) {
|
||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (result.includes('sorted-asc')) {
|
||||
element(locator).click();
|
||||
} else if (result.includes('sortable')) {
|
||||
element(locator).click();
|
||||
element(locator).click();
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the list by name column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
sortByName(sortOrder) {
|
||||
this.sortByColumn(sortOrder, this.nameColumnHeader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the list by author column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
sortByAuthor(sortOrder) {
|
||||
this.sortByColumn(sortOrder, this.createdByColumnHeader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the list by created column.
|
||||
*
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
sortByCreated(sortOrder) {
|
||||
this.sortByColumn(sortOrder, this.createdColumnHeader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the list is sorted by name column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
checkListIsOrderedByNameColumn(sortOrder) {
|
||||
let deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, this.nameColumn));
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the list is sorted by author column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
checkListIsOrderedByAuthorColumn(sortOrder) {
|
||||
let deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, this.createdByColumn));
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
checkListIsOrderedBySizeColumn(sortOrder) {
|
||||
let deferred = protractor.promise.defer();
|
||||
deferred.fulfill(this.checkListIsSorted(sortOrder, this.sizeColumn));
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the list is sorted by created column.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
checkListIsOrderedByCreatedColumn(sortOrder) {
|
||||
let deferred = protractor.promise.defer();
|
||||
let lastValue;
|
||||
let sorted = true;
|
||||
|
||||
element.all(this.createdColumn).map(function (currentElement) {
|
||||
return currentElement.getText();
|
||||
}).then(function (texts) {
|
||||
texts.forEach(function (text) {
|
||||
if (lastValue !== undefined) {
|
||||
let currentDate = new Date(text);
|
||||
let lastDate = new Date(lastValue);
|
||||
if (sortOrder === true && currentDate.getTime() < lastDate.getTime()) {
|
||||
sorted = false;
|
||||
}
|
||||
if (sortOrder === false && currentDate.getTime() > lastDate.getTime()) {
|
||||
sorted = false;
|
||||
}
|
||||
}
|
||||
lastValue = text;
|
||||
});
|
||||
deferred.fulfill(sorted);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the list is sorted.
|
||||
*
|
||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||
* @param locator: locator for column
|
||||
* @return 'true' if the list is sorted as expected and 'false' if it isn't
|
||||
*/
|
||||
checkListIsSorted(sortOrder, locator) {
|
||||
let deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||
let initialList = [];
|
||||
element.all(locator).each(function (currentElement) {
|
||||
currentElement.getText().then(function (text) {
|
||||
initialList.push(text);
|
||||
});
|
||||
}).then(function () {
|
||||
let sortedList = initialList;
|
||||
sortedList = sortedList.sort();
|
||||
if (sortOrder === false) {
|
||||
sortedList = sortedList.reverse();
|
||||
}
|
||||
deferred.fulfill(initialList.toString() === sortedList.toString());
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
navigateToFolder(folder) {
|
||||
let row = this.getRowsName(folder);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsOnPage(row);
|
||||
row.click();
|
||||
this.checkRowIsSelected(folder);
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
doubleClickRow(selectRow) {
|
||||
let row = this.getRowsName(selectRow);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)));
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
doubleClickEntireRow(selectRow) {
|
||||
let row = this.getRowByRowName(selectRow);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)));
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkRowIsSelected(content) {
|
||||
let isRowSelected = this.getRowsName(content).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content));
|
||||
return this;
|
||||
}
|
||||
|
||||
getNodeIdByFilename(filename) {
|
||||
let nodeIdColumn = element.all(by.xpath(`//div[@id='document-list-container']//div[@filename='${filename}' and @title='Node id']`));
|
||||
return nodeIdColumn.getText();
|
||||
}
|
||||
|
||||
async getAllNodeIdInList() {
|
||||
let nodeIdColumns = await element.all(by.xpath(`//div[@id='document-list-container']//div[@title='Node id']`));
|
||||
return await nodeIdColumns.map(async (currentElement) => {
|
||||
return await currentElement.getText().then((nodeText) => {
|
||||
return nodeText;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
checkEmptyFolderMessageIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.emptyFolderMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
tableIsLoaded() {
|
||||
Util.waitUntilElementIsVisible(this.table);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkIconColumn(file, extension) {
|
||||
let row = this.getRowByRowName(file);
|
||||
Util.waitUntilElementIsVisible(row.element(by.css(`div[class*='--image'] img[alt*="${extension}"]`)));
|
||||
}
|
||||
|
||||
rightClickOnRowNamed(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
Util.waitUntilElementIsClickable(actionButton);
|
||||
return actionButton;
|
||||
}
|
||||
|
||||
pressContextMenuActionNamed(actionName) {
|
||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
}
|
||||
|
||||
clickRowToSelect(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelected(rowName);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUnlockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock_open'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
Util.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
checkContentIsNotDisplayed(filename) {
|
||||
Util.waitUntilElementIsNotVisible(element.all(by.css(`#document-list-container span[title='${filename}']`)).first());
|
||||
return this;
|
||||
}
|
||||
|
||||
getNodeIdByFilename(filename) {
|
||||
let nodeIdColumn = element.all(by.xpath(`//div[@id='document-list-container']//div[@filename="${filename}" and @title='Node id']`));
|
||||
let text = nodeIdColumn.getText();
|
||||
return text;
|
||||
}
|
||||
|
||||
checkEmptyFolderMessageIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.emptyFolderMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
tableIsLoaded() {
|
||||
Util.waitUntilElementIsVisible(this.table);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkIconColumn(file, extension) {
|
||||
let row = this.getRowByRowName(file);
|
||||
Util.waitUntilElementIsVisible(row.element(by.css(`div[class*='--image'] img[alt*="${extension}"]`)));
|
||||
}
|
||||
|
||||
rightClickOnRowNamed(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
Util.waitUntilElementIsClickable(actionButton);
|
||||
return actionButton;
|
||||
}
|
||||
|
||||
pressContextMenuActionNamed(actionName) {
|
||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
}
|
||||
|
||||
clickRowToSelect(rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelected(rowName);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUnlockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock_open'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
Util.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
|
||||
var CreateFolderDialog = function () {
|
||||
|
||||
var folderNameField = element(by.id('adf-folder-name-input'));
|
||||
var folderDescriptionField = element(by.id('adf-folder-description-input'));
|
||||
var createButton = element(by.id('adf-folder-create-button'));
|
||||
var cancelButton = element(by.id('adf-folder-cancel-button'));
|
||||
|
||||
this.clickOnCreateButton = function () {
|
||||
Util.waitUntilElementIsVisible(createButton);
|
||||
createButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkCreateBtnIsDisabled = function () {
|
||||
Util.waitUntilElementIsVisible(createButton.getAttribute("disabled"));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkCreateBtnIsEnabled = function () {
|
||||
createButton.isEnabled();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnCancelButton = function () {
|
||||
Util.waitUntilElementIsVisible(cancelButton);
|
||||
cancelButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.addFolderName = function (folderName) {
|
||||
Util.waitUntilElementIsVisible(folderNameField);
|
||||
folderNameField.clear().sendKeys(folderName);
|
||||
browser.driver.sleep(500);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.addFolderDescription = function (folderDescription) {
|
||||
Util.waitUntilElementIsVisible(folderDescriptionField);
|
||||
folderDescriptionField.clear().sendKeys(folderDescription);
|
||||
return this;
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = CreateFolderDialog;
|
65
e2e/pages/adf/dialog/createFolderDialog.ts
Normal file
65
e2e/pages/adf/dialog/createFolderDialog.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class CreateFolderDialog {
|
||||
folderNameField = element(by.id('adf-folder-name-input'));
|
||||
folderDescriptionField = element(by.id('adf-folder-description-input'));
|
||||
createButton = element(by.id('adf-folder-create-button'));
|
||||
cancelButton = element(by.id('adf-folder-cancel-button'));
|
||||
|
||||
clickOnCreateButton() {
|
||||
Util.waitUntilElementIsVisible(this.createButton);
|
||||
this.createButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkCreateBtnIsDisabled() {
|
||||
Util.waitUntilElementIsVisible(this.createButton);
|
||||
expect(this.createButton.getAttribute('disabled')).toEqual('true');
|
||||
return this;
|
||||
}
|
||||
|
||||
checkCreateBtnIsEnabled() {
|
||||
this.createButton.isEnabled();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnCancelButton() {
|
||||
Util.waitUntilElementIsVisible(this.cancelButton);
|
||||
this.cancelButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
addFolderName(folderName) {
|
||||
Util.waitUntilElementIsVisible(this.folderNameField);
|
||||
this.folderNameField.clear();
|
||||
this.folderNameField.sendKeys(folderName);
|
||||
browser.driver.sleep(500);
|
||||
return this;
|
||||
}
|
||||
|
||||
addFolderDescription(folderDescription) {
|
||||
Util.waitUntilElementIsVisible(this.folderDescriptionField);
|
||||
this.folderDescriptionField.clear();
|
||||
this.folderDescriptionField.sendKeys(folderDescription);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@@ -1,129 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
|
||||
var SearchDialog = function () {
|
||||
|
||||
var searchIcon = element(by.css("button[class*='adf-search-button']"));
|
||||
var searchBar = element(by.css("adf-search-control div[style*='translateX(0%)'] input"));
|
||||
var searchBarNotExpanded = element(by.css("adf-search-control div[style*='translateX(81%)']"));
|
||||
var no_result_message = element(by.css("p[class*='adf-search-fixed-text']"));
|
||||
var rowsAuthor = by.css("div[class='mat-list-text'] p[class*='adf-search-fixed-text']");
|
||||
var completeName = by.css("h4[class*='adf-search-fixed-text']");
|
||||
var highlightName = by.css("div[id*='results-content'] span[class='highlight']");
|
||||
var searchDialog = element(by.css("mat-list[id*='autocomplete-search-result-list']"));
|
||||
|
||||
this.pressDownArrowAndEnter = function () {
|
||||
element(by.css("adf-search-control div input")).sendKeys(protractor.Key.ARROW_DOWN);
|
||||
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
};
|
||||
|
||||
|
||||
this.clickOnSearchIcon = function () {
|
||||
Util.waitUntilElementIsVisible(searchIcon);
|
||||
searchIcon.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkSearchIconIsVisible = function () {
|
||||
Util.waitUntilElementIsVisible(searchIcon);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkSearchBarIsVisible = function () {
|
||||
Util.waitUntilElementIsVisible(searchBar);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkSearchBarIsNotVisible = function () {
|
||||
Util.waitUntilElementIsVisible(searchBarNotExpanded);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkNoResultMessageIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(no_result_message);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkNoResultMessageIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(no_result_message);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enterText = function (text) {
|
||||
Util.waitUntilElementIsVisible(searchBar);
|
||||
searchBar.click();
|
||||
searchBar.sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enterTextAndPressEnter = function (text) {
|
||||
Util.waitUntilElementIsVisible(searchBar);
|
||||
searchBar.click();
|
||||
searchBar.sendKeys(text);
|
||||
searchBar.sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.resultTableContainsRow = function (name) {
|
||||
Util.waitUntilElementIsVisible(searchDialog);
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(name));
|
||||
return this;
|
||||
};
|
||||
this.clickOnSpecificRow = function (name) {
|
||||
this.resultTableContainsRow(name);
|
||||
this.getRowByRowName(name).click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getRowByRowName = function (name) {
|
||||
return element(by.css("mat-list-item[data-automation-id='autocomplete_for_" + name + "']"));
|
||||
};
|
||||
|
||||
this.getSpecificRowsHighlightName = function (name) {
|
||||
var deferred = protractor.promise.defer();
|
||||
this.getRowByRowName(name).element(highlightName).getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
})
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getSpecificRowsCompleteName = function (name) {
|
||||
var deferred = protractor.promise.defer();
|
||||
this.getRowByRowName(name).element(completeName).getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
})
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getSpecificRowsAuthor = function (name) {
|
||||
var deferred = protractor.promise.defer();
|
||||
this.getRowByRowName(name).element(rowsAuthor).getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
})
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.clearText = function () {
|
||||
Util.waitUntilElementIsVisible(searchBar);
|
||||
var deferred = protractor.promise.defer();
|
||||
searchBar.clear();
|
||||
return deferred.promise;
|
||||
};
|
||||
};
|
||||
module.exports = SearchDialog;
|
116
e2e/pages/adf/dialog/searchDialog.ts
Normal file
116
e2e/pages/adf/dialog/searchDialog.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../../util/util';
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
|
||||
export class SearchDialog {
|
||||
|
||||
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
||||
searchBar = element(by.css(`adf-search-control div[style*='translateX(0%)'] input`));
|
||||
searchBarNotExpanded = element(by.css(`adf-search-control div[style*='translateX(81%)'] input`));
|
||||
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||
rowsAuthor = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
|
||||
completeName = by.css(`h4[class*='adf-search-fixed-text']`);
|
||||
highlightName = by.css(`.adf-highlight`);
|
||||
searchDialog = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
||||
|
||||
pressDownArrowAndEnter() {
|
||||
element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN);
|
||||
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
clickOnSearchIcon() {
|
||||
Util.waitUntilElementIsVisible(this.searchIcon);
|
||||
this.searchIcon.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSearchIconIsVisible() {
|
||||
Util.waitUntilElementIsVisible(this.searchIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSearchBarIsVisible() {
|
||||
Util.waitUntilElementIsVisible(this.searchBar);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSearchBarIsNotVisible() {
|
||||
browser.sleep(400);
|
||||
Util.waitUntilElementIsVisible(this.searchBarNotExpanded);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkNoResultMessageIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.noResultMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkNoResultMessageIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.noResultMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
enterText(text) {
|
||||
Util.waitUntilElementIsVisible(this.searchBar);
|
||||
this.searchBar.click();
|
||||
this.searchBar.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
enterTextAndPressEnter(text) {
|
||||
Util.waitUntilElementIsVisible(this.searchBar);
|
||||
this.searchBar.click();
|
||||
this.searchBar.sendKeys(text);
|
||||
this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
}
|
||||
|
||||
resultTableContainsRow(name) {
|
||||
Util.waitUntilElementIsVisible(this.searchDialog);
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(name));
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnSpecificRow(name) {
|
||||
this.resultTableContainsRow(name);
|
||||
this.getRowByRowName(name).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getRowByRowName(name) {
|
||||
return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`));
|
||||
}
|
||||
|
||||
getSpecificRowsHighlightName(name) {
|
||||
return this.getRowByRowName(name).element(this.highlightName).getText();
|
||||
}
|
||||
|
||||
getSpecificRowsCompleteName(name) {
|
||||
return this.getRowByRowName(name).element(this.completeName).getText();
|
||||
}
|
||||
|
||||
getSpecificRowsAuthor(name) {
|
||||
return this.getRowByRowName(name).element(this.rowsAuthor).getText();
|
||||
}
|
||||
|
||||
clearText() {
|
||||
Util.waitUntilElementIsVisible(this.searchBar);
|
||||
return this.searchBar.clear();
|
||||
}
|
||||
}
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
import { FormControllersPage } from '../material/formControllersPage';
|
||||
|
||||
export class ShareDialog {
|
||||
formControllersPage = new FormControllersPage();
|
||||
|
||||
formControllersPage = new FormControllersPage();
|
||||
shareDialog = element(by.css('adf-share-dialog'));
|
||||
dialogTitle = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
@@ -116,15 +116,16 @@ export class ShareDialog {
|
||||
}
|
||||
|
||||
setDefaultDay() {
|
||||
const selector = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
|
||||
const selector = '.mat-datetimepicker-calendar-body-cell:not(.mat-datetimepicker-calendar-body-disabled)';
|
||||
Util.waitUntilElementIsVisible(this.dayPicker);
|
||||
let tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).getDate().toString();
|
||||
let tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDate().toString();
|
||||
this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click();
|
||||
}
|
||||
|
||||
setDefaultHour() {
|
||||
const selector = '.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)';
|
||||
Util.waitUntilElementIsVisible(this.clockPicker);
|
||||
Util.waitUntilElementIsVisible(this.hoursPicker);
|
||||
this.hoursPicker.all(by.css(selector)).first().click();
|
||||
}
|
||||
|
||||
|
@@ -1,191 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
|
||||
var UploadDialog = function () {
|
||||
|
||||
var closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
var dialog = element(by.css("div[id='upload-dialog']"));
|
||||
var minimizedDialog = element(by.css("div[class*='upload-dialog--minimized']"));
|
||||
var uploadedStatusIcon = by.css("mat-icon[class*='status--done']");
|
||||
var cancelledStatusIcon = by.css("div[class*='status--cancelled']");
|
||||
var errorStatusIcon = by.css("div[class*='status--error']");
|
||||
var cancelWhileUploadingIcon = by.css("mat-icon[class*='adf-file-uploading-row__action adf-file-uploading-row__action--cancel']");
|
||||
var rowByRowName = by.xpath("ancestor::adf-file-uploading-list-row");
|
||||
var title = element(by.css("span[class*='upload-dialog__title']"));
|
||||
var minimizeButton = element(by.css("mat-icon[title='Minimize']"));
|
||||
var maximizeButton = element(by.css("mat-icon[title='Maximize']"));
|
||||
var sizeUploaded = by.css("span[class='adf-file-uploading-row__status']");
|
||||
var canUploadConfirmationTitle = element(by.css("p[class='upload-dialog__confirmation--title']"));
|
||||
var canUploadConfirmationDescription = element(by.css("p[class='upload-dialog__confirmation--text']"));
|
||||
var confirmationDialogNoButton = element(by.partialButtonText("No"));
|
||||
var confirmationDialogYesButton = element(by.partialButtonText("Yes"));
|
||||
var cancelUploads = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
|
||||
this.clickOnCloseButton = function () {
|
||||
this.checkCloseButtonIsDisplayed();
|
||||
closeButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkCloseButtonIsDisplayed = function() {
|
||||
Util.waitUntilElementIsVisible(closeButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.dialogIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(dialog);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.dialogIsMinimized = function () {
|
||||
Util.waitUntilElementIsVisible(minimizedDialog);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.dialogIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(dialog);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getRowsName = function (content) {
|
||||
var row = element.all(by.css("div[class*='uploading-row'] span[title='" + content +"']")).first();
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
};
|
||||
|
||||
this.getRowByRowName = function (content) {
|
||||
return this.getRowsName(content).element(rowByRowName);
|
||||
};
|
||||
|
||||
this.fileIsUploaded = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(uploadedStatusIcon));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.fileIsError = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(errorStatusIcon));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.filesAreUploaded = function (content) {
|
||||
for (var i=0; i<content.length; i++) {
|
||||
this.fileIsUploaded(content[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
this.fileIsNotDisplayedInDialog = function (content) {
|
||||
Util.waitUntilElementIsNotVisible(element(by.css("div[class*='uploading-row'] span[title='" + content +"']")));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.cancelUploads = function () {
|
||||
Util.waitUntilElementIsVisible(cancelUploads);
|
||||
cancelUploads.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.fileIsCancelled = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(cancelledStatusIcon));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.removeUploadedFile = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(uploadedStatusIcon));
|
||||
this.getRowByRowName(content).element(uploadedStatusIcon).click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.removeFileWhileUploading = function (content) {
|
||||
browser.driver.actions().mouseMove(this.getRowByRowName(content).element(sizeUploaded)).perform();
|
||||
this.getRowByRowName(content).element(cancelWhileUploadingIcon).click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getTitleText = function () {
|
||||
Util.waitUntilElementIsVisible(title);
|
||||
var deferred = protractor.promise.defer();
|
||||
title.getText().then( function (text) {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getConfirmationDialogTitleText = function () {
|
||||
Util.waitUntilElementIsVisible(canUploadConfirmationTitle);
|
||||
var deferred = protractor.promise.defer();
|
||||
canUploadConfirmationTitle.getText().then( function (text) {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getConfirmationDialogDescriptionText = function () {
|
||||
Util.waitUntilElementIsVisible(canUploadConfirmationDescription);
|
||||
var deferred = protractor.promise.defer();
|
||||
canUploadConfirmationDescription.getText().then( function (text) {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.clickOnConfirmationDialogYesButton = function () {
|
||||
Util.waitUntilElementIsVisible(confirmationDialogYesButton);
|
||||
confirmationDialogYesButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnConfirmationDialogNoButton = function () {
|
||||
Util.waitUntilElementIsVisible(confirmationDialogNoButton);
|
||||
confirmationDialogNoButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.numberOfCurrentFilesUploaded = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
this.getTitleText().then(function (text) {
|
||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.numberOfInitialFilesUploaded = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
this.getTitleText().then(function (text) {
|
||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.minimizeUploadDialog = function () {
|
||||
Util.waitUntilElementIsVisible(minimizeButton);
|
||||
minimizeButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.maximizeUploadDialog = function () {
|
||||
Util.waitUntilElementIsVisible(maximizeButton);
|
||||
maximizeButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = UploadDialog;
|
||||
|
188
e2e/pages/adf/dialog/uploadDialog.ts
Normal file
188
e2e/pages/adf/dialog/uploadDialog.ts
Normal file
@@ -0,0 +1,188 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class UploadDialog {
|
||||
|
||||
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
dialog = element(by.css('div[id="upload-dialog"]'));
|
||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
||||
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
||||
errorStatusIcon = by.css('div[class*="status--error"]');
|
||||
cancelWhileUploadingIcon = by.css('mat-icon[class*="adf-file-uploading-row__action adf-file-uploading-row__action--cancel"]');
|
||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
||||
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
||||
sizeUploaded = by.css('span[class="adf-file-uploading-row__status"]');
|
||||
canUploadConfirmationTitle = element(by.css('p[class="upload-dialog__confirmation--title"]'));
|
||||
canUploadConfirmationDescription = element(by.css('p[class="upload-dialog__confirmation--text"]'));
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
|
||||
clickOnCloseButton() {
|
||||
this.checkCloseButtonIsDisplayed();
|
||||
this.closeButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkCloseButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.closeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
dialogIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.dialog);
|
||||
return this;
|
||||
}
|
||||
|
||||
dialogIsMinimized() {
|
||||
Util.waitUntilElementIsVisible(this.minimizedDialog);
|
||||
return this;
|
||||
}
|
||||
|
||||
dialogIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.dialog);
|
||||
return this;
|
||||
}
|
||||
|
||||
getRowsName(content) {
|
||||
let row = element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
getRowByRowName(content) {
|
||||
return this.getRowsName(content).element(this.rowByRowName);
|
||||
}
|
||||
|
||||
fileIsUploaded(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.uploadedStatusIcon));
|
||||
return this;
|
||||
}
|
||||
|
||||
fileIsError(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.errorStatusIcon));
|
||||
return this;
|
||||
}
|
||||
|
||||
filesAreUploaded(content) {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
this.fileIsUploaded(content[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
fileIsNotDisplayedInDialog(content) {
|
||||
Util.waitUntilElementIsNotVisible(element(by.css(`div[class*='uploading-row'] span[title="${content}"]`)));
|
||||
return this;
|
||||
}
|
||||
|
||||
cancelUploads() {
|
||||
Util.waitUntilElementIsVisible(this.cancelUploadsElement);
|
||||
this.cancelUploadsElement.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
fileIsCancelled(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.cancelledStatusIcon));
|
||||
return this;
|
||||
}
|
||||
|
||||
removeUploadedFile(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.uploadedStatusIcon));
|
||||
this.getRowByRowName(content).element(this.uploadedStatusIcon).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
removeFileWhileUploading(content) {
|
||||
browser.driver.actions().mouseMove(this.getRowByRowName(content).element(this.sizeUploaded)).perform();
|
||||
this.getRowByRowName(content).element(this.cancelWhileUploadingIcon).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getTitleText() {
|
||||
Util.waitUntilElementIsVisible(this.title);
|
||||
let deferred = protractor.promise.defer();
|
||||
this.title.getText().then((text) => {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
getConfirmationDialogTitleText() {
|
||||
Util.waitUntilElementIsVisible(this.canUploadConfirmationTitle);
|
||||
let deferred = protractor.promise.defer();
|
||||
this.canUploadConfirmationTitle.getText().then((text) => {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
getConfirmationDialogDescriptionText() {
|
||||
Util.waitUntilElementIsVisible(this.canUploadConfirmationDescription);
|
||||
let deferred = protractor.promise.defer();
|
||||
this.canUploadConfirmationDescription.getText().then((text) => {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
clickOnConfirmationDialogYesButton() {
|
||||
Util.waitUntilElementIsVisible(this.confirmationDialogYesButton);
|
||||
this.confirmationDialogYesButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnConfirmationDialogNoButton() {
|
||||
Util.waitUntilElementIsVisible(this.confirmationDialogNoButton);
|
||||
this.confirmationDialogNoButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
numberOfCurrentFilesUploaded() {
|
||||
let deferred = protractor.promise.defer();
|
||||
this.getTitleText().then((text) => {
|
||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
numberOfInitialFilesUploaded() {
|
||||
let deferred = protractor.promise.defer();
|
||||
this.getTitleText().then((text) => {
|
||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
minimizeUploadDialog() {
|
||||
Util.waitUntilElementIsVisible(this.minimizeButton);
|
||||
this.minimizeButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
maximizeUploadDialog() {
|
||||
Util.waitUntilElementIsVisible(this.maximizeButton);
|
||||
this.maximizeButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@@ -17,7 +17,8 @@
|
||||
|
||||
import { FormControllersPage } from '../material/formControllersPage';
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
import { by, element, protractor } from 'protractor';
|
||||
|
||||
export class UploadToggles {
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
import { TabsPage } from '../material/tabsPage';
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
|
||||
|
@@ -1,778 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Page = require('astrolabe').Page;
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var contentServices = element(by.css("a[data-automation-id='files'] span"));
|
||||
var siteList = element(by.css("md-select[class*='dropdown-list']"));
|
||||
var folderID = element(by.css('adf-files-component p'));
|
||||
var folderText = element(by.css("md-input-container[class*='adf-create-folder--name'] input"));
|
||||
var createButtonDialog = element(by.xpath("//span[contains(text(), 'Create')]/ancestor::button"));
|
||||
var createFolderButton = element(by.xpath("//md-icon[contains(text(), 'create_new_folder')]"));
|
||||
var currentFolder = element(by.xpath("//div[@class='adf-breadcrumb-container']/li[last()]/div"));
|
||||
var deleteContent = element(by.css("button[adf-node-permission='delete']"));
|
||||
|
||||
/**
|
||||
* Provides the Login Page.
|
||||
* @module pages
|
||||
* @submodule share
|
||||
* @class pages.share.LoginPage
|
||||
*/
|
||||
module.exports = Page.create({
|
||||
|
||||
/**
|
||||
* Provides the document list.
|
||||
* @property documentList
|
||||
* @type protractor.Element
|
||||
*/
|
||||
documentList: {
|
||||
get: function () {
|
||||
return element(by.css("tr[class='alfresco-datatable__row'] > td"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the upload button.
|
||||
* @property uploadButton
|
||||
* @type protractor.Element
|
||||
*/
|
||||
uploadButton: {
|
||||
get: function () {
|
||||
return element(by.css("input[data-automation-id='upload-single-file']"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the mutiple upload button .
|
||||
* @property uploadButton
|
||||
* @type protractor.Elementx
|
||||
*/
|
||||
multipleUploadButton: {
|
||||
get: function () {
|
||||
return element(by.css("input[data-automation-id='upload-multiple-files']"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the mutiple upload button enabled
|
||||
* @property multipleUploadEnabled
|
||||
* @type protractor.Element
|
||||
*/
|
||||
multipleUploadEnabled: {
|
||||
get: function () {
|
||||
return element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-multiple-files='true']"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the extensions accepted text field
|
||||
* @property acceptedFilesText
|
||||
* @type protractor.Element
|
||||
*/
|
||||
acceptedFilesText: {
|
||||
get: function () {
|
||||
return element(by.css("input[data-automation-id='accepted-files-type']"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the create folder button
|
||||
* @property createFolderButton
|
||||
* @type protractor.Element
|
||||
*/
|
||||
createFolderButton: {
|
||||
get: function () {
|
||||
return element(by.cssContainingText("button[id='actions'] > i", "add"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the create new folder button in dialog
|
||||
* @property createFolderButton
|
||||
* @type protractor.Element
|
||||
*/
|
||||
createFolderButtonDialog: {
|
||||
get: function () {
|
||||
return element(by.cssContainingText("span[class='mdl-menu__text']", "New Folder"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the longer wait required
|
||||
* @property goToDocList
|
||||
* @type protractor.Element
|
||||
* */
|
||||
goToDocList: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(contentServices);
|
||||
contentServices.click();
|
||||
Util.waitUntilElementIsVisible(siteList);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the longer wait required
|
||||
* @property waitForElements
|
||||
* @type protractor.Element
|
||||
* */
|
||||
waitForElements: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates new folder
|
||||
* @property createFolder
|
||||
* */
|
||||
createFolder: {
|
||||
value: function (folderName) {
|
||||
Util.waitUntilElementIsVisible(createFolderButton);
|
||||
createFolderButton.click();
|
||||
Util.waitUntilElementIsVisible(folderText);
|
||||
folderText.sendKeys(folderName);
|
||||
createButtonDialog.click();
|
||||
this.checkItemInDocList(folderName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Deletes content
|
||||
* @property deleteContent
|
||||
* */
|
||||
deleteContent: {
|
||||
value: function (contentName) {
|
||||
var contentElement = element(by.css("div[data-automation-id*='text_" + contentName + "']"));
|
||||
Util.waitUntilElementIsVisible(contentElement);
|
||||
contentElement.click();
|
||||
deleteContent.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieve row by row number
|
||||
*
|
||||
* @param rowNumber
|
||||
*/
|
||||
getRowByRowNumber: {
|
||||
value: function (rowNumber) {
|
||||
return element(by.css("div[data-automation-id='text_" + rowNumber + "']"));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Go into folder
|
||||
* @property goIntoFolder
|
||||
* */
|
||||
goIntoFolder: {
|
||||
value: function (folderName) {
|
||||
this.checkItemInDocList(folderName);
|
||||
browser.actions().doubleClick(element(by.css("div[data-automation-id*='text_" + folderName + "']"))).perform();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Go into folder via breadcrumb
|
||||
* @property goIntoFolderViaBreadcrumbs
|
||||
* */
|
||||
goIntoFolderViaBreadcrumbs: {
|
||||
value: function (folderName) {
|
||||
var breadcrumb = element(by.cssContainingText("a[data-automation-id='breadcrumb_" + folderName + "']", folderName));
|
||||
|
||||
Util.waitUntilElementIsVisible(breadcrumb);
|
||||
breadcrumb.click();
|
||||
this.waitForElements();
|
||||
}
|
||||
},
|
||||
|
||||
currentFolderName: {
|
||||
value: function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(currentFolder);
|
||||
currentFolder.getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
})
|
||||
return deferred.promise;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Go into folder
|
||||
* @property goIntoFolder
|
||||
* */
|
||||
checkFolderInBreadcrumbs: {
|
||||
value: function (folderName) {
|
||||
var breadcrumb = element(by.cssContainingText("a[data-automation-id='breadcrumb_" + folderName + "']", folderName));
|
||||
|
||||
Util.waitUntilElementIsVisible(breadcrumb);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check file/fodler in document list
|
||||
* @property checkItemInDocList
|
||||
* */
|
||||
checkItemInDocList: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName)));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check file is not in document list
|
||||
* @property checkFileIsNotInDocList
|
||||
* */
|
||||
checkFileIsNotInDocList: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsNotOnPage(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName)));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check number of times file appears in document list
|
||||
* @property checkNumberOfFilesInDocList
|
||||
* */
|
||||
checkNumberOfFilesInDocList: {
|
||||
value: function (fileName, numberOfFiles) {
|
||||
this.checkItemInDocList(fileName);
|
||||
|
||||
var file = element.all(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName));
|
||||
expect(file.count()).toEqual(numberOfFiles);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* uploads file
|
||||
* @property uploadFile
|
||||
* */
|
||||
uploadFile: {
|
||||
value: function (fileLocation, fileName) {
|
||||
var uploadButton = element(by.css("input[data-automation-id='upload-single-file']"));
|
||||
Util.waitUntilElementIsVisible(uploadButton);
|
||||
Util.uploadFile(uploadButton, uploadButton, fileLocation);
|
||||
this.checkItemInDocList(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* uploads file without checking document list
|
||||
* @property uploadFileWithoutCheck
|
||||
* */
|
||||
uploadFileWithoutCheck: {
|
||||
value: function (fileLocation) {
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
Util.uploadFile(this.uploadButton, this.uploadButton, fileLocation);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check file in upload dialog
|
||||
* @property checkFileInUploadDialog
|
||||
* */
|
||||
checkFileInUploadDialog: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("td[data-automation-id='dialog_" + fileName + "'] > div", fileName)));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check all uploads are complete
|
||||
* @property checkAllUploadsComplete
|
||||
* */
|
||||
checkAllUploadsComplete: {
|
||||
value: function (fileName) {
|
||||
var dialogUpload = element.all(by.css("td[data-automation-id*='dialog_']"));
|
||||
var singleUpload = element(by.cssContainingText("div[ng-reflect-klass='file-dialog'] div[class='title'] ", "upload complete"));
|
||||
var multipleUploads = element(by.cssContainingText("div[ng-reflect-klass='file-dialog'] div[class='title'] ", "uploads complete"));
|
||||
|
||||
dialogUpload.count().then(function (count) {
|
||||
if (count === 1) {
|
||||
Util.waitUntilElementIsVisible(singleUpload);
|
||||
}
|
||||
else if (count > 1) {
|
||||
Util.waitUntilElementIsVisible(multipleUploads);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check done icon for file
|
||||
* @property checkDoneIcon
|
||||
* */
|
||||
checkDoneIcon: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.xpath("//i[contains(@data-automation-id, 'done_icon')]/../../../td[contains(@data-automation-id, '" + fileName + "')]")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check abort icon for file
|
||||
* @property checkUploadAbortedIcon
|
||||
* */
|
||||
checkAbortedIcon: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.xpath("//i[contains(@data-automation-id, 'upload_stopped')]/../../../td[contains(@data-automation-id, '" + fileName + "')]")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check progress bar in dialog
|
||||
* @property checkDoneIcon
|
||||
* */
|
||||
checkProgressBar: {
|
||||
value: function (fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='dialog_progress_" + fileName + "']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check upload dialog
|
||||
* @property checkUploadDialog
|
||||
* */
|
||||
checkUploadDialog: {
|
||||
value: function (fileName) {
|
||||
var uploadDialog = element(by.css("file-uploading-dialog[class='dialog-show'] > div[class='file-dialog show']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(uploadDialog);
|
||||
this.checkFileInUploadDialog(fileName);
|
||||
this.checkAllUploadsComplete();
|
||||
this.checkDoneIcon(fileName);
|
||||
this.checkProgressBar(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close upload dialog
|
||||
* @property closeUploadDialog
|
||||
* */
|
||||
closeUploadDialog: {
|
||||
value: function () {
|
||||
var closeDialog = element(by.css("div[title='close upload list'] > i"));
|
||||
Util.waitUntilElementIsVisible(closeDialog);
|
||||
closeDialog.click();
|
||||
Util.waitUntilElementIsNotOnPage(closeDialog);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Minimise upload dialog
|
||||
* @property minimiseUploadDialog
|
||||
* */
|
||||
minimiseUploadDialog: {
|
||||
value: function () {
|
||||
var minimiseDialog = element(by.css("div[class='minimize-button'] > i[title='minimize upload list']"));
|
||||
Util.waitUntilElementIsVisible(minimiseDialog);
|
||||
minimiseDialog.click();
|
||||
Util.waitUntilElementIsNotOnPage(minimiseDialog);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Maximise upload dialog
|
||||
* @property maximiseUploadDialog
|
||||
* */
|
||||
maximiseUploadDialog: {
|
||||
value: function () {
|
||||
var maximiseDialog = element(by.css("div[class='minimize-button active'] > i[title='expand upload list']"));
|
||||
Util.waitUntilElementIsVisible(maximiseDialog);
|
||||
maximiseDialog.click();
|
||||
Util.waitUntilElementIsNotOnPage(maximiseDialog);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click undo upload via message window
|
||||
* @property clickUndoUploadViaWindow
|
||||
* */
|
||||
clickUndoUploadViaWindow: {
|
||||
value: function () {
|
||||
var notificationWindow = element(by.css("div[id='undo-notification-bar']"));
|
||||
var undoButton = element(by.css("alfresco-upload-button div[id='undo-notification-bar'] > button[data-automation-id='undo_upload_button']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(notificationWindow);
|
||||
Util.waitUntilElementIsVisible(undoButton);
|
||||
undoButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Undo upload via window
|
||||
* @property undoUploadViaWindow
|
||||
* */
|
||||
undoUploadViaWindow: {
|
||||
value: function (fileName) {
|
||||
this.clickUndoUploadViaWindow();
|
||||
this.checkFileIsNotInDocList(fileName);
|
||||
this.checkAbortedIcon(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click undo upload via upload dialog
|
||||
* @property clickUndoUploadViaWindow
|
||||
* */
|
||||
clickUndoUploadViaDialog: {
|
||||
value: function (fileName) {
|
||||
var dialog = element(by.css("file-uploading-dialog[class='dialog-show']"));
|
||||
var undoIcon = element(by.xpath("//i[contains(@data-automation-id, 'abort_cancel_upload')]/../../../td[contains(@data-automation-id, '" + fileName + "')]"));
|
||||
|
||||
Util.waitUntilElementIsVisible(dialog);
|
||||
Util.waitUntilElementIsVisible(undoIcon);
|
||||
undoIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Undo upload via dialog
|
||||
* @property undoUploadViaDialog
|
||||
* */
|
||||
undoUploadViaDialog: {
|
||||
value: function (fileName) {
|
||||
this.clickUndoUploadViaDialog(fileName);
|
||||
this.checkFileIsNotInDocList(fileName);
|
||||
this.checkAbortedIcon(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click cancel upload via upload dialog
|
||||
* @property clickUndoUploadViaWindow
|
||||
* */
|
||||
clickCancelUploadViaDialog: {
|
||||
value: function () {
|
||||
var dialog = element(by.css("file-uploading-dialog[class='dialog-show']"));
|
||||
var cancelButton = element(by.css("a[data-automation-id='cancel_upload_all']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(dialog);
|
||||
Util.waitUntilElementIsVisible(cancelButton);
|
||||
cancelButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* cancel upload via dialog
|
||||
* @property undoUploadViaDialog
|
||||
* */
|
||||
cancelUploadViaDialog: {
|
||||
value: function (fileName) {
|
||||
this.clickCancelUploadViaDialog();
|
||||
this.checkFileIsNotInDocList(fileName);
|
||||
this.checkAbortedIcon(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable multiple file upload
|
||||
* @property enableMultipleFileUpload
|
||||
* */
|
||||
enableMultipleFileUpload: {
|
||||
value: function () {
|
||||
var multiFileUploadSwitch = element(by.css("label[for='switch-multiple-file']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(multiFileUploadSwitch);
|
||||
multiFileUploadSwitch.click();
|
||||
Util.waitUntilElementIsVisible(this.multipleUploadButton);
|
||||
Util.waitUntilElementIsVisible(this.multipleUploadEnabled);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable multiple file upload
|
||||
* @property diableMultipleFileUpload
|
||||
* */
|
||||
disableMultipleFileUpload: {
|
||||
value: function () {
|
||||
var multiFileUploadSwitch = element(by.css("label[for='switch-multiple-file']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(multiFileUploadSwitch);
|
||||
multiFileUploadSwitch.click();
|
||||
Util.waitUntilElementIsNotOnPage(this.multipleUploadButton);
|
||||
Util.waitUntilElementIsNotOnPage(this.multipleUploadEnabled);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* upload mutiple files, 3
|
||||
* @property uploadMutipleFiles
|
||||
* */
|
||||
uploadMutipleFiles: {
|
||||
value: function (file1Location, file2Location) {
|
||||
Util.waitUntilElementIsVisible(this.multipleUploadButton);
|
||||
Util.waitUntilElementIsVisible(this.multipleUploadEnabled);
|
||||
|
||||
var firstFile = Util.uploadParentFolder(file1Location);
|
||||
var secondFile = Util.uploadParentFolder(file2Location);
|
||||
|
||||
Util.uploadFile(this.multipleUploadButton, this.multipleUploadButton, firstFile + "\n" + secondFile);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable filter on
|
||||
* @property enableFilter
|
||||
* */
|
||||
enableFilter: {
|
||||
value: function () {
|
||||
var acceptedFileTypeSwitch = element(by.css("label[for='switch-accepted-file-type']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(acceptedFileTypeSwitch);
|
||||
acceptedFileTypeSwitch.click();
|
||||
Util.waitUntilElementIsVisible(this.acceptedFilesText);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable multiple file upload
|
||||
* @property disableFilter
|
||||
* */
|
||||
disableFilter: {
|
||||
value: function () {
|
||||
var acceptedFileTypeSwitch = element(by.css("label[for='switch-accepted-file-type']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(acceptedFileTypeSwitch);
|
||||
acceptedFileTypeSwitch.click();
|
||||
Util.waitUntilElementIsNotOnPage(this.acceptedFilesText);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enter allowed file types
|
||||
* @property allowedFileTypes
|
||||
* */
|
||||
setAllowedFileTypes: {
|
||||
value: function (allowedFileTypes) {
|
||||
var uploadButtonRestricted = element(by.css("input[data-automation-id='upload-single-file'][ng-reflect-accept='" + allowedFileTypes + "']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(this.acceptedFilesText);
|
||||
this.acceptedFilesText.clear();
|
||||
this.acceptedFilesText.sendKeys(allowedFileTypes);
|
||||
Util.waitUntilElementIsVisible(uploadButtonRestricted);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable versioning
|
||||
* @property enableVersioning
|
||||
* */
|
||||
enableVersioning: {
|
||||
value: function () {
|
||||
var versioningSwitch = element(by.css("label[for='switch-versioning']"));
|
||||
var versioningEnabled = element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-versioning='true']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(versioningSwitch);
|
||||
versioningSwitch.click();
|
||||
Util.waitUntilElementIsVisible(versioningEnabled);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable versioning
|
||||
* @property disableVersioning
|
||||
* */
|
||||
disableVersioning: {
|
||||
value: function () {
|
||||
var versioningSwitch = element(by.css("label[for='switch-versioning']"));
|
||||
var versioningEnabled = element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-versioning='true']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(versioningSwitch);
|
||||
versioningSwitch.click();
|
||||
Util.waitUntilElementIsNotOnPage(versioningEnabled);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* adds versioning additon to to filename
|
||||
* @property versionedFileName
|
||||
* */
|
||||
versionedFileName: {
|
||||
value: function (fileName, versioningAddition) {
|
||||
var fullFileName = fileName.split(".");
|
||||
var nameWithoutExtension = fullFileName[0];
|
||||
var extension = fullFileName[1];
|
||||
return nameWithoutExtension + versioningAddition + "." + extension;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* sort document list by display name, ascending/descending
|
||||
* @property sortDisplayName
|
||||
* */
|
||||
sortDisplayName: {
|
||||
value: function (sorting) {
|
||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_name']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(sortingIcon);
|
||||
sortingIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first folder name
|
||||
* @property checkFirstFolderName
|
||||
* */
|
||||
checkFirstFolderName: {
|
||||
value: function (folderName) {
|
||||
var firstFolder = element(by.xpath("//img[(contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + folderName + "'))]"));
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFolder);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFolder.getText()).toEqual(folderName);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first file's name
|
||||
* @property checkFirstFilesName
|
||||
* */
|
||||
checkFirstFilesName: {
|
||||
value: function (fileName) {
|
||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + fileName + "'))]"));
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFile);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFile.getText()).toEqual(fileName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* click created by when no icon is displayed
|
||||
* @property clickCreatedBy
|
||||
* */
|
||||
clickCreatedBy: {
|
||||
value: function () {
|
||||
var createdBy = element(by.css("th[data-automation-id='auto_id_createdByUser.displayName']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(createdBy);
|
||||
createdBy.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* sort document list by created by, ascending/descending
|
||||
* @property sortCreatedBy
|
||||
* */
|
||||
sortCreatedBy: {
|
||||
value: function (sorting) {
|
||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_createdByUser.displayName']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(sortingIcon);
|
||||
sortingIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first folder creator
|
||||
* @property checkFirstFolderName
|
||||
* */
|
||||
checkFirstFolderCreator: {
|
||||
value: function (folderName, creator) {
|
||||
var firstFolder = element(by.xpath("//img[(contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + creator + "'))]"));
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFolder);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFolder.getText()).toContain(creator);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first file creator
|
||||
* @property checkFirstFileName
|
||||
* */
|
||||
checkFirstFilesCreator: {
|
||||
value: function (fileName, creator) {
|
||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + creator + "'))]"));
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFile);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFile.getText()).toContain(creator);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* click created on when no icon is displayed
|
||||
* @property clickCreatedOn
|
||||
* */
|
||||
clickCreatedOn: {
|
||||
value: function () {
|
||||
var createdOn = element(by.css("th[data-automation-id='auto_id_createdAt']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(createdOn);
|
||||
createdOn.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* sort document list by created on, ascending/descending
|
||||
* @property sortCreatedBy
|
||||
* */
|
||||
sortCreatedBy: {
|
||||
value: function (sorting) {
|
||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_createdAt']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(sortingIcon);
|
||||
sortingIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first folder created on date
|
||||
* @property checkFirstFolderDate
|
||||
* */
|
||||
checkFirstFolderDate: {
|
||||
value: function () {
|
||||
var firstFolder = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'date_'))]"));
|
||||
|
||||
var todaysDate = Util.getCrtDateLongFormat();
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFolder);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFolder.getText()).toContain(todaysDate);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* check first files created on date
|
||||
* @property checkFirstFilesDate
|
||||
* */
|
||||
checkFirstFilesDate: {
|
||||
value: function () {
|
||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'date_'))]"));
|
||||
|
||||
var todaysDate = Util.getCrtDateLongFormat();
|
||||
|
||||
Util.waitUntilElementIsVisible(firstFile);
|
||||
Util.waitUntilElementIsVisible(this.documentList);
|
||||
expect(firstFile.getText()).toContain(todaysDate);
|
||||
}
|
||||
},
|
||||
|
||||
getCurrentFolderID: {
|
||||
value: function () {
|
||||
return folderID.getText();
|
||||
}
|
||||
},
|
||||
|
||||
});
|
@@ -1,76 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var ErrorPage = function(){
|
||||
|
||||
var errorPage = element(by.css("adf-error-content"));
|
||||
var errorPageCode = element(by.css("adf-error-content .adf-error-content-code"));
|
||||
var errorPageTitle = element(by.css("adf-error-content .adf-error-content-title"));
|
||||
var errorPageDescription = element(by.css("adf-error-content .adf-error-content-description"));
|
||||
var backButton = element(by.id("adf-return-button"));
|
||||
var secondButton = element(by.id("adf-secondary-button"));
|
||||
|
||||
this.checkErrorPage = function(){
|
||||
Util.waitUntilElementIsVisible(errorPage);
|
||||
};
|
||||
|
||||
this.clickBackButton = function(){
|
||||
Util.waitUntilElementIsVisible(backButton);
|
||||
backButton.click();
|
||||
};
|
||||
|
||||
this.clickSecondButton = function(){
|
||||
Util.waitUntilElementIsVisible(secondButton);
|
||||
secondButton.click();
|
||||
};
|
||||
|
||||
this.checkErrorTitle = function(){
|
||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
||||
};
|
||||
|
||||
this.checkErrorCode = function(){
|
||||
Util.waitUntilElementIsVisible(errorPageCode);
|
||||
};
|
||||
|
||||
this.checkErrorDescription = function(){
|
||||
Util.waitUntilElementIsVisible(errorPageDescription);
|
||||
};
|
||||
|
||||
this.getErrorCode = function() {
|
||||
Util.waitUntilElementIsVisible(errorPageCode);
|
||||
return errorPageCode.getText();
|
||||
};
|
||||
|
||||
this.getErrorTitle = function() {
|
||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
||||
return errorPageTitle.getText();
|
||||
};
|
||||
|
||||
this.getErrorDescription = function() {
|
||||
Util.waitUntilElementIsVisible(errorPageDescription);
|
||||
return errorPageDescription.getText();
|
||||
};
|
||||
|
||||
this.checkBackButton = function () {
|
||||
return Util.waitUntilElementIsVisible(backButton);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
module.exports = ErrorPage;
|
57
e2e/pages/adf/errorPage.ts
Normal file
57
e2e/pages/adf/errorPage.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class ErrorPage {
|
||||
|
||||
errorPageCode = element(by.css('adf-error-content .adf-error-content-code'));
|
||||
errorPageTitle = element(by.css('adf-error-content .adf-error-content-title'));
|
||||
errorPageDescription = element(by.css('adf-error-content .adf-error-content-description'));
|
||||
backButton = element(by.id('adf-return-button'));
|
||||
secondButton = element(by.id('adf-secondary-button'));
|
||||
|
||||
clickBackButton() {
|
||||
Util.waitUntilElementIsVisible(this.backButton);
|
||||
this.backButton.click();
|
||||
}
|
||||
|
||||
clickSecondButton() {
|
||||
Util.waitUntilElementIsVisible(this.secondButton);
|
||||
this.secondButton.click();
|
||||
}
|
||||
|
||||
checkErrorCode() {
|
||||
Util.waitUntilElementIsVisible(this.errorPageCode);
|
||||
}
|
||||
|
||||
getErrorCode() {
|
||||
Util.waitUntilElementIsVisible(this.errorPageCode);
|
||||
return this.errorPageCode.getText();
|
||||
}
|
||||
|
||||
getErrorTitle() {
|
||||
Util.waitUntilElementIsVisible(this.errorPageTitle);
|
||||
return this.errorPageTitle.getText();
|
||||
}
|
||||
|
||||
getErrorDescription() {
|
||||
Util.waitUntilElementIsVisible(this.errorPageDescription);
|
||||
return this.errorPageDescription.getText();
|
||||
}
|
||||
}
|
@@ -1,475 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Page = require('astrolabe').Page;
|
||||
var Util = require('../../util/util');
|
||||
var documentList = require('./documentListPage');
|
||||
|
||||
var pdfTitleFromSearch = element(by.css("span[id='adf-viewer-display-name']"));
|
||||
var textLayer = element.all(by.css("div[class='textLayer']")).first();
|
||||
var closeButton = element(by.css('button[data-automation-id="adf-toolbar-back"]'));
|
||||
|
||||
/**
|
||||
* Provides the file preview Page.
|
||||
* @module pages
|
||||
* @submodule share
|
||||
* @class pages.adf.filePreviewPage
|
||||
*/
|
||||
module.exports = Page.create({
|
||||
|
||||
/**
|
||||
* Wait for elements to appear
|
||||
* @property waitForElements
|
||||
* @type protractor.Element
|
||||
* */
|
||||
waitForElements: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("i[id='viewer-close-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click view file
|
||||
* @property viewFile
|
||||
* */
|
||||
viewFile: {
|
||||
value: function (fileName) {
|
||||
documentList.checkItemInDocList(fileName);
|
||||
browser.actions().doubleClick(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName))).perform();
|
||||
this.waitForElements();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* get file title
|
||||
* @method getPDFTitle
|
||||
*/
|
||||
getPDFTitleFromSearch: {
|
||||
value: function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(pdfTitleFromSearch);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
pdfTitleFromSearch.getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
})
|
||||
return deferred.promise;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check close button is displayed
|
||||
* @method checkCloseButton
|
||||
*/
|
||||
checkCloseButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("i[id='viewer-close-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check original size button
|
||||
* @method checkOriginalSizeButton
|
||||
*/
|
||||
checkOriginalSizeButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("div[id='viewer-scale-page-button'] > i ", "zoom_out_map")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check zoom in button
|
||||
* @method checkZoomInButton
|
||||
*/
|
||||
checkZoomInButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-zoom-in-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check zoom out button
|
||||
* @method checkZoomOutButton
|
||||
*/
|
||||
checkZoomOutButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-zoom-out-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check previous page button
|
||||
* @method checkPreviousPageButton
|
||||
*/
|
||||
checkPreviousPageButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-previous-page-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check next page button
|
||||
* @method checkNextPageButton
|
||||
*/
|
||||
checkNextPageButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-next-page-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check download button on unsupported documents
|
||||
* @method checkDownloadButton
|
||||
*/
|
||||
checkDownloadButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("button[id='viewer-download-button']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check current pageNumber
|
||||
* @method checkCurrentPageNumber
|
||||
*/
|
||||
checkCurrentPageNumber: {
|
||||
value: function (pageNumber) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("input[id='viewer-pagenumber-input'][ng-reflect-value='" + pageNumber + "']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check text in file
|
||||
* @method checkText
|
||||
*/
|
||||
checkText: {
|
||||
value: function (pageNumber, text) {
|
||||
var allPages = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
var pageLoaded = element(by.css("div[id='pageContainer" + pageNumber + "'][data-loaded='true']"));
|
||||
var textLayerLoaded = element(by.css("div[id='pageContainer" + pageNumber + "'] div[class='textLayer'] > div"));
|
||||
var specificText = element(by.cssContainingText("div[id='pageContainer" + pageNumber + "'] div[class='textLayer'] > div", text));
|
||||
|
||||
Util.waitUntilElementIsVisible(allPages);
|
||||
Util.waitUntilElementIsVisible(pageLoaded);
|
||||
Util.waitUntilElementIsVisible(textLayerLoaded);
|
||||
Util.waitUntilElementIsVisible(specificText);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check total amount of pages
|
||||
* @method checkTitle
|
||||
*/
|
||||
checktotalPages: {
|
||||
value: function (totalPages) {
|
||||
var totalPagesElement = element(by.cssContainingText("div[id='viewer-total-pages']", totalPages));
|
||||
Util.waitUntilElementIsVisible(totalPagesElement);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to next page
|
||||
* @method goToNextPage
|
||||
*/
|
||||
goToNextPage: {
|
||||
value: function () {
|
||||
var nextPageIcon = element(by.css("div[id='viewer-next-page-button']"));
|
||||
Util.waitUntilElementIsVisible(nextPageIcon);
|
||||
nextPageIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to previous page
|
||||
* @method goToPreviousPage
|
||||
*/
|
||||
goToPreviousPage: {
|
||||
value: function () {
|
||||
var previousPageIcon = element(by.css("div[id='viewer-previous-page-button']"));
|
||||
Util.waitUntilElementIsVisible(previousPageIcon);
|
||||
previousPageIcon.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to certain page
|
||||
* @method goToPage
|
||||
*/
|
||||
goToPage: {
|
||||
value: function (page) {
|
||||
var pageInput = element(by.css("input[id='viewer-pagenumber-input']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(pageInput);
|
||||
pageInput.clear().sendKeys(page);
|
||||
pageInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close preview with close option
|
||||
* @method closePreviewWithButton
|
||||
*/
|
||||
closePreviewWithButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(closeButton);
|
||||
closeButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close preview by pressing esc key
|
||||
* @method closePreviewWithEsc
|
||||
*/
|
||||
closePreviewWithEsc: {
|
||||
value: function (fileName) {
|
||||
var filePreview = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
documentList.checkItemInDocList(fileName);
|
||||
Util.waitUntilElementIsNotOnPage(filePreview);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close preview by pressing esc key
|
||||
* @method clickDownload
|
||||
*/
|
||||
clickDownload: {
|
||||
value: function (fileName) {
|
||||
var downloadButton = element(by.css("button[id='viewer-download-button']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
downloadButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click zoom in
|
||||
* @method clickZoomIn
|
||||
*/
|
||||
clickZoomIn: {
|
||||
value: function () {
|
||||
var zoomInButton = element(by.css("div[id='viewer-zoom-in-button']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(zoomInButton);
|
||||
zoomInButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click zoom in
|
||||
* @method clickZoomIn
|
||||
*/
|
||||
clickZoomOut: {
|
||||
value: function () {
|
||||
var zoomOutButton = element(by.css("div[id='viewer-zoom-out-button']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(zoomOutButton);
|
||||
zoomOutButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click actual size
|
||||
* @method clickActualSize
|
||||
*/
|
||||
clickActualSize: {
|
||||
value: function () {
|
||||
var actualSizeButton = element(by.css("div[id='viewer-scale-page-button']"));
|
||||
|
||||
Util.waitUntilElementIsVisible(actualSizeButton);
|
||||
actualSizeButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check canvas width
|
||||
* @method checkCanvasWidth
|
||||
*/
|
||||
checkCanvasWidth: {
|
||||
value: function () {
|
||||
return element.all(by.css("div[class='canvasWrapper'] > canvas")).first().getAttribute("width").then(function(width) {
|
||||
return width;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check canvas height
|
||||
* @method checkCanvasHeight
|
||||
*/
|
||||
checkCanvasHeight: {
|
||||
value: function () {
|
||||
return element.all(by.css("div[class='canvasWrapper'] > canvas")).first().getAttribute("height").then(function(height) {
|
||||
return height;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Zoom in and check
|
||||
* @method zoomIn
|
||||
*/
|
||||
zoomIn: {
|
||||
value: function () {
|
||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
var actualWidth,
|
||||
zoomedInWidth,
|
||||
actualHeight,
|
||||
zoomedInHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
if (actualWidth && zoomedInWidth) {
|
||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
}
|
||||
});
|
||||
|
||||
this.clickZoomIn();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedInWidth = width;
|
||||
if (actualWidth && zoomedInWidth) {
|
||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedInHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check actual size of document, zoom in, actual size
|
||||
* @method zoomIn
|
||||
*/
|
||||
actualSize: {
|
||||
value: function () {
|
||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
var actualWidth,
|
||||
actualHeight,
|
||||
zoomedWidth,
|
||||
zoomedHeight,
|
||||
newWidth,
|
||||
newHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
});
|
||||
|
||||
this.clickZoomIn();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedWidth = width;
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedHeight = height;
|
||||
});
|
||||
|
||||
this.clickActualSize();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
newWidth = width;
|
||||
if (actualWidth && zoomedWidth && newWidth) {
|
||||
expect(newWidth).toBeLessThan(zoomedWidth);
|
||||
expect(newWidth).toEqual(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
newHeight = height;
|
||||
if (actualHeight && zoomedHeight && newHeight) {
|
||||
expect(newHeight).toBeLessThan(zoomedHeight);
|
||||
expect(newHeight).toEqual(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Zoom out and check
|
||||
* @method zoomOut
|
||||
*/
|
||||
zoomOut: {
|
||||
value: function () {
|
||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
var actualWidth,
|
||||
zoomedOutWidth,
|
||||
actualHeight,
|
||||
zoomedOutHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
|
||||
this.clickZoomOut();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedOutWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedInHeight = height;
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
303
e2e/pages/adf/filePreviewPage.ts
Normal file
303
e2e/pages/adf/filePreviewPage.ts
Normal file
@@ -0,0 +1,303 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
export class FilePreviewPage {
|
||||
|
||||
pdfTitleFromSearch = element(by.css(`span[id='adf-viewer-display-name']`));
|
||||
textLayer = element.all(by.css(`div[class='textLayer']`)).first();
|
||||
closeButton = element(by.css('button[data-automation-id="adf-toolbar-back"]'));
|
||||
|
||||
waitForElements() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`i[id='viewer-close-button']`)));
|
||||
}
|
||||
|
||||
viewFile(fileName) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="${filename}"]`, fileName)));
|
||||
browser.actions().doubleClick(element(by.cssContainingText(`div[data-automation-id="${filename}"]`, fileName))).perform();
|
||||
this.waitForElements();
|
||||
}
|
||||
|
||||
getPDFTitleFromSearch() {
|
||||
let deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(this.pdfTitleFromSearch);
|
||||
Util.waitUntilElementIsVisible(this.textLayer);
|
||||
this.pdfTitleFromSearch.getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
checkCloseButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`i[id='viewer-close-button']`)));
|
||||
}
|
||||
|
||||
checkOriginalSizeButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[id='viewer-scale-page-button'] > i `, `zoom_out_map`)));
|
||||
}
|
||||
|
||||
checkZoomInButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-in-button']`)));
|
||||
|
||||
}
|
||||
|
||||
checkZoomOutButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-out-button']`)));
|
||||
}
|
||||
|
||||
checkPreviousPageButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-previous-page-button']`)));
|
||||
}
|
||||
|
||||
checkNextPageButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-next-page-button']`)));
|
||||
}
|
||||
|
||||
checkDownloadButton() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`button[id='viewer-download-button']`)));
|
||||
}
|
||||
|
||||
checkCurrentPageNumber(pageNumber) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`input[id='viewer-pagenumber-input'][ng-reflect-value="${pageNumber}"]`)));
|
||||
}
|
||||
|
||||
checkText(pageNumber, text) {
|
||||
let allPages = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
let pageLoaded = element(by.css(`div[id="pageContainer${pageNumber}"][data-loaded='true']`));
|
||||
let textLayerLoaded = element(by.css(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`));
|
||||
let specificText = element(by.cssContainingText(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`, text));
|
||||
|
||||
Util.waitUntilElementIsVisible(allPages);
|
||||
Util.waitUntilElementIsVisible(pageLoaded);
|
||||
Util.waitUntilElementIsVisible(textLayerLoaded);
|
||||
Util.waitUntilElementIsVisible(specificText);
|
||||
}
|
||||
|
||||
goToNextPage() {
|
||||
let nextPageIcon = element(by.css(`div[id='viewer-next-page-button']`));
|
||||
Util.waitUntilElementIsVisible(nextPageIcon);
|
||||
nextPageIcon.click();
|
||||
}
|
||||
|
||||
goToPreviousPage() {
|
||||
let previousPageIcon = element(by.css(`div[id='viewer-previous-page-button']`));
|
||||
Util.waitUntilElementIsVisible(previousPageIcon);
|
||||
previousPageIcon.click();
|
||||
}
|
||||
|
||||
goToPage(page) {
|
||||
let pageInput = element(by.css(`input[id='viewer-pagenumber-input']`));
|
||||
|
||||
Util.waitUntilElementIsVisible(pageInput);
|
||||
pageInput.clear();
|
||||
pageInput.sendKeys(page);
|
||||
pageInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
closePreviewWithButton() {
|
||||
Util.waitUntilElementIsVisible(this.closeButton);
|
||||
this.closeButton.click();
|
||||
}
|
||||
|
||||
closePreviewWithEsc(fileName) {
|
||||
let filePreview = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="text_${fileName}"]`, fileName)));
|
||||
Util.waitUntilElementIsNotOnPage(filePreview);
|
||||
}
|
||||
|
||||
clickDownload(fileName) {
|
||||
let downloadButton = element(by.css(`button[id='viewer-download-button']`));
|
||||
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
downloadButton.click();
|
||||
}
|
||||
|
||||
clickZoomIn() {
|
||||
let zoomInButton = element(by.css(`div[id='viewer-zoom-in-button']`));
|
||||
|
||||
Util.waitUntilElementIsVisible(zoomInButton);
|
||||
zoomInButton.click();
|
||||
}
|
||||
|
||||
clickZoomOut() {
|
||||
let zoomOutButton = element(by.css(`div[id='viewer-zoom-out-button']`));
|
||||
|
||||
Util.waitUntilElementIsVisible(zoomOutButton);
|
||||
zoomOutButton.click();
|
||||
}
|
||||
|
||||
clickActualSize() {
|
||||
let actualSizeButton = element(by.css(`div[id='viewer-scale-page-button']`));
|
||||
|
||||
Util.waitUntilElementIsVisible(actualSizeButton);
|
||||
actualSizeButton.click();
|
||||
}
|
||||
|
||||
checkCanvasWidth() {
|
||||
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`width`).then(function (width) {
|
||||
return width;
|
||||
});
|
||||
}
|
||||
|
||||
checkCanvasHeight() {
|
||||
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`height`).then(function (height) {
|
||||
return height;
|
||||
});
|
||||
}
|
||||
|
||||
zoomIn() {
|
||||
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
let actualWidth,
|
||||
zoomedInWidth,
|
||||
actualHeight,
|
||||
zoomedInHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
if (actualWidth && zoomedInWidth) {
|
||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
}
|
||||
});
|
||||
|
||||
this.clickZoomIn();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedInWidth = width;
|
||||
if (actualWidth && zoomedInWidth) {
|
||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedInHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
actualSize() {
|
||||
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
let actualWidth,
|
||||
actualHeight,
|
||||
zoomedWidth,
|
||||
zoomedHeight,
|
||||
newWidth,
|
||||
newHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
});
|
||||
|
||||
this.clickZoomIn();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedWidth = width;
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedHeight = height;
|
||||
});
|
||||
|
||||
this.clickActualSize();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
newWidth = width;
|
||||
if (actualWidth && zoomedWidth && newWidth) {
|
||||
expect(newWidth).toBeLessThan(zoomedWidth);
|
||||
expect(newWidth).toEqual(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
newHeight = height;
|
||||
if (actualHeight && zoomedHeight && newHeight) {
|
||||
expect(newHeight).toBeLessThan(zoomedHeight);
|
||||
expect(newHeight).toEqual(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
zoomOut() {
|
||||
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||
|
||||
Util.waitUntilElementIsVisible(canvasLayer);
|
||||
Util.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
let actualWidth,
|
||||
zoomedOutWidth,
|
||||
actualHeight,
|
||||
zoomedOutHeight,
|
||||
zoomedInHeight;
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
actualWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
|
||||
this.clickZoomOut();
|
||||
|
||||
this.checkCanvasWidth().then(function (width) {
|
||||
zoomedOutWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(function (height) {
|
||||
zoomedInHeight = height;
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class LockFilePage {
|
||||
@@ -23,7 +23,7 @@ export class LockFilePage {
|
||||
cancelButton = element(by.css('button[aria-label="Close dialog"]'));
|
||||
saveButton = element(by.cssContainingText('button span', 'Save'));
|
||||
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
||||
lockFileCheckbox = element(by.css('mat-checkbox[class*="adf-lock-file-name"]'));
|
||||
lockFileCheckbox = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));
|
||||
allowOwnerCheckbox = element(by.cssContainingText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '));
|
||||
|
||||
checkLockFileCheckboxIsDisplayed() {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { FormControllersPage } from './material/formControllersPage';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { SettingsPage } from './settingsPage';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
@@ -161,9 +161,8 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
goToLoginPage() {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
|
||||
});
|
||||
browser.waitForAngularEnabled(true);
|
||||
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
|
||||
this.waitForElements();
|
||||
}
|
||||
|
||||
|
@@ -15,42 +15,46 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { element, by } from 'protractor';
|
||||
import { Util } from '../../util/util';
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
|
||||
export class LoginAPSPage {
|
||||
export class LoginSSOPage {
|
||||
|
||||
ssoButton = element(by.css(`[data-automation-id="login-button-sso"]`));
|
||||
usernameField = element(by.id('username'));
|
||||
passwordField = element(by.id('password'));
|
||||
loginButton = element(by.id('kc-login'));
|
||||
header = element(by.id('adf-header'));
|
||||
|
||||
async loginAPS (username, password) {
|
||||
await this.enterUsername(username);
|
||||
await this.enterPassword(password);
|
||||
await this.clickLoginButton();
|
||||
loginAPS(username, password) {
|
||||
browser.ignoreSynchronization = true;
|
||||
this.enterUsername(username);
|
||||
this.enterPassword(password);
|
||||
this.clickLoginButton();
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return Util.waitUntilElementIsVisible(this.header);
|
||||
}
|
||||
|
||||
async clickOnSSOButton () {
|
||||
clickOnSSOButton() {
|
||||
Util.waitUntilElementIsVisible(this.ssoButton);
|
||||
await this.ssoButton.click();
|
||||
this.ssoButton.click();
|
||||
}
|
||||
|
||||
async enterUsername (username) {
|
||||
enterUsername(username) {
|
||||
Util.waitUntilElementIsVisible(this.usernameField);
|
||||
await this.usernameField.clear();
|
||||
await this.usernameField.sendKeys(username);
|
||||
this.usernameField.clear();
|
||||
this.usernameField.sendKeys(username);
|
||||
}
|
||||
|
||||
async enterPassword (password) {
|
||||
enterPassword(password) {
|
||||
Util.waitUntilElementIsVisible(this.passwordField);
|
||||
await this.passwordField.clear();
|
||||
await this.passwordField.sendKeys(password);
|
||||
this.passwordField.clear();
|
||||
this.passwordField.sendKeys(password);
|
||||
}
|
||||
|
||||
async clickLoginButton () {
|
||||
clickLoginButton() {
|
||||
Util.waitUntilElementIsVisible(this.loginButton);
|
||||
await this.loginButton.click();
|
||||
return this.loginButton.click();
|
||||
}
|
||||
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
|
||||
export class DatePickerPage {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class FormControllersPage {
|
||||
|
||||
@@ -23,7 +23,8 @@ export class FormControllersPage {
|
||||
Util.waitUntilElementIsVisible(toggle);
|
||||
toggle.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
toggle.click();
|
||||
Util.waitUntilElementIsClickable(toggle.element(by.css('div')));
|
||||
toggle.element(by.css('div')).click();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -32,7 +33,8 @@ export class FormControllersPage {
|
||||
Util.waitUntilElementIsVisible(toggle);
|
||||
toggle.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
toggle.click();
|
||||
Util.waitUntilElementIsClickable(toggle.element(by.css('div')));
|
||||
toggle.element(by.css('div')).click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class TabsPage {
|
||||
|
||||
|
@@ -1,411 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var MetadataViewPage = function () {
|
||||
|
||||
var title = element(by.css("div[info-drawer-title]"));
|
||||
var expandedAspect = element(by.css("mat-expansion-panel-header[aria-expanded='true']"));
|
||||
var aspectTitle = by.css("mat-panel-title");
|
||||
var name = element(by.css("span[data-automation-id='card-textitem-value-name'] span"));
|
||||
var creator = element(by.css("span[data-automation-id='card-textitem-value-createdByUser.displayName'] span"));
|
||||
var createdDate = element(by.css("span[data-automation-id='card-dateitem-createdAt'] span"));
|
||||
var modifier = element(by.css("span[data-automation-id='card-textitem-value-modifiedByUser.displayName'] span"));
|
||||
var modifiedDate = element(by.css("span[data-automation-id='card-dateitem-modifiedAt'] span"));
|
||||
var mimetypeName = element(by.css("span[data-automation-id='card-textitem-value-content.mimeTypeName']"));
|
||||
var size = element(by.css("span[data-automation-id='card-textitem-value-content.sizeInBytes']"));
|
||||
var description = element(by.css("span[data-automation-id='card-textitem-value-properties.cm:description'] span"));
|
||||
var author = element(by.css("span[data-automation-id='card-textitem-value-properties.cm:author'] span"));
|
||||
var titleProperty = element(by.css("span[data-automation-id='card-textitem-value-properties.cm:title'] span"));
|
||||
var editIcon = element(by.css("button[data-automation-id='meta-data-card-toggle-edit']"));
|
||||
var informationButton = element(by.css("button[data-automation-id='meta-data-card-toggle-expand']"));
|
||||
var informationSpan = element(by.css("span[data-automation-id='meta-data-card-toggle-expand-label']"));
|
||||
var informationIcon = element(by.css("span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon"));
|
||||
var rightChevron = element(by.css("div[class*='header-pagination-after']"));
|
||||
var displayEmptySwitch = element(by.id("adf-metadata-empty"));
|
||||
var readonlySwitch = element(by.id("adf-metadata-readonly"));
|
||||
var multiSwitch = element(by.id("adf-metadata-multi"));
|
||||
var presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||
var defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||
|
||||
this.getTitle = function () {
|
||||
Util.waitUntilElementIsVisible(title);
|
||||
return title.getText();
|
||||
};
|
||||
|
||||
this.getExpandedAspectName = function () {
|
||||
Util.waitUntilElementIsVisible(expandedAspect);
|
||||
return expandedAspect.element(aspectTitle).getText();
|
||||
};
|
||||
|
||||
this.getName = function () {
|
||||
Util.waitUntilElementIsVisible(name);
|
||||
return name.getText();
|
||||
};
|
||||
|
||||
this.getCreator = function () {
|
||||
Util.waitUntilElementIsVisible(creator);
|
||||
return creator.getText();
|
||||
};
|
||||
|
||||
this.getCreatedDate = function () {
|
||||
Util.waitUntilElementIsVisible(createdDate);
|
||||
return createdDate.getText();
|
||||
};
|
||||
|
||||
this.getModifier = function () {
|
||||
Util.waitUntilElementIsVisible(modifier);
|
||||
return modifier.getText();
|
||||
};
|
||||
|
||||
this.getModifiedDate = function () {
|
||||
Util.waitUntilElementIsVisible(modifiedDate);
|
||||
return modifiedDate.getText();
|
||||
};
|
||||
|
||||
this.getMimetypeName = function () {
|
||||
Util.waitUntilElementIsVisible(mimetypeName);
|
||||
return mimetypeName.getText();
|
||||
};
|
||||
|
||||
this.getSize = function () {
|
||||
Util.waitUntilElementIsVisible(size);
|
||||
return size.getText();
|
||||
};
|
||||
|
||||
this.getDescription = function () {
|
||||
Util.waitUntilElementIsVisible(description);
|
||||
return description.getText();
|
||||
};
|
||||
|
||||
this.getAuthor = function () {
|
||||
Util.waitUntilElementIsVisible(author);
|
||||
return author.getText();
|
||||
};
|
||||
|
||||
this.getTitleProperty = function () {
|
||||
Util.waitUntilElementIsVisible(titleProperty);
|
||||
return titleProperty.getText();
|
||||
};
|
||||
|
||||
this.editIconIsDisplayed = function () {
|
||||
return Util.waitUntilElementIsVisible(editIcon);
|
||||
};
|
||||
|
||||
this.editIconIsNotDisplayed = function () {
|
||||
return Util.waitUntilElementIsNotVisible(editIcon);
|
||||
};
|
||||
|
||||
this.editIconClick = function () {
|
||||
Util.waitUntilElementIsVisible(editIcon);
|
||||
return editIcon.click();
|
||||
};
|
||||
|
||||
this.informationButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(informationButton);
|
||||
Util.waitUntilElementIsClickable(informationButton);
|
||||
};
|
||||
|
||||
this.informationButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(informationButton);
|
||||
};
|
||||
|
||||
this.clickOnInformationButton = function () {
|
||||
this.informationButtonIsDisplayed();
|
||||
informationButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getInformationButtonText = function () {
|
||||
Util.waitUntilElementIsVisible(informationSpan);
|
||||
return informationSpan.getText();
|
||||
};
|
||||
|
||||
this.getInformationIconText = function () {
|
||||
Util.waitUntilElementIsVisible(informationIcon);
|
||||
return informationIcon.getText();
|
||||
};
|
||||
|
||||
this.clickOnPropertiesTab = function () {
|
||||
let propertiesTab = element(by.cssContainingText(".adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content", "Properties"));
|
||||
Util.waitUntilElementIsVisible(propertiesTab);
|
||||
propertiesTab.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickRightChevron = function () {
|
||||
Util.waitUntilElementIsVisible(rightChevron);
|
||||
rightChevron.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getEditIconTooltip = function () {
|
||||
return editIcon.getAttribute('title');
|
||||
};
|
||||
|
||||
this.getInformationButtonTooltip = function () {
|
||||
return informationSpan.getAttribute('title');
|
||||
};
|
||||
|
||||
this.editPropertyIconIsDisplayed = function (propertyName) {
|
||||
var editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
};
|
||||
|
||||
this.updatePropertyIconIsDisplayed = function (propertyName) {
|
||||
var updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
};
|
||||
|
||||
this.clickUpdatePropertyIcon = function (propertyName) {
|
||||
var updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
return updatePropertyIcon.click();
|
||||
};
|
||||
|
||||
this.clickClearPropertyIcon = function (propertyName) {
|
||||
var clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
return clearPropertyIcon.click();
|
||||
};
|
||||
|
||||
this.enterPropertyText = function (propertyName, text) {
|
||||
const textField = element(by.css('input[data-automation-id="card-textitem-editinput-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enterPresetText = function (text) {
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
Util.waitUntilElementIsVisible(presetField);
|
||||
presetField.sendKeys('');
|
||||
presetField.clear().sendKeys(text);
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
applyButton.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enterDescriptionText = function (text) {
|
||||
const textField = element(by.css('textarea[data-automation-id="card-textitem-edittextarea-properties.cm:description"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getPropertyText = function (propertyName, type) {
|
||||
let propertyType = !type ? 'textitem' : type;
|
||||
const textField = element(by.css('span[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
};
|
||||
|
||||
this.clearPropertyIconIsDisplayed = function (propertyName) {
|
||||
var clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
};
|
||||
|
||||
this.clickEditPropertyIcons = function (propertyName) {
|
||||
var editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
editPropertyIcon.click();
|
||||
};
|
||||
|
||||
this.getPropertyIconTooltip = function (propertyName) {
|
||||
var editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
return editPropertyIcon.getAttribute('title');
|
||||
};
|
||||
|
||||
this.clickMetadataGroup = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
group.click();
|
||||
};
|
||||
|
||||
this.checkMetadataGroupIsPresent = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsVisible(group);
|
||||
};
|
||||
|
||||
this.checkMetadataGroupIsNotPresent = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsNotVisible(group);
|
||||
};
|
||||
|
||||
this.checkMetadataGroupIsExpand = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).toContain('mat-expanded')
|
||||
};
|
||||
|
||||
this.checkMetadataGroupIsNotExpand = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).not.toContain('mat-expanded')
|
||||
};
|
||||
|
||||
this.getMetadataGroupTitle = function (groupName) {
|
||||
var group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
return group.getText();
|
||||
};
|
||||
|
||||
/**
|
||||
* disables displayEmpty
|
||||
*/
|
||||
this.disableDisplayEmpty = function () {
|
||||
Util.waitUntilElementIsVisible(displayEmptySwitch);
|
||||
displayEmptySwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
displayEmptySwitch.click();
|
||||
expect(displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* enables displayEmpty
|
||||
*/
|
||||
this.enableDisplayEmpty = function () {
|
||||
Util.waitUntilElementIsVisible(displayEmptySwitch);
|
||||
displayEmptySwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
displayEmptySwitch.click();
|
||||
expect(displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* disables Readonly
|
||||
*/
|
||||
this.disableReadonly = function () {
|
||||
Util.waitUntilElementIsVisible(readonlySwitch);
|
||||
readonlySwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
readonlySwitch.click();
|
||||
expect(readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* enables Readonly
|
||||
*/
|
||||
this.enableReadonly = function () {
|
||||
Util.waitUntilElementIsVisible(readonlySwitch);
|
||||
readonlySwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
readonlySwitch.click();
|
||||
expect(readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* disables multi
|
||||
*/
|
||||
this.disableMulti = function () {
|
||||
Util.waitUntilElementIsVisible(multiSwitch);
|
||||
multiSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
multiSwitch.click();
|
||||
expect(multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* enables multi
|
||||
*/
|
||||
this.enableMulti = function () {
|
||||
Util.waitUntilElementIsVisible(multiSwitch);
|
||||
multiSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
multiSwitch.click();
|
||||
expect(multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
this.disablePreset = function () {
|
||||
Util.waitUntilElementIsVisible(presetSwitch);
|
||||
presetSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
presetSwitch.click();
|
||||
expect(presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
this.enablePreset = function () {
|
||||
Util.waitUntilElementIsVisible(presetSwitch);
|
||||
presetSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
presetSwitch.click();
|
||||
expect(presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
this.disabledDefaultProperties = function () {
|
||||
Util.waitUntilElementIsVisible(defaultPropertiesSwitch);
|
||||
defaultPropertiesSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
defaultPropertiesSwitch.click();
|
||||
expect(defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
this.enabledDefaultProperties = function () {
|
||||
Util.waitUntilElementIsVisible(defaultPropertiesSwitch);
|
||||
defaultPropertiesSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
defaultPropertiesSwitch.click();
|
||||
expect(defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
this.checkPropertyIsVisible = function (propertyName, type) {
|
||||
var property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(property);
|
||||
};
|
||||
|
||||
this.checkPropertyIsNotVisible = function (propertyName, type) {
|
||||
var property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsNotVisible(property);
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = MetadataViewPage;
|
414
e2e/pages/adf/metadataViewPage.ts
Normal file
414
e2e/pages/adf/metadataViewPage.ts
Normal file
@@ -0,0 +1,414 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
title = element(by.css(`div[info-drawer-title]`));
|
||||
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
||||
aspectTitle = by.css(`mat-panel-title`);
|
||||
name = element(by.css(`span[data-automation-id='card-textitem-value-name'] span`));
|
||||
creator = element(by.css(`span[data-automation-id='card-textitem-value-createdByUser.displayName'] span`));
|
||||
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`));
|
||||
modifier = element(by.css(`span[data-automation-id='card-textitem-value-modifiedByUser.displayName'] span`));
|
||||
modifiedDate = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt'] span`));
|
||||
mimetypeName = element(by.css(`span[data-automation-id='card-textitem-value-content.mimeTypeName']`));
|
||||
size = element(by.css(`span[data-automation-id='card-textitem-value-content.sizeInBytes']`));
|
||||
description = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description'] span`));
|
||||
author = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:author'] span`));
|
||||
titleProperty = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`));
|
||||
editIcon = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`));
|
||||
informationButton = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
||||
informationSpan = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
||||
informationIcon = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`));
|
||||
rightChevron = element(by.css(`div[class*='header-pagination-after']`));
|
||||
displayEmptySwitch = element(by.id(`adf-metadata-empty`));
|
||||
readonlySwitch = element(by.id(`adf-metadata-readonly`));
|
||||
multiSwitch = element(by.id(`adf-metadata-multi`));
|
||||
presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||
|
||||
getTitle() {
|
||||
Util.waitUntilElementIsVisible(this.title);
|
||||
return this.title.getText();
|
||||
}
|
||||
|
||||
getExpandedAspectName() {
|
||||
Util.waitUntilElementIsVisible(this.expandedAspect);
|
||||
return this.expandedAspect.element(this.aspectTitle).getText();
|
||||
}
|
||||
|
||||
getName() {
|
||||
Util.waitUntilElementIsVisible(this.name);
|
||||
return this.name.getText();
|
||||
}
|
||||
|
||||
getCreator() {
|
||||
Util.waitUntilElementIsVisible(this.creator);
|
||||
return this.creator.getText();
|
||||
}
|
||||
|
||||
getCreatedDate() {
|
||||
Util.waitUntilElementIsVisible(this.createdDate);
|
||||
return this.createdDate.getText();
|
||||
}
|
||||
|
||||
getModifier() {
|
||||
Util.waitUntilElementIsVisible(this.modifier);
|
||||
return this.modifier.getText();
|
||||
}
|
||||
|
||||
getModifiedDate() {
|
||||
Util.waitUntilElementIsVisible(this.modifiedDate);
|
||||
return this.modifiedDate.getText();
|
||||
}
|
||||
|
||||
getMimetypeName() {
|
||||
Util.waitUntilElementIsVisible(this.mimetypeName);
|
||||
return this.mimetypeName.getText();
|
||||
}
|
||||
|
||||
getSize() {
|
||||
Util.waitUntilElementIsVisible(this.size);
|
||||
return this.size.getText();
|
||||
}
|
||||
|
||||
getDescription() {
|
||||
Util.waitUntilElementIsVisible(this.description);
|
||||
return this.description.getText();
|
||||
}
|
||||
|
||||
getAuthor() {
|
||||
Util.waitUntilElementIsVisible(this.author);
|
||||
return this.author.getText();
|
||||
}
|
||||
|
||||
getTitleProperty() {
|
||||
Util.waitUntilElementIsVisible(this.titleProperty);
|
||||
return this.titleProperty.getText();
|
||||
}
|
||||
|
||||
editIconIsDisplayed() {
|
||||
return Util.waitUntilElementIsVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconIsNotDisplayed() {
|
||||
return Util.waitUntilElementIsNotVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconClick() {
|
||||
Util.waitUntilElementIsVisible(this.editIcon);
|
||||
return this.editIcon.click();
|
||||
}
|
||||
|
||||
informationButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.informationButton);
|
||||
Util.waitUntilElementIsClickable(this.informationButton);
|
||||
}
|
||||
|
||||
informationButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.informationButton);
|
||||
}
|
||||
|
||||
clickOnInformationButton() {
|
||||
this.informationButtonIsDisplayed();
|
||||
browser.sleep(600);
|
||||
this.informationButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getInformationButtonText() {
|
||||
Util.waitUntilElementIsVisible(this.informationSpan);
|
||||
return this.informationSpan.getText();
|
||||
}
|
||||
|
||||
getInformationIconText() {
|
||||
Util.waitUntilElementIsVisible(this.informationIcon);
|
||||
return this.informationIcon.getText();
|
||||
}
|
||||
|
||||
clickOnPropertiesTab() {
|
||||
let propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
|
||||
Util.waitUntilElementIsVisible(propertiesTab);
|
||||
propertiesTab.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickRightChevron() {
|
||||
Util.waitUntilElementIsVisible(this.rightChevron);
|
||||
this.rightChevron.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getEditIconTooltip() {
|
||||
return this.editIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
getInformationButtonTooltip() {
|
||||
return this.informationSpan.getAttribute('title');
|
||||
}
|
||||
|
||||
editPropertyIconIsDisplayed(propertyName) {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
}
|
||||
|
||||
updatePropertyIconIsDisplayed(propertyName) {
|
||||
let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
}
|
||||
|
||||
clickUpdatePropertyIcon(propertyName) {
|
||||
let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
return updatePropertyIcon.click();
|
||||
}
|
||||
|
||||
clickClearPropertyIcon(propertyName) {
|
||||
let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
return clearPropertyIcon.click();
|
||||
}
|
||||
|
||||
enterPropertyText(propertyName, text) {
|
||||
const textField = element(by.css('input[data-automation-id="card-textitem-editinput-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear();
|
||||
textField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
enterPresetText(text) {
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
Util.waitUntilElementIsVisible(presetField);
|
||||
presetField.sendKeys('');
|
||||
presetField.clear();
|
||||
presetField.sendKeys(text);
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
applyButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
enterDescriptionText(text) {
|
||||
const textField = element(by.css('textarea[data-automation-id="card-textitem-edittextarea-properties.cm:description"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear();
|
||||
textField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
getPropertyText(propertyName, type) {
|
||||
let propertyType = !type ? 'textitem' : type;
|
||||
const textField = element(by.css('span[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
}
|
||||
|
||||
clearPropertyIconIsDisplayed(propertyName) {
|
||||
let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
}
|
||||
|
||||
clickEditPropertyIcons(propertyName) {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(editPropertyIcon);
|
||||
editPropertyIcon.click();
|
||||
}
|
||||
|
||||
getPropertyIconTooltip(propertyName) {
|
||||
let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
return editPropertyIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
clickMetadataGroup(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
group.click();
|
||||
}
|
||||
|
||||
checkMetadataGroupIsPresent(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsVisible(group);
|
||||
}
|
||||
|
||||
checkMetadataGroupIsNotPresent(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
return Util.waitUntilElementIsNotVisible(group);
|
||||
}
|
||||
|
||||
checkMetadataGroupIsExpand(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
checkMetadataGroupIsNotExpand(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
expect(group.getAttribute('class')).not.toContain('mat-expanded');
|
||||
}
|
||||
|
||||
getMetadataGroupTitle(groupName) {
|
||||
let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
Util.waitUntilElementIsVisible(group);
|
||||
return group.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
* disables displayEmpty
|
||||
*/
|
||||
disableDisplayEmpty() {
|
||||
Util.waitUntilElementIsVisible(this.displayEmptySwitch);
|
||||
this.displayEmptySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.displayEmptySwitch.click();
|
||||
expect(this.displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables displayEmpty
|
||||
*/
|
||||
enableDisplayEmpty() {
|
||||
Util.waitUntilElementIsVisible(this.displayEmptySwitch);
|
||||
this.displayEmptySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.displayEmptySwitch.click();
|
||||
expect(this.displayEmptySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables Readonly
|
||||
*/
|
||||
disableReadonly() {
|
||||
Util.waitUntilElementIsVisible(this.readonlySwitch);
|
||||
this.readonlySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.readonlySwitch.click();
|
||||
expect(this.readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables Readonly
|
||||
*/
|
||||
enableReadonly() {
|
||||
Util.waitUntilElementIsVisible(this.readonlySwitch);
|
||||
this.readonlySwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.readonlySwitch.click();
|
||||
expect(this.readonlySwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables multi
|
||||
*/
|
||||
disableMulti() {
|
||||
Util.waitUntilElementIsVisible(this.multiSwitch);
|
||||
this.multiSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.multiSwitch.click();
|
||||
expect(this.multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables multi
|
||||
*/
|
||||
enableMulti() {
|
||||
Util.waitUntilElementIsVisible(this.multiSwitch);
|
||||
this.multiSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.multiSwitch.click();
|
||||
expect(this.multiSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
disablePreset() {
|
||||
Util.waitUntilElementIsVisible(this.presetSwitch);
|
||||
this.presetSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.presetSwitch.click();
|
||||
expect(this.presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
enablePreset() {
|
||||
Util.waitUntilElementIsVisible(this.presetSwitch);
|
||||
this.presetSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.presetSwitch.click();
|
||||
expect(this.presetSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables preset
|
||||
*/
|
||||
disabledDefaultProperties() {
|
||||
Util.waitUntilElementIsVisible(this.defaultPropertiesSwitch);
|
||||
this.defaultPropertiesSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
this.defaultPropertiesSwitch.click();
|
||||
expect(this.defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables preset
|
||||
*/
|
||||
enabledDefaultProperties() {
|
||||
Util.waitUntilElementIsVisible(this.defaultPropertiesSwitch);
|
||||
this.defaultPropertiesSwitch.getAttribute('class').then((check) => {
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
this.defaultPropertiesSwitch.click();
|
||||
expect(this.defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checkPropertyIsVisible(propertyName, type) {
|
||||
let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsVisible(property);
|
||||
}
|
||||
|
||||
checkPropertyIsNotVisible(propertyName, type) {
|
||||
let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
Util.waitUntilElementIsNotVisible(property);
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { ProcessServicesPage } from './process_services/processServicesPage';
|
||||
@@ -24,6 +24,7 @@ import { AppListCloudComponent } from './process_cloud/appListCloudComponent';
|
||||
export class NavigationBarPage {
|
||||
|
||||
contentServicesButton = element(by.css('a[data-automation-id="Content Services"]'));
|
||||
dataTableButton = element(by.css('a[data-automation-id="Datatable"]'));
|
||||
taskListButton = element(by.css("a[data-automation-id='Task List']"));
|
||||
configEditorButton = element(by.css('a[data-automation-id="Configuration Editor"]'));
|
||||
processServicesButton = element(by.css('a[data-automation-id="Process Services"]'));
|
||||
@@ -43,6 +44,11 @@ export class NavigationBarPage {
|
||||
formButton = element(by.css('a[data-automation-id="Form"]'));
|
||||
treeViewButton = element(by.css('a[data-automation-id="Tree View"]'));
|
||||
|
||||
navigateToDatatable() {
|
||||
Util.waitUntilElementIsVisible(this.dataTableButton);
|
||||
this.dataTableButton.click();
|
||||
}
|
||||
|
||||
clickContentServicesButton() {
|
||||
Util.waitUntilElementIsVisible(this.contentServicesButton);
|
||||
this.contentServicesButton.click();
|
||||
@@ -160,10 +166,10 @@ export class NavigationBarPage {
|
||||
this.appTitle.click();
|
||||
}
|
||||
|
||||
clickFormButton = function () {
|
||||
clickFormButton() {
|
||||
Util.waitUntilElementIsVisible(this.formButton);
|
||||
return this.formButton.click();
|
||||
};
|
||||
}
|
||||
|
||||
checkLogoTooltip(logoTooltipTitle) {
|
||||
let logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
||||
@@ -179,10 +185,6 @@ export class NavigationBarPage {
|
||||
browser.get(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
|
||||
}
|
||||
|
||||
checkContentServicesButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.contentServicesButton);
|
||||
}
|
||||
|
||||
clickTreeViewButton() {
|
||||
Util.waitUntilElementIsVisible(this.treeViewButton);
|
||||
this.treeViewButton.click();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
|
||||
export class NotificationPage {
|
||||
|
@@ -1,160 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var PaginationPage = function () {
|
||||
|
||||
var itemsPerPageDropdown = element(by.css("div[class*='adf-pagination__perpage-block'] button"));
|
||||
var pageSelectorDropDown = element(by.css("div[class*='adf-pagination__page-selector']"));
|
||||
var pageSelectorArrow = element(by.css("button[aria-label='Current page selector']"));
|
||||
var itemsPerPage = element(by.css("span[class='adf-pagination__max-items']"));
|
||||
var currentPage = element(by.css("span[class='adf-pagination__current-page']"));
|
||||
var totalPages = element(by.css("span[class='adf-pagination__total-pages']"));
|
||||
var paginationRange = element(by.css("span[class='adf-pagination__range']"));
|
||||
var nextPageButton = element(by.css("button[class*='adf-pagination__next-button']"));
|
||||
var previousPageButton = element(by.css("button[class*='adf-pagination__previous-button']"));
|
||||
var nextButtonDisabled = element(by.css("button[class*='adf-pagination__next-button'][disabled]"));
|
||||
var previousButtonDisabled = element(by.css("button[class*='adf-pagination__previous-button'][disabled]"));
|
||||
var pageDropDown = element(by.css("div[class*='adf-pagination__actualinfo-block'] button"));
|
||||
var pageDropDownOptions = by.css("div[class*='mat-menu-content'] button");
|
||||
var paginationSection = element(by.css("adf-pagination"));
|
||||
var paginationSectionEmpty = element(by.css("adf-pagination[class*='adf-pagination__empty']"));
|
||||
var totalFiles = element(by.css('span[class="adf-pagination__range"]'));
|
||||
|
||||
this.selectItemsPerPage = function (item) {
|
||||
Util.waitUntilElementIsVisible(itemsPerPageDropdown);
|
||||
Util.waitUntilElementIsClickable(itemsPerPageDropdown);
|
||||
browser.actions().mouseMove(itemsPerPageDropdown).perform();
|
||||
Util.waitUntilElementIsVisible(itemsPerPageDropdown);
|
||||
Util.waitUntilElementIsClickable(itemsPerPageDropdown).then(()=>{
|
||||
browser.driver.sleep(2000);
|
||||
itemsPerPageDropdown.click();
|
||||
});
|
||||
Util.waitUntilElementIsVisible(pageSelectorDropDown);
|
||||
|
||||
var itemsPerPage = element.all(by.cssContainingText(".mat-menu-item", item)).first();
|
||||
Util.waitUntilElementIsClickable(itemsPerPage);
|
||||
Util.waitUntilElementIsVisible(itemsPerPage);
|
||||
itemsPerPage.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkPageSelectorIsNotDisplayed = function() {
|
||||
Util.waitUntilElementIsNotOnPage(pageSelectorArrow);
|
||||
};
|
||||
|
||||
this.checkPageSelectorIsDisplayed = function() {
|
||||
Util.waitUntilElementIsVisible(pageSelectorArrow);
|
||||
};
|
||||
|
||||
this.checkPaginationIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsOnPage(paginationSectionEmpty);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getCurrentItemsPerPage = function () {
|
||||
Util.waitUntilElementIsVisible(itemsPerPage);
|
||||
return itemsPerPage.getText();
|
||||
};
|
||||
|
||||
this.getCurrentPage = function () {
|
||||
Util.waitUntilElementIsVisible(paginationSection);
|
||||
Util.waitUntilElementIsVisible(currentPage);
|
||||
return currentPage.getText();
|
||||
};
|
||||
|
||||
this.getTotalPages = function () {
|
||||
Util.waitUntilElementIsVisible(totalPages);
|
||||
return totalPages.getText();
|
||||
};
|
||||
|
||||
this.getPaginationRange = function () {
|
||||
Util.waitUntilElementIsVisible(paginationRange);
|
||||
return paginationRange.getText();
|
||||
};
|
||||
|
||||
this.clickOnNextPage = function () {
|
||||
Util.waitUntilElementIsVisible(nextPageButton);
|
||||
Util.waitUntilElementIsClickable(nextPageButton);
|
||||
browser.actions().mouseMove(nextPageButton).perform();
|
||||
Util.waitUntilElementIsVisible(nextPageButton);
|
||||
Util.waitUntilElementIsClickable(nextPageButton).then(()=> {
|
||||
browser.driver.sleep(2000);
|
||||
});
|
||||
return nextPageButton.click();
|
||||
};
|
||||
|
||||
this.clickOnPageDropdown = function () {
|
||||
Util.waitUntilElementIsVisible(pageDropDown);
|
||||
Util.waitUntilElementIsClickable(pageDropDown);
|
||||
return pageDropDown.click();
|
||||
};
|
||||
|
||||
this.clickOnPageDropdownOption = function (item) {
|
||||
Util.waitUntilElementIsVisible(element.all(pageDropDownOptions).first());
|
||||
var option = element(by.cssContainingText("div[class*='mat-menu-content'] button", item));
|
||||
Util.waitUntilElementIsVisible(option);
|
||||
option.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getPageDropdownOptions = function() {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(pageDropDownOptions).first());
|
||||
var initialList = [];
|
||||
element.all(pageDropDownOptions).each(function(element) {
|
||||
element.getText().then(function(text) {
|
||||
if(text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.checkNextPageButtonIsDisabled = function() {
|
||||
Util.waitUntilElementIsVisible(nextButtonDisabled);
|
||||
};
|
||||
|
||||
this.checkPreviousPageButtonIsDisabled = function() {
|
||||
Util.waitUntilElementIsVisible(previousButtonDisabled);
|
||||
};
|
||||
|
||||
this.checkNextPageButtonIsEnabled = function() {
|
||||
Util.waitUntilElementIsNotOnPage(nextButtonDisabled);
|
||||
};
|
||||
|
||||
this.checkPreviousPageButtonIsEnabled = function() {
|
||||
Util.waitUntilElementIsNotOnPage(previousButtonDisabled);
|
||||
};
|
||||
|
||||
this.getTotalNumberOfFiles = function () {
|
||||
Util.waitUntilElementIsVisible(totalFiles);
|
||||
var numberOfFiles = totalFiles.getText().then(function (totalNumber) {
|
||||
var totalNumberOfFiles = totalNumber.split('of ')[1];
|
||||
return totalNumberOfFiles;
|
||||
});
|
||||
|
||||
return numberOfFiles;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = PaginationPage;
|
||||
|
157
e2e/pages/adf/paginationPage.ts
Normal file
157
e2e/pages/adf/paginationPage.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
|
||||
export class PaginationPage {
|
||||
|
||||
itemsPerPageDropdown = element(by.css('div[class*="adf-pagination__perpage-block"] button'));
|
||||
pageSelectorDropDown = element(by.css('div[class*="adf-pagination__page-selector"]'));
|
||||
pageSelectorArrow = element(by.css('button[aria-label="Current page selector"]'));
|
||||
itemsPerPage = element(by.css('span[class="adf-pagination__max-items"]'));
|
||||
currentPage = element(by.css('span[class="adf-pagination__current-page"]'));
|
||||
totalPages = element(by.css('span[class="adf-pagination__total-pages"]'));
|
||||
paginationRange = element(by.css('span[class="adf-pagination__range"]'));
|
||||
nextPageButton = element(by.css('button[class*="adf-pagination__next-button"]'));
|
||||
nextButtonDisabled = element(by.css('button[class*="adf-pagination__next-button"][disabled]'));
|
||||
previousButtonDisabled = element(by.css('button[class*="adf-pagination__previous-button"][disabled]'));
|
||||
pageDropDown = element(by.css('div[class*="adf-pagination__actualinfo-block"] button'));
|
||||
pageDropDownOptions = by.css('div[class*="mat-menu-content"] button');
|
||||
paginationSection = element(by.css('adf-pagination'));
|
||||
paginationSectionEmpty = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
|
||||
totalFiles = element(by.css('span[class="adf-pagination__range"]'));
|
||||
|
||||
selectItemsPerPage(numberOfItem: string) {
|
||||
Util.waitUntilElementIsVisible(this.itemsPerPageDropdown);
|
||||
Util.waitUntilElementIsClickable(this.itemsPerPageDropdown);
|
||||
browser.actions().mouseMove(this.itemsPerPageDropdown).perform();
|
||||
Util.waitUntilElementIsVisible(this.itemsPerPageDropdown);
|
||||
Util.waitUntilElementIsClickable(this.itemsPerPageDropdown).then(() => {
|
||||
browser.driver.sleep(2000);
|
||||
this.itemsPerPageDropdown.click();
|
||||
});
|
||||
Util.waitUntilElementIsVisible(this.pageSelectorDropDown);
|
||||
|
||||
let itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
|
||||
Util.waitUntilElementIsClickable(itemsPerPage);
|
||||
Util.waitUntilElementIsVisible(itemsPerPage);
|
||||
itemsPerPage.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkPageSelectorIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.pageSelectorArrow);
|
||||
}
|
||||
|
||||
checkPageSelectorIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.pageSelectorArrow);
|
||||
}
|
||||
|
||||
checkPaginationIsNotDisplayed() {
|
||||
Util.waitUntilElementIsOnPage(this.paginationSectionEmpty);
|
||||
return this;
|
||||
}
|
||||
|
||||
getCurrentItemsPerPage() {
|
||||
Util.waitUntilElementIsVisible(this.itemsPerPage);
|
||||
return this.itemsPerPage.getText();
|
||||
}
|
||||
|
||||
getCurrentPage() {
|
||||
Util.waitUntilElementIsVisible(this.paginationSection);
|
||||
Util.waitUntilElementIsVisible(this.currentPage);
|
||||
return this.currentPage.getText();
|
||||
}
|
||||
|
||||
getTotalPages() {
|
||||
Util.waitUntilElementIsVisible(this.totalPages);
|
||||
return this.totalPages.getText();
|
||||
}
|
||||
|
||||
getPaginationRange() {
|
||||
Util.waitUntilElementIsVisible(this.paginationRange);
|
||||
return this.paginationRange.getText();
|
||||
}
|
||||
|
||||
clickOnNextPage() {
|
||||
Util.waitUntilElementIsVisible(this.nextPageButton);
|
||||
Util.waitUntilElementIsClickable(this.nextPageButton);
|
||||
browser.actions().mouseMove(this.nextPageButton).perform();
|
||||
Util.waitUntilElementIsVisible(this.nextPageButton);
|
||||
Util.waitUntilElementIsClickable(this.nextPageButton).then(() => {
|
||||
browser.driver.sleep(2000);
|
||||
});
|
||||
return this.nextPageButton.click();
|
||||
}
|
||||
|
||||
clickOnPageDropdown() {
|
||||
Util.waitUntilElementIsVisible(this.pageDropDown);
|
||||
Util.waitUntilElementIsClickable(this.pageDropDown);
|
||||
return this.pageDropDown.click();
|
||||
}
|
||||
|
||||
clickOnPageDropdownOption(numberOfItemPerPage: string) {
|
||||
Util.waitUntilElementIsVisible(element.all(this.pageDropDownOptions).first());
|
||||
let option = element(by.cssContainingText('div[class*="mat-menu-content"] button', numberOfItemPerPage));
|
||||
Util.waitUntilElementIsVisible(option);
|
||||
option.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getPageDropdownOptions() {
|
||||
let deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(element.all(this.pageDropDownOptions).first());
|
||||
let initialList = [];
|
||||
element.all(this.pageDropDownOptions).each(function (currentOption) {
|
||||
currentOption.getText().then(function (text) {
|
||||
if (text !== '') {
|
||||
initialList.push(text);
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
deferred.fulfill(initialList);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
checkNextPageButtonIsDisabled() {
|
||||
Util.waitUntilElementIsVisible(this.nextButtonDisabled);
|
||||
}
|
||||
|
||||
checkPreviousPageButtonIsDisabled() {
|
||||
Util.waitUntilElementIsVisible(this.previousButtonDisabled);
|
||||
}
|
||||
|
||||
checkNextPageButtonIsEnabled() {
|
||||
Util.waitUntilElementIsNotOnPage(this.nextButtonDisabled);
|
||||
}
|
||||
|
||||
checkPreviousPageButtonIsEnabled() {
|
||||
Util.waitUntilElementIsNotOnPage(this.previousButtonDisabled);
|
||||
}
|
||||
|
||||
getTotalNumberOfFiles() {
|
||||
Util.waitUntilElementIsVisible(this.totalFiles);
|
||||
let numberOfFiles = this.totalFiles.getText().then(function (totalNumber) {
|
||||
let totalNumberOfFiles = totalNumber.split('of ')[1];
|
||||
return totalNumberOfFiles;
|
||||
});
|
||||
|
||||
return numberOfFiles;
|
||||
}
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { Util } from '../../util/util';
|
||||
|
||||
export class PermissionsPage {
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user