[no-issue] refactor failing e2e (#3865)

* fix ps test

* fix import

* fix import

* fix ps

* fix hyperlink

* fix radio hiperlynk

* autorename for clashes

* notification fix

* convert userdialog to ts

* fix travis configuration

* fix download in folder

* convert contentservice page to ts

* convert setting and login to ts

* remove unused import

* fix login import

* fix login page

* fix chips

* fix import
speed up viewer test

* fix contentlist

* change id

* fix cs e2e

* fix search lint

* fix name issue
This commit is contained in:
Eugenio Romano 2018-10-11 14:22:44 +01:00 committed by GitHub
parent 29f28c7c82
commit 7fd905d92c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
120 changed files with 2453 additions and 2985 deletions

View File

@ -88,7 +88,7 @@ jobs:
env: STAGE=test-export
script: npm run test-export
- stage: Create Docker PR
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER --base-href $TRAVIS_BUILD_NUMBER -n $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER --base-href $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
- stage: Deploy Docker PR
script: node ./scripts/pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "docker:$REPO_DOCKER/adf/demo-shell:$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1

View File

@ -16,10 +16,6 @@
data-automation-id="notification-message">
</mat-form-field>
<button mat-icon-button (click)="send()" data-automation-id="notification-default-button">
<mat-icon>send</mat-icon>
</button>
<div>
<mat-slide-toggle
[(ngModel)]="withAction"

View File

@ -96,20 +96,6 @@ export class NotificationsComponent implements OnInit {
}
}
send() {
this.actionOutput = '';
if (this.message) {
if (this.withAction) {
this.notificationService.openSnackMessageAction(this.message, 'Some action', this.snackBarConfig.duration)
.onAction()
.subscribe(() => this.actionOutput = 'Action clicked');
} else {
this.notificationService.openSnackMessage(this.message, this.snackBarConfig.duration);
}
}
}
sendCustomConfig() {
this.actionOutput = '';
this.snackBarConfigObject = `{"direction": "${this.snackBarConfig.direction}",

View File

@ -18,13 +18,10 @@
import path = require('path');
import fs = require('fs');
import TestConfig = require('../../test.config');
import remote = require('selenium-webdriver/remote');
export class UploadActions {
async uploadFile(alfrescoJsApi, fileLocation, fileName, parentFolderId) {
browser.setFileDetector(new remote.FileDetector());
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
let file = fs.createReadStream(pathFile);
@ -42,8 +39,6 @@ export class UploadActions {
}
async createEmptyFiles(alfrescoJsApi, emptyFileNames: string[], parentFolderId) {
browser.setFileDetector(new remote.FileDetector());
let filesRequest = [];
for (let i = 0; i < emptyFileNames.length; i++) {
@ -59,8 +54,6 @@ export class UploadActions {
}
async uploadFolder(alfrescoJsApi, folderName, parentFolderId) {
browser.setFileDetector(new remote.FileDetector());
return alfrescoJsApi.nodes.addNode(parentFolderId, {
'name': folderName,
'nodeType': 'cm:folder'

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import { CommentsPage } from '../../pages/adf/commentsPage';

View File

@ -15,10 +15,10 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import CreateFolderDialog = require('../../pages/adf/dialog/createFolderDialog');
import NotificationPage = require('../../pages/adf/notificationPage');
import { NotificationPage } from '../../pages/adf/notificationPage';
import MetadataViewPage = require('../../pages/adf/metadataViewPage');
import ContentListPage = require('../../pages/adf/dialog/contentList');

View File

@ -16,8 +16,8 @@
*/
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
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 TestConfig = require('../../test.config');

View File

@ -16,8 +16,8 @@
*/
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import AcsUserModel = require('../../models/ACS/acsUserModel');
import TestConfig = require('../../test.config');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import PaginationPage = require('../../pages/adf/paginationPage');
import NavigationBarPage = require('../../pages/adf/navigationBarPage');

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import AcsUserModel = require('../models/ACS/acsUserModel');
import TestConfig = require('../test.config');
import AlfrescoApi = require('alfresco-js-api-node');
import NotificationPage = require('../pages/adf/notificationPage');
import { NotificationPage } from '../pages/adf/notificationPage';
import { browser } from 'protractor';
describe('Notifications Component', () => {
@ -46,26 +46,35 @@ describe('Notifications Component', () => {
notificationPage.goToNotificationsPage();
notificationPage.enterDurationField(6000);
done();
});
afterEach(async (done) => {
notificationPage.enterDurationField(1);
notificationPage.clickNotificationButton();
browser.sleep(100);
notificationPage.enterDurationField(6000);
done();
});
it('[C279977] Should show notification when the message is not empty and button is clicked', () => {
notificationPage.enterMessageField('Notification test');
notificationPage.clickDefaultNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
});
it('[C279979] Should not show notification when the message is empty and button is clicked', () => {
notificationPage.clearMessage();
notificationPage.clickDefaultNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsNotDisplayed();
});
it('[C279978] Should show notification with action when the message is not empty and button is clicked', () => {
notificationPage.enterMessageField('Notification test');
notificationPage.clickActionToggle();
notificationPage.enterDurationField(6000);
notificationPage.clickCustomNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationPage.clickActionButton();
notificationPage.checkActionEvent();
@ -74,14 +83,14 @@ describe('Notifications Component', () => {
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', () => {
notificationPage.enterMessageField('Notification test');
notificationPage.clickCustomNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsDisplayed();
});
it('[C279987] Should show custom notification during a limited time when a duration is added', () => {
notificationPage.enterMessageField('Notification test');
notificationPage.enterDurationField(1000);
notificationPage.clickCustomNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsDisplayed();
browser.sleep(1500);
notificationPage.checkNotificationSnackBarIsNotDisplayed();
@ -90,7 +99,7 @@ describe('Notifications Component', () => {
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', () => {
notificationPage.enterMessageField('Notification test');
notificationPage.clickActionToggle();
notificationPage.clickCustomNotificationButton();
notificationPage.clickNotificationButton();
notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationPage.clickActionButton();
notificationPage.checkActionEvent();
@ -103,7 +112,7 @@ describe('Notifications Component', () => {
notificationPage.selectHorizontalPosition('Right');
notificationPage.selectVerticalPosition('Top');
notificationPage.selectDirection('Left to right');
notificationPage.clickCustomNotificationButton();
notificationPage.clickNotificationButton();
expect(notificationPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
});
});

View File

@ -16,8 +16,8 @@
*/
import { PermissionsPage } from '../pages/adf/permissionsPage';
import LoginPage = require('../pages/adf/loginPage');
import ContentServicesPage = require('../pages/adf/contentServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
import AcsUserModel = require('../models/ACS/acsUserModel');
import TestConfig = require('../test.config');
import resources = require('../util/resources');
@ -25,7 +25,7 @@ import ContentListPage = require('../pages/adf/dialog/contentList');
import AlfrescoApi = require('alfresco-js-api-node');
import FileModel = require('../models/ACS/fileModel');
import { UploadActions } from '../actions/ACS/upload.actions';
import Util = require('../util/util.js');
import Util = require('../util/util');
import { browser } from 'protractor';
describe('Permissions Component', function () {

View File

@ -17,9 +17,9 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import SearchDialog = require('../../pages/adf/dialog/searchDialog');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import filePreviewPage = require('../../pages/adf/filePreviewPage');
import SearchResultPage = require('../../pages/adf/searchResultsPage');
@ -55,6 +55,7 @@ describe('Search component - Search Bar', () => {
let firstFolderName = Util.generateRandomString(16);
let secondFolderName = Util.generateRandomString(16);
let thirdFolderName = Util.generateRandomString(16);
let filesToDelete = [];
let firstFileModel = new FileModel({
'name': filename, 'shortName': filename.substring(0, 8)
@ -87,11 +88,11 @@ describe('Search component - Search Bar', () => {
let firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
Object.assign(firstFileModel, firstFileUploaded.entry);
await uploadActions.uploadFolder(this.alfrescoJsApi, firstFolderModel.name, '-my-');
await uploadActions.uploadFolder(this.alfrescoJsApi, secondFolder.name, '-my-');
await uploadActions.uploadFolder(this.alfrescoJsApi, thirdFolder.name, '-my-');
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, firstFolderModel.name, '-my-'));
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, secondFolder.name, '-my-'));
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, thirdFolder.name, '-my-'));
await browser.driver.sleep(5000); // wait search index previous file/folder uploaded
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
loginPage.loginToContentServicesUsingUserModel(acsUser);
@ -100,13 +101,16 @@ describe('Search component - Search Bar', () => {
done();
});
// afterAll((done) => {
// NodesAPI.deleteContent(acsUser, firstFileModel.id, () => {
// NodesAPI.deleteContent(acsUser, firstFolderModel.id, () => {
// done();
// });
// });
// });
afterAll(async (done) => {
let uploadActions = new UploadActions();
filesToDelete.forEach(async (currentNode) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, currentNode.entry.id);
});
done();
});
it('[C272798] Search bar is visible', () => {
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible();

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import SearchDialog = require('../../pages/adf/dialog/searchDialog');
import SearchFiltersPage = require('../../pages/adf/searchFiltersPage');

View File

@ -24,7 +24,7 @@ import CONSTANTS = require('../../util/constants');
import { UploadActions } from '../../actions/ACS/upload.actions';
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import SearchDialog = require('../../pages/adf/dialog/searchDialog');
import SearchResultPage = require('../../pages/adf/searchResultsPage');
import SearchFiltersPage = require('../../pages/adf/searchFiltersPage');
@ -80,7 +80,7 @@ describe('Search Component - Multi-Select Facet', () => {
txtFileSite = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileInfo.location, txtFileInfo.name, site.entry.guid);
await browser.driver.sleep(20000);
await browser.driver.sleep(30000);
loginPage.loginToContentServicesUsingUserModel(acsUser);
@ -162,7 +162,7 @@ describe('Search Component - Multi-Select Facet', () => {
jpgFile = await uploadActions.uploadFile(this.alfrescoJsApi, jpgFileInfo.location, jpgFileInfo.name, site.entry.guid);
await browser.driver.sleep(20000);
await browser.driver.sleep(30000);
loginPage.loginToContentServicesUsingUserModel(userUploadingImg);
@ -226,7 +226,7 @@ describe('Search Component - Multi-Select Facet', () => {
});
txtFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileInfo.location, txtFileInfo.name, '-my-');
await browser.driver.sleep(20000);
await browser.driver.sleep(30000);
loginPage.loginToContentServicesUsingUserModel(acsUser);

View File

@ -17,9 +17,10 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import SearchDialog = require('../../pages/adf/dialog/searchDialog');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import SearchResultPage = require('../../pages/adf/searchResultsPage');
import filePreviewPage = require('../../pages/adf/filePreviewPage');

View File

@ -18,9 +18,9 @@
import AcsUserModel = require('../models/ACS/acsUserModel');
import FileModel = require('../models/ACS/fileModel');
import LoginPage = require('../pages/adf/loginPage');
import TagPage = require('../pages/adf/tagPage');
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
import { LoginPage } from '../pages/adf/loginPage';
import { TagPage } from '../pages/adf/tagPage';
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
import TestConfig = require('../test.config');
import resources = require('../util/resources');
@ -199,7 +199,7 @@ describe('Tag component', () => {
tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
});
it('[C286472] Should be able to click Show more/less button on "List Tags Content Services"', () => {
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.checkShowMoreButtonIsDisplayed();

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import { TrashcanPage } from '../pages/adf/trashcanPage';
import PaginationPage = require('../pages/adf/paginationPage');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ContentServicesPage = require('../pages/adf/contentServicesPage');
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 { ShareDialog } from '../pages/adf/dialog/shareDialog';

View File

@ -17,8 +17,8 @@
import { element, by, browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');

View File

@ -18,8 +18,8 @@
/* tslint:disable */
import { element, by, browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';

View File

@ -19,12 +19,12 @@ import { element, by } from 'protractor';
import Util = require('../../util/util');
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import NotificationPage = require('../../pages/adf/notificationPage');
import { NotificationPage } from '../../pages/adf/notificationPage';
import AcsUserModel = require('../../models/ACS/acsUserModel');
import FileModel = require('../../models/ACS/fileModel');

View File

@ -17,8 +17,8 @@
import { by, element } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import ContentListPage = require('../../pages/adf/dialog/contentList');
import { VersionManagePage } from '../../pages/adf/versionManagerPage';

View File

@ -17,12 +17,12 @@
import { element, by } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import ContentListPage = require('../../pages/adf/dialog/contentList');
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
import NotificationPage = require('../../pages/adf/notificationPage');
import { NotificationPage } from '../../pages/adf/notificationPage';
import AcsUserModel = require('../../models/ACS/acsUserModel');
import FileModel = require('../../models/ACS/fileModel');

View File

@ -17,8 +17,8 @@
import { by, element } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import ContentListPage = require('../../pages/adf/dialog/contentList');
import { VersionManagePage } from '../../pages/adf/versionManagerPage';

View File

@ -17,8 +17,8 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import ContentListPage = require('../../pages/adf/dialog/contentList');
import { VersionManagePage } from '../../pages/adf/versionManagerPage';

View File

@ -17,7 +17,7 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import CardViewPage = require('../../pages/adf/metadataViewPage');
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
@ -31,7 +31,7 @@ import resources = require('../../util/resources');
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../../actions/ACS/upload.actions';
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
describe('Aspect oriented config', () => {

View File

@ -17,7 +17,7 @@
import { element, by } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import CardViewPage = require('../../pages/adf/metadataViewPage');

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import CardViewPage = require('../../pages/adf/metadataViewPage');
import NavigationBarPage = require('../../pages/adf/navigationBarPage');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import CardViewPage = require('../../pages/adf/metadataViewPage');

View File

@ -17,8 +17,8 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
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');

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import DataTablePage = require('../../pages/adf/dataTablePage');
import TestConfig = require('../../test.config');

View File

@ -15,10 +15,10 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage.js');
import DataTablePage = require('../../pages/adf/dataTablePage.js');
import AcsUserModel = require('../../models/ACS/acsUserModel.js');
import TestConfig = require('../../test.config.js');
import { LoginPage } from '../../pages/adf/loginPage';
import DataTablePage = require('../../pages/adf/dataTablePage');
import AcsUserModel = require('../../models/ACS/acsUserModel');
import TestConfig = require('../../test.config');
import AlfrescoApi = require('alfresco-js-api-node');

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import AcsUserModel = require('../models/ACS/acsUserModel');
import TestConfig = require('../test.config');
import AlfrescoApi = require('alfresco-js-api-node');

View File

@ -14,11 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import { HeaderPage } from '../pages/adf/core/headerPage';
import SettingsPage = require('../pages/adf/settingsPage');
import { SettingsPage } from '../pages/adf/settingsPage';
import TestConfig = require('../test.config');
import AlfrescoApi = require('alfresco-js-api-node');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ContentServicesPage = require('../pages/adf/contentServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
import AcsUserModel = require('../models/ACS/acsUserModel');
import FolderModel = require('../models/ACS/folderModel');

View File

@ -17,23 +17,23 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import ProcessServicesPage = require('../../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process_services/processServicesPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import UserInfoDialog = require('../../pages/adf/dialog/userInfoDialog');
import { UserInfoDialog } from '../../pages/adf/dialog/userInfoDialog';
import TestConfig = require('../../test.config');
import AcsUserModel = require('../../models/ACS/acsUserModel');
import AdfSettingsPage = require('../../pages/adf/settingsPage');
import { SettingsPage } from '../../pages/adf/settingsPage';
import AlfrescoApi = require('alfresco-js-api-node');
import Util = require('../../util/util');
describe('Login component', () => {
let adfSettingsPage = new AdfSettingsPage();
let settingsPage = new SettingsPage();
let processServicesPage = new ProcessServicesPage();
let navigationBarPage = new NavigationBarPage();
let userInfoDialog = new UserInfoDialog();
@ -152,7 +152,7 @@ describe('Login component', () => {
it('[C260049] Login to Process Services with Content Services disabled', () => {
loginPage.goToLoginPage();
loginPage.checkSignInButtonIsDisabled();
adfSettingsPage.setProviderBpm();
settingsPage.setProviderBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.clickProcessServicesButton();
processServicesPage.checkApsContainer();
@ -163,7 +163,7 @@ describe('Login component', () => {
it('[C260050] Login to Content Services with Process Services disabled', () => {
loginPage.goToLoginPage();
loginPage.checkSignInButtonIsDisabled();
adfSettingsPage.setProviderEcm();
settingsPage.setProviderEcm();
loginPage.login(TestConfig.adf.adminUser, TestConfig.adf.adminPassword);
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
@ -172,9 +172,9 @@ describe('Login component', () => {
});
it('[C260051] Able to login to both Content Services and Process Services', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.checkSignInButtonIsDisabled();
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.clickProcessServicesButton();
processServicesPage.checkApsContainer();
@ -185,7 +185,7 @@ describe('Login component', () => {
});
it('[C277754] Should the user be redirect to the login page when the Content Service session expire', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
browser.executeScript('window.localStorage.removeItem("ticket-ECM");').then(() => {
browser.get(TestConfig.adf.url + '/files');
@ -195,7 +195,7 @@ describe('Login component', () => {
});
it('[C279932] Should successRoute property change the landing page when the user Login', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.enableSuccessRouteSwitch();
loginPage.enterSuccessRoute('activiti');
loginPage.login(adminUserModel.id, adminUserModel.password);
@ -203,7 +203,7 @@ describe('Login component', () => {
});
it('[C279931] Should the user be redirect to the login page when the Process Service session expire', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
browser.executeScript('window.localStorage.removeItem("ticket-BPM");').then(() => {
browser.get(TestConfig.adf.url + '/activiti');
@ -212,7 +212,7 @@ describe('Login component', () => {
});
it('[C279930] Should a user still be logged-in when open a new tab', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
Util.openNewTabInBrowser();
@ -242,7 +242,7 @@ describe('Login component', () => {
});
it('[C279933] Should be possible change the login component logo when logoImageUrl is changed', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.enableLogoSwitch();
loginPage.enterLogo('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
loginPage.checkLoginImgURL('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');

View File

@ -17,23 +17,24 @@
import { browser } from 'protractor';
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import ProcessServicesPage = require('../../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process_services/processServicesPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import TestConfig = require('../../test.config');
import AcsUserModel = require('../../models/ACS/acsUserModel');
import AdfSettingsPage = require('../../pages/adf/settingsPage');
import { SettingsPage } from '../../pages/adf/settingsPage';
import AlfrescoApi = require('alfresco-js-api-node');
import Util = require('../../util/util');
import { UploadActions } from '../../actions/ACS/upload.actions';
describe('Login component', () => {
describe('Login component - Redirect', () => {
let adfSettingsPage = new AdfSettingsPage();
let settingsPage = new SettingsPage();
let processServicesPage = new ProcessServicesPage();
let navigationBarPage = new NavigationBarPage();
let contentServicesPage = new ContentServicesPage();
@ -56,7 +57,7 @@ describe('Login component', () => {
});
it('[C213838] Should after login in CS be redirect to Login page when try to access to PS', () => {
adfSettingsPage.setProviderEcm();
settingsPage.setProviderEcm();
loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.clickContentServicesButton();
@ -68,7 +69,7 @@ describe('Login component', () => {
});
it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', () => {
adfSettingsPage.setProviderBpm();
settingsPage.setProviderBpm();
loginPage.enableSuccessRouteSwitch();
loginPage.enterSuccessRoute('activiti');
@ -84,7 +85,7 @@ describe('Login component', () => {
});
it('[C260081] Should after login in BOTH not be redirect to Login page when try to access to CS or PS', () => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
@ -101,7 +102,7 @@ describe('Login component', () => {
let uploadedFolder;
let folderName = Util.generateRandomString();
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
browser.controlFlow().execute(async () => {

View File

@ -15,17 +15,16 @@
* limitations under the License.
*/
import LoginPage = require('../../pages/adf/loginPage');
import AdfSettingsPage = require('../../pages/adf/settingsPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { SettingsPage } from '../../pages/adf/settingsPage';
describe('Login component - Remember Me', () => {
let adfSettingsPage = new AdfSettingsPage();
let settingsPage = new SettingsPage();
let loginPage = new LoginPage();
beforeAll((done) => {
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
done();
});

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ContentServicesPage = require('../pages/adf/contentServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
import PaginationPage = require('../pages/adf/paginationPage');
import AcsUserModel = require('../models/ACS/acsUserModel');

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import TestConfig = require('../test.config');

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
import AdfSettingsPage = require('../pages/adf/settingsPage');
import LoginPage = require('../pages/adf/loginPage');
import UserInfoDialog = require('../pages/adf/dialog/userInfoDialog');
import { SettingsPage } from '../pages/adf/settingsPage';
import { LoginPage } from '../pages/adf/loginPage';
import { UserInfoDialog } from '../pages/adf/dialog/userInfoDialog';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import AcsUserModel = require('../models/ACS/acsUserModel');
@ -33,7 +33,7 @@ import { UsersActions } from '../actions/users.actions';
describe('User Info component', () => {
let adfSettingsPage = new AdfSettingsPage();
let settingsPage = new SettingsPage();
let loginPage = new LoginPage();
let navigationBarPage = new NavigationBarPage();
let userInfoDialog = new UserInfoDialog();
@ -75,29 +75,34 @@ describe('User Info component', () => {
it('[C260111] Enable Process Services and Content Services ', () => {
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcmBpm();
settingsPage.setProviderEcmBpm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.dialogIsDisplayed().contentServicesTabIsDisplayed().processServicesTabIsDisplayed();
expect(userInfoDialog.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoDialog.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
userInfoDialog.checkInitialImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.ACSProfileImageNotDisplayed();
userInfoDialog.clickOnContentServicesTab();
expect(userInfoDialog.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoDialog.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
userInfoDialog.checkInitialImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.ACSProfileImageNotDisplayed();
userInfoDialog.clickOnProcessServicesTab().processServicesTabIsDisplayed();
userInfoDialog.clickOnProcessServicesTab();
expect(userInfoDialog.getProcessHeaderTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoDialog.getProcessTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoDialog.getProcessEmail()).toEqual(processUserModel.email);
userInfoDialog.checkInitialImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.ACSProfileImageNotDisplayed();
@ -106,15 +111,17 @@ describe('User Info component', () => {
it('[C260113] Enable Content Services and disable Process Services ', () => {
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
settingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.dialogIsDisplayed().contentServicesTabIsNotDisplayed().processServicesTabIsNotDisplayed();
userInfoDialog.dialogIsDisplayed();
expect(userInfoDialog.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoDialog.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoDialog.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
userInfoDialog.checkInitialImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.ACSProfileImageNotDisplayed();
@ -123,12 +130,12 @@ describe('User Info component', () => {
it('[C260115] Enable Process Services and disable Content Services ', () => {
loginPage.goToLoginPage();
adfSettingsPage.setProviderBpm();
settingsPage.setProviderBpm();
loginPage.login(processUserModel.email, processUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.dialogIsDisplayed().contentServicesTabIsNotDisplayed().processServicesTabIsNotDisplayed();
userInfoDialog.dialogIsDisplayed();
expect(userInfoDialog.getProcessHeaderTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoDialog.getProcessTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
@ -147,12 +154,14 @@ describe('User Info component', () => {
});
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
settingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.checkACSProfileImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.closeUserProfile();
done();
});
@ -162,9 +171,10 @@ describe('User Info component', () => {
await users.changeProfilePictureAps(this.alfrescoJsApi, apsAvatarFileModel.getLocation());
loginPage.goToLoginPage();
adfSettingsPage.setProviderBpm();
settingsPage.setProviderBpm();
loginPage.login(processUserModel.email, processUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.checkAPSProfileImage();
userInfoDialog.ACSProfileImageNotDisplayed();
userInfoDialog.initialImageNotDisplayed();
@ -173,10 +183,13 @@ describe('User Info component', () => {
it('[C260120] Delete the profile picture from ACS', () => {
PeopleAPI.deleteAvatarViaAPI(contentUserModel, '-me-');
loginPage.goToLoginPage();
adfSettingsPage.setProviderEcm();
settingsPage.setProviderEcm();
loginPage.login(contentUserModel.id, contentUserModel.password);
navigationBarPage.clickUserProfile();
userInfoDialog.checkInitialImage();
userInfoDialog.APSProfileImageNotDisplayed();
userInfoDialog.ACSProfileImageNotDisplayed();

View File

@ -17,10 +17,10 @@
import TestConfig = require('../../test.config');
import LoginPage = require('../../pages/adf/loginPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import resources = require('../../util/resources');
import Util = require('../../util/util');
@ -32,7 +32,6 @@ import AcsUserModel = require('../../models/ACS/acsUserModel');
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../../actions/ACS/upload.actions';
import { browser } from 'protractor';
describe('Viewer', () => {
@ -113,7 +112,6 @@ describe('Viewer', () => {
});
describe('Archive Folder Uploaded', () => {
let uploadedArchives;
let archiveFolderUploaded;
@ -134,12 +132,13 @@ describe('Viewer', () => {
});
it('[C260517] Should be possible to open any Archive file', () => {
contentServicesPage.navigateToFolder('archive');
uploadedArchives.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -168,12 +167,13 @@ describe('Viewer', () => {
});
it('[C280008] Should be possible to open any Excel file', () => {
contentServicesPage.navigateToFolder('excel');
uploadedExcels.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -202,12 +202,13 @@ describe('Viewer', () => {
});
it('[C280009] Should be possible to open any PowerPoint file', () => {
contentServicesPage.navigateToFolder('ppt');
uploadedPpts.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -236,12 +237,13 @@ describe('Viewer', () => {
});
it('[C280010] Should be possible to open any Text file', () => {
contentServicesPage.navigateToFolder('text');
uploadedTexts.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -270,12 +272,13 @@ describe('Viewer', () => {
});
it('[C280011] Should be possible to open any Word file', () => {
contentServicesPage.navigateToFolder('word');
uploadedWords.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -304,12 +307,13 @@ describe('Viewer', () => {
});
it('[C280012] Should be possible to open any other Document supported extension', () => {
contentServicesPage.navigateToFolder('other');
uploadedOthers.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
@ -338,12 +342,13 @@ describe('Viewer', () => {
});
it('[C279966] Should be possible to open any Image supported extension', () => {
contentServicesPage.navigateToFolder('images');
uploadedImages.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});

View File

@ -19,8 +19,8 @@ import { browser } from 'protractor';
import TestConfig = require('../../test.config');
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import resources = require('../../util/resources');

View File

@ -1,95 +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 TestConfig = require('../../test.config');
import LoginPage = require('../../pages/adf/loginPage');
import { ViewerPage } from '../../pages/adf/viewerPage';
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
import resources = require('../../util/resources');
import FileModel = require('../../models/ACS/fileModel');
import AcsUserModel = require('../../models/ACS/acsUserModel');
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../../actions/ACS/upload.actions';
import SettingsPage = require('../../pages/adf/settingsPage');
describe('Viewer Integration with Router', () => {
let acsUser;
let viewerPage = new ViewerPage();
let loginPage = new LoginPage();
let navigationBarPage = new NavigationBarPage();
let settingsPage = new SettingsPage();
let uploadActions = new UploadActions();
let pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: TestConfig.adf.url
});
done();
});
beforeEach(async (done) => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
let pngFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pngFile.location, pngFile.name, '-my-');
Object.assign(pngFile, pngFileUploaded.entry);
loginPage.goToLoginPage();
settingsPage.setProviderEcm();
done();
});
afterEach(() => {
this.alfrescoJsApi.nodes.deleteNode(pngFile.id);
});
it('[C260063] Should be able to open file with URL when user is logged in', () => {
loginPage.login(acsUser.id, acsUser.password);
navigationBarPage.openViewer(pngFile.id);
viewerPage.checkImgViewerIsDisplayed();
});
it('[C260061] Should be able to open file with URL when user is logged out', () => {
navigationBarPage.openViewer(pngFile.id);
loginPage.checkLoginFormIsDisplayed();
loginPage.login(acsUser.id, acsUser.password);
viewerPage.checkImgViewerIsDisplayed();
});
});

View File

@ -19,8 +19,8 @@ import { browser } from 'protractor';
import TestConfig = require('../../test.config');
import LoginPage = require('../../pages/adf/loginPage');
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import resources = require('../../util/resources');

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import AnalyticsPage = require('../pages/adf/process_services/analyticsPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
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');

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, browser } from 'protractor';
import { element, by } from 'protractor';
import Util = require('../../util/util');
export class ConfigEditorPage {

View File

@ -1,614 +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 = require('./dialog/contentList');
var CreateFolderDialog = require('./dialog/createFolderDialog');
var path = require('path');
var TestConfig = require('../../test.config');
var NavigationBarPage = require('./navigationBarPage');
var remote = require('selenium-webdriver/remote');
var ContentServicesPage = function () {
var contentList = new ContentList();
var createFolderDialog = new CreateFolderDialog();
var uploadBorder = element(by.css("div[id='document-list-container']"));
var tableBody = element.all(by.css("adf-document-list div[class='adf-datatable-body']")).first();
var contentServices = element(by.css("a[data-automation-id='Content Services']"));
var currentFolder = element(by.css("div[class*='adf-breadcrumb-item active'] div"));
var createFolderButton = element(by.cssContainingText("mat-icon", "create_new_folder"));
var activeBreadcrumb = element(by.css("div[class*='active']"));
var folderID = element.all(by.css("div[class*='settings'] p")).first();
var tooltip = by.css("div[class*='--text full-width'] span");
var uploadFileButton = element(by.css("input[data-automation-id='upload-single-file']"));
var uploadMultipleFileButton = element(by.css("input[data-automation-id='upload-multiple-files']"));
var uploadFolderButton = element(by.css("input[data-automation-id='uploadFolder']"));
var errorSnackBar = element(by.css("simple-snack-bar[class*='mat-simple-snackbar']"));
var contentServicesURL = TestConfig.adf.url + TestConfig.adf.port + "/files";
var loadMoreButton = element(by.css("button[data-automation-id='adf-infinite-pagination-button']"));
var emptyPagination = element(by.css("adf-pagination[class*='adf-pagination__empty']"));
var dragAndDrop = element.all(by.css("adf-upload-drag-area div")).first();
var nameHeader = element(by.css("div[data-automation-id='auto_id_name'] > span"));
var sizeHeader = element(by.css("div[data-automation-id='auto_id_content.sizeInBytes'] > span"));
var createdByHeader = element(by.css("div[data-automation-id='auto_id_createdByUser.displayName'] > span"));
var createdHeader = element(by.css("div[data-automation-id='auto_id_createdAt'] > span"));
var recentFiles = element(by.css(".adf-container-recent"));
var recentFilesExpanded = element(by.css(".adf-container-recent mat-expansion-panel-header.mat-expanded"));
var recentFilesClosed = element(by.css(".adf-container-recent mat-expansion-panel-header"));
var recentFileIcon = element(by.css(".adf-container-recent mat-expansion-panel-header mat-icon"));
var documentListSpinner = element(by.css("mat-progress-spinner"));
var emptyFolder = element(by.css(".adf-empty-folder-this-space-is-empty"));
var emptyFolderImage = element(by.css(".adf-empty-folder-image"));
var emptyRecent = element(by.css(".adf-container-recent .empty-list__title"));
var gridViewButton = element(by.css("button[data-automation-id='document-list-grid-view']"));
var cardViewContainer = element(by.css("div.document-list-container div.adf-data-table-card"));
var copyButton = element(by.css('button[data-automation-id="content-node-selector-actions-choose"]'));
var searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"'));
var shareNodeButton = element(by.cssContainingText("mat-icon", " share "));
this.getContentList = function () {
return contentList;
};
this.checkRecentFileToBeShowed = function () {
Util.waitUntilElementIsVisible(recentFiles);
};
this.expandRecentFiles = function () {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeClosed();
recentFilesClosed.click();
this.checkRecentFileToBeOpened()
};
this.closeRecentFiles = function() {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeOpened()
recentFilesExpanded.click();
this.checkRecentFileToBeClosed();
};
this.checkRecentFileToBeClosed = function () {
Util.waitUntilElementIsVisible(recentFilesClosed);
};
this.checkRecentFileToBeOpened = function () {
Util.waitUntilElementIsVisible(recentFilesExpanded);
};
this.getRecentFileIcon = async function () {
await Util.waitUntilElementIsVisible(recentFileIcon);
return recentFileIcon.getText();
};
/**
* Check Document List is displayed
* @method checkAcsContainer
*/
this.checkAcsContainer = function () {
Util.waitUntilElementIsVisible(uploadBorder);
return this;
};
this.waitForTableBody = function () {
Util.waitUntilElementIsVisible(tableBody);
};
/**
* Go to Document List Page
* @method goToDocumentList
* */
this.goToDocumentList = function () {
this.clickOnContentServices();
this.checkAcsContainer();
};
this.clickOnContentServices = function () {
Util.waitUntilElementIsVisible(contentServices);
Util.waitUntilElementIsClickable(contentServices);
contentServices.click();
};
this.navigateToDocumentList = function () {
var navigationBarPage = new NavigationBarPage();
navigationBarPage.clickContentServicesButton();
this.checkAcsContainer();
};
this.numberOfResultsDisplayed = function () {
return contentList.getAllDisplayedRows();
};
this.currentFolderName = function () {
var deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(currentFolder);
currentFolder.getText().then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.getTooltip = function (content) {
return contentList.getRowByRowName(content).element(tooltip).getAttribute('title');
};
this.getBreadcrumbTooltip = function (content) {
return element(by.css("nav[data-automation-id='breadcrumb'] div[title='" + content + "']")).getAttribute('title');
};
this.getAllRowsNameColumn = function () {
return contentList.getAllRowsNameColumn();
};
/**
* Sort the list by name column.
*
* @param sortOrder : 'true' to sort the list ascendant and 'false' for descendant
*/
this.sortByName = function (sortOrder) {
contentList.sortByName(sortOrder);
};
/**
* Sort the list by author column.
*
* @param sortOrder : 'true' to sort the list ascendant and 'false' for descendant
*/
this.sortByAuthor = function (sortOrder) {
contentList.sortByAuthor(sortOrder);
};
/**
* Sort the list by created column.
*
* @param sortOrder : 'true' to sort the list ascendant and 'false' for descendant
*/
this.sortByCreated = function (sortOrder) {
return contentList.sortByCreated(sortOrder);
};
/**
* Sort by name and check the list is sorted.
*
* @param sortOrder : 'true' if the list is expected to be sorted ascendant and 'false' for descendant
* @return result : 'true' if the list is sorted as expected and 'false' if it isn't
*/
this.sortAndCheckListIsOrderedByName = function (sortOrder) {
this.sortByName(sortOrder);
var deferred = protractor.promise.defer();
contentList.checkListIsOrderedByNameColumn(sortOrder).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.checkListIsSortedByNameColumn = async function(sortOrder) {
await contentList.checkListIsOrderedByNameColumn(sortOrder);
};
this.checkListIsSortedByCreatedColumn = async function(sortOrder) {
await contentList.checkListIsOrderedByCreatedColumn(sortOrder);
};
this.checkListIsSortedByAuthorColumn = async function(sortOrder) {
await contentList.checkListIsOrderedByAuthorColumn(sortOrder);
};
this.checkListIsSortedBySizeColumn = async function(sortOrder) {
await contentList.checkListIsOrderedBySizeColumn(sortOrder);
};
/**
* Sort by author and check the list is sorted.
*
* @param sortOrder : 'true' if the list is expected to be sorted ascendant and 'false' for descendant
* @return result : 'true' if the list is sorted as expected and 'false' if it isn't
*/
this.sortAndCheckListIsOrderedByAuthor = function (sortOrder) {
this.sortByAuthor(sortOrder);
var deferred = protractor.promise.defer();
contentList.checkListIsOrderedByAuthorColumn(sortOrder).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
/**
* Sort by created and check the list is sorted.
*
* @param sortOrder : 'true' if the list is expected to be sorted ascendant and 'false' for descendant
* @return result : 'true' if the list is sorted as expected and 'false' if it isn't
*/
this.sortAndCheckListIsOrderedByCreated = function (sortOrder) {
this.sortByCreated(sortOrder);
var deferred = protractor.promise.defer();
contentList.checkListIsOrderedByCreatedColumn(sortOrder).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.navigateToFolder = function (folder) {
contentList.navigateToFolder(folder);
return this;
};
this.doubleClickRow = function (folder) {
contentList.doubleClickRow(folder);
return this;
};
this.doubleClickEntireRow = function (folder) {
contentList.doubleClickEntireRow(folder);
return this;
};
this.clickOnCreateNewFolder = function () {
Util.waitUntilElementIsVisible(createFolderButton);
createFolderButton.click();
return this;
};
this.createNewFolder = function (folder) {
this.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folder);
createFolderDialog.clickOnCreateButton();
return this;
};
this.checkContentIsDisplayed = function (content) {
contentList.checkContentIsDisplayed(content);
return this;
};
this.checkContentsAreDisplayed = function (content) {
for (var i = 0; i < content.length; i++) {
this.checkContentIsDisplayed(content[i]);
}
return this;
};
this.checkContentIsNotDisplayed = function (content) {
contentList.checkContentIsNotDisplayed(content);
return this;
};
this.checkContentsAreNotDisplayed = function (content) {
for (var i = 0; i < content.length; i++) {
this.checkContentIsNotDisplayed(content[i]);
}
return this;
};
this.checkEmptyFolderMessageIsDisplayed = function () {
contentList.checkEmptyFolderMessageIsDisplayed();
return this;
};
this.checkElementIsDisplayed = function (elementName) {
let dataElement = element(by.css(`div[data-automation-id="${elementName}"]`));
Util.waitUntilElementIsVisible(dataElement);
};
this.navigateToFolderViaBreadcrumbs = function (folder) {
contentList.tableIsLoaded();
var breadcrumb = element(by.css("a[data-automation-id='breadcrumb_" + folder + "']"));
Util.waitUntilElementIsVisible(breadcrumb);
breadcrumb.click();
return this;
};
this.getActiveBreadcrumb = function () {
Util.waitUntilElementIsVisible(activeBreadcrumb);
return activeBreadcrumb.getAttribute("title");
};
this.getCurrentFolderID = function () {
Util.waitUntilElementIsVisible(folderID);
return folderID.getText();
};
this.checkIconColumn = function (file, extension) {
contentList.checkIconColumn(file, extension);
return this;
};
this.uploadFile = function (fileLocation) {
browser.setFileDetector(new remote.FileDetector());
this.checkUploadButton();
Util.waitUntilElementIsVisible(uploadFileButton);
uploadFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
this.checkUploadButton();
return this;
};
this.uploadMultipleFile = function (files) {
browser.setFileDetector(new remote.FileDetector());
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
var allFiles = path.resolve(path.join(TestConfig.main.rootPath, files[0]));
for (var i = 1; i < files.length; i++) {
allFiles = allFiles + "\n" + path.resolve(path.join(TestConfig.main.rootPath, files[i]));
}
uploadMultipleFileButton.sendKeys(allFiles);
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
return this;
};
this.uploadFolder = function (folder) {
browser.setFileDetector(new remote.FileDetector());
Util.waitUntilElementIsVisible(uploadFolderButton);
uploadFolderButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, folder)));
Util.waitUntilElementIsVisible(uploadFolderButton);
return this;
};
this.getSingleFileButtonTooltip = function () {
Util.waitUntilElementIsVisible(uploadFileButton);
return uploadFileButton.getAttribute("title");
};
this.getMultipleFileButtonTooltip = function () {
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
return uploadMultipleFileButton.getAttribute("title");
};
this.getFolderButtonTooltip = function () {
Util.waitUntilElementIsVisible(uploadFolderButton);
return uploadFolderButton.getAttribute("title");
};
this.checkUploadButton = function () {
Util.waitUntilElementIsVisible(uploadFileButton);
Util.waitUntilElementIsClickable(uploadFileButton);
return this;
};
this.uploadButtonIsEnabled = function () {
return uploadFileButton.isEnabled();
};
this.deleteContent = function (content) {
contentList.deleteContent(content);
return this;
};
this.deleteContents = function (content) {
for (var i = 0; i < content.length; i++) {
this.deleteContent(content[i]);
this.checkContentIsNotDisplayed(content[i]);
browser.driver.sleep(1000);
}
return this;
};
this.getErrorMessage = function () {
Util.waitUntilElementIsVisible(errorSnackBar);
var deferred = protractor.promise.defer();
errorSnackBar.getText().then(function (text) {
deferred.fulfill(text);
});
return deferred.promise;
};
this.checkItemInDocList = function (fileName) {
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='text_" + fileName + "']")));
};
this.enableInfiniteScrolling = function () {
var infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
Util.waitUntilElementIsVisible(infiniteScrollButton);
infiniteScrollButton.click();
return this;
};
this.enableCustomPermissionMessage = function () {
var customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
Util.waitUntilElementIsVisible(customPermissionMessage);
customPermissionMessage.click();
return this;
};
this.enableMediumTimeFormat = function () {
var mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
Util.waitUntilElementIsVisible(mediumTimeFormat);
mediumTimeFormat.click();
return this;
};
this.enableThumbnails = function () {
var thumbnailSlide = element(by.css('#adf-thumbnails-upload-switch'));
Util.waitUntilElementIsVisible(thumbnailSlide);
thumbnailSlide.click();
return this;
};
this.clickLoadMoreButton = function () {
Util.waitUntilElementIsVisible(loadMoreButton);
Util.waitUntilElementIsClickable(loadMoreButton);
loadMoreButton.click();
return this;
};
this.checkPaginationIsNotDisplayed = function () {
Util.waitUntilElementIsVisible(emptyPagination);
};
this.getDocumentListRowNumber = function() {
let documentList = element(by.css('adf-upload-drag-area adf-document-list'));
Util.waitUntilElementIsVisible(documentList);
let actualRows = $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
return actualRows;
};
this.checkColumnNameHeader = function() {
Util.waitUntilElementIsVisible(nameHeader);
};
this.checkColumnSizeHeader = function() {
Util.waitUntilElementIsVisible(sizeHeader);
};
this.checkColumnCreatedByHeader = function() {
Util.waitUntilElementIsVisible(createdByHeader);
};
this.checkColumnCreatedHeader = function() {
Util.waitUntilElementIsVisible(createdHeader);
};
this.checkDandDIsDisplayed = function () {
Util.waitUntilElementIsVisible(dragAndDrop);
};
this.checkLockIsDislpayedForElement = function(name) {
let lockButton = element(by.css(`div.adf-data-table-cell[filename="${name}"] button`));
Util.waitUntilElementIsVisible(lockButton);
};
this.getColumnValueForRow = function (file, columnName) {
let row = contentList.getRowByRowName(file);
Util.waitUntilElementIsVisible(row);
let rowColumn = row.element(by.css('div[title="'+columnName+'"] span'));
Util.waitUntilElementIsVisible(rowColumn);
return rowColumn.getText();
};
this.getStyleValueForRowText = async function(rowName, styleName) {
let row = element(by.css(`div.adf-data-table-cell[filename="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
Util.waitUntilElementIsVisible(row);
return row.getCssValue(styleName);
};
this.checkSpinnerIsShowed = function () {
Util.waitUntilElementIsPresent(documentListSpinner);
};
this.checkEmptyFolderTextToBe = function (text) {
Util.waitUntilElementIsVisible(emptyFolder);
expect(emptyFolder.getText()).toContain(text);
};
this.checkEmptyFolderImageUrlToContain = function (url) {
Util.waitUntilElementIsVisible(emptyFolderImage);
expect(emptyFolderImage.getAttribute('src')).toContain(url);
};
this.checkEmptyRecentFileIsDisplayed = function () {
Util.waitUntilElementIsVisible(emptyRecent);
};
this.checkIconForRowIsDisplayed = function(fileName) {
let iconRow = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${fileName}"] img`));
Util.waitUntilElementIsVisible(iconRow);
return iconRow;
};
this.getRowIconImageUrl = async function(fileName) {
let iconRow = this.checkIconForRowIsDisplayed(fileName);
return iconRow.getAttribute('src');
};
this.checkGridViewButtonIsVisible = function () {
Util.waitUntilElementIsVisible(gridViewButton);
};
this.clickGridViewButton = function() {
this.checkGridViewButtonIsVisible();
gridViewButton.click();
};
this.checkCardViewContainerIsDisplayed = function () {
Util.waitUntilElementIsVisible(cardViewContainer);
};
this.getCardElementShowedInPage = function() {
this.checkCardViewContainerIsDisplayed();
let actualCards = $$('div.document-list-container div.adf-data-table-card div.cell-value img').count();
return actualCards;
};
this.getDocumentCardIconForElement = function(elementName){
let elementIcon = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"] img`));
return elementIcon.getAttribute('src');
};
this.checkDocumentCardPropertyIsShowed = function(elementName, propertyName) {
let elementProperty = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"][title="${propertyName}"]`));
Util.waitUntilElementIsVisible(elementProperty);
};
this.getAttributeValueForElement = function(elementName, propertyName) {
let elementSize = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"][title="${propertyName}"] span`));
return elementSize.getText();
};
this.checkMenuIsShowedForElementIndex = function(elementIndex) {
let elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
Util.waitUntilElementIsVisible(elementMenu);
};
this.navigateToCardFolder = function(folderName) {
let folderCard = element(by.css(`.document-list-container div.image-table-cell.adf-data-table-cell[filename="${folderName}"]`));
folderCard.click();
let folderSelected = element(by.css(`.adf-datatable-row.is-selected div[filename="${folderName}"].adf-data-table-cell--image`));
Util.waitUntilElementIsVisible(folderSelected);
browser.actions().sendKeys(protractor.Key.ENTER).perform();
};
this.getGridViewSortingDropdown = function() {
let sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
Util.waitUntilElementIsVisible(sortingDropdown);
return sortingDropdown;
};
this.selectGridSortingFromDropdown = function(sortingChosen){
let dropdownSorting = this.getGridViewSortingDropdown();
dropdownSorting.click();
let optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
Util.waitUntilElementIsPresent(optionToClick);
optionToClick.click();
};
this.checkRowIsDisplayed = function(rowName){
let row = contentList.getRowByRowName(rowName);
Util.waitUntilElementIsVisible(row);
};
this.typeIntoNodeSelectorSearchField = function(text) {
Util.waitUntilElementIsVisible(searchInputElement);
searchInputElement.sendKeys(text);
};
this.clickContentNodeSelectorResult = function(name){
let resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[filename="${name}"`)).first();
Util.waitUntilElementIsVisible(resultElement);
resultElement.click();
};
this.clickCopyButton = function(){
Util.waitUntilElementIsClickable(copyButton);
copyButton.click();
};
this.clickShareButton = function(){
Util.waitUntilElementIsClickable(shareNodeButton);
shareNodeButton.click();
};
};
module.exports = ContentServicesPage;

View File

@ -0,0 +1,566 @@
/*!
* @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 = require('../../util/util');
import ContentList = require('./dialog/contentList');
import CreateFolderDialog = require('./dialog/createFolderDialog');
import TestConfig = require('../../test.config');
import NavigationBarPage = require('./navigationBarPage');
import path = require('path');
export class ContentServicesPage {
contentList = new ContentList();
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 active"] div'));
createFolderButton = element(by.cssContainingText('mat-icon', 'create_new_folder'));
activeBreadcrumb = element(by.css('div[class*="active"]'));
folderID = element.all(by.css('div[class*="settings"] p')).first();
tooltip = by.css('div[class*="--text full-width"] span');
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"]'));
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
loadMoreButton = element(by.css('button[data-automation-id="adf-infinite-pagination-button"]'));
emptyPagination = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
dragAndDrop = element.all(by.css('adf-upload-drag-area div')).first();
nameHeader = element(by.css('div[data-automation-id="auto_id_name"] > span'));
sizeHeader = element(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span'));
createdByHeader = element(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span'));
createdHeader = element(by.css('div[data-automation-id="auto_id_createdAt"] > span'));
recentFiles = element(by.css('.adf-container-recent'));
recentFilesExpanded = element(by.css('.adf-container-recent mat-expansion-panel-header.mat-expanded'));
recentFilesClosed = element(by.css('.adf-container-recent mat-expansion-panel-header'));
recentFileIcon = element(by.css('.adf-container-recent mat-expansion-panel-header mat-icon'));
documentListSpinner = element(by.css('mat-progress-spinner'));
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
emptyRecent = element(by.css('.adf-container-recent .empty-list__title'));
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
cardViewContainer = element(by.css('div.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"'));
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
getContentList() {
return this.contentList;
}
checkRecentFileToBeShowed() {
Util.waitUntilElementIsVisible(this.recentFiles);
}
expandRecentFiles() {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeClosed();
this.recentFilesClosed.click();
this.checkRecentFileToBeOpened();
}
closeRecentFiles() {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeOpened();
this.recentFilesExpanded.click();
this.checkRecentFileToBeClosed();
}
checkRecentFileToBeClosed() {
Util.waitUntilElementIsVisible(this.recentFilesClosed);
}
checkRecentFileToBeOpened() {
Util.waitUntilElementIsVisible(this.recentFilesExpanded);
}
async getRecentFileIcon() {
await Util.waitUntilElementIsVisible(this.recentFileIcon);
return this.recentFileIcon.getText();
}
checkAcsContainer() {
Util.waitUntilElementIsVisible(this.uploadBorder);
return this;
}
waitForTableBody() {
Util.waitUntilElementIsVisible(this.tableBody);
}
goToDocumentList() {
this.clickOnContentServices();
this.checkAcsContainer();
}
clickOnContentServices() {
Util.waitUntilElementIsVisible(this.contentServices);
Util.waitUntilElementIsClickable(this.contentServices);
this.contentServices.click();
}
navigateToDocumentList() {
let navigationBarPage = new NavigationBarPage();
navigationBarPage.clickContentServicesButton();
this.checkAcsContainer();
}
numberOfResultsDisplayed() {
return this.contentList.getAllDisplayedRows();
}
currentFolderName() {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.currentFolder);
this.currentFolder.getText().then(function (result) {
deferred.fulfill(result);
});
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');
}
getAllRowsNameColumn() {
return this.contentList.getAllRowsNameColumn();
}
sortByName(sortOrder) {
this.contentList.sortByName(sortOrder);
}
sortByAuthor(sortOrder) {
this.contentList.sortByAuthor(sortOrder);
}
sortByCreated(sortOrder) {
return this.contentList.sortByCreated(sortOrder);
}
sortAndCheckListIsOrderedByName(sortOrder) {
this.sortByName(sortOrder);
let deferred = protractor.promise.defer();
this.contentList.checkListIsOrderedByNameColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
async checkListIsSortedByNameColumn(sortOrder) {
await this.contentList.checkListIsOrderedByNameColumn(sortOrder);
}
async checkListIsSortedByCreatedColumn(sortOrder) {
await this.contentList.checkListIsOrderedByCreatedColumn(sortOrder);
}
async checkListIsSortedByAuthorColumn(sortOrder) {
await this.contentList.checkListIsOrderedByAuthorColumn(sortOrder);
}
async checkListIsSortedBySizeColumn(sortOrder) {
await this.contentList.checkListIsOrderedBySizeColumn(sortOrder);
}
sortAndCheckListIsOrderedByAuthor(sortOrder) {
this.sortByAuthor(sortOrder);
let deferred = protractor.promise.defer();
this.contentList.checkListIsOrderedByAuthorColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
sortAndCheckListIsOrderedByCreated(sortOrder) {
this.sortByCreated(sortOrder);
let deferred = protractor.promise.defer();
this.contentList.checkListIsOrderedByCreatedColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
navigateToFolder(folder) {
this.contentList.navigateToFolder(folder);
return this;
}
doubleClickRow(folder) {
this.contentList.doubleClickRow(folder);
return this;
}
doubleClickEntireRow(folder) {
this.contentList.doubleClickEntireRow(folder);
return this;
}
clickOnCreateNewFolder() {
Util.waitUntilElementIsVisible(this.createFolderButton);
this.createFolderButton.click();
return this;
}
createNewFolder(folder) {
this.clickOnCreateNewFolder();
this.createFolderDialog.addFolderName(folder);
this.createFolderDialog.clickOnCreateButton();
return this;
}
checkContentIsDisplayed(content) {
this.contentList.checkContentIsDisplayed(content);
return this;
}
checkContentsAreDisplayed(content) {
for (let i = 0; i < content.length; i++) {
this.checkContentIsDisplayed(content[i]);
}
return this;
}
checkContentIsNotDisplayed(content) {
this.contentList.checkContentIsNotDisplayed(content);
return this;
}
checkContentsAreNotDisplayed(content) {
for (let i = 0; i < content.length; i++) {
this.checkContentIsNotDisplayed(content[i]);
}
return this;
}
checkEmptyFolderMessageIsDisplayed() {
this.contentList.checkEmptyFolderMessageIsDisplayed();
return this;
}
checkElementIsDisplayed(elementName) {
let dataElement = element(by.css(`div[data-automation-id="${elementName}"]`));
Util.waitUntilElementIsVisible(dataElement);
}
navigateToFolderViaBreadcrumbs(folder) {
this.contentList.tableIsLoaded();
let breadcrumb = element(by.css('a[data-automation-id="breadcrumb_' + folder + '"]'));
Util.waitUntilElementIsVisible(breadcrumb);
breadcrumb.click();
return this;
}
getActiveBreadcrumb() {
Util.waitUntilElementIsVisible(this.activeBreadcrumb);
return this.activeBreadcrumb.getAttribute('title');
}
getCurrentFolderID() {
Util.waitUntilElementIsVisible(this.folderID);
return this.folderID.getText();
}
checkIconColumn(file, extension) {
this.contentList.checkIconColumn(file, extension);
return this;
}
uploadFile(fileLocation) {
this.checkUploadButton();
Util.waitUntilElementIsVisible(this.uploadFileButton);
this.uploadFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
this.checkUploadButton();
return this;
}
uploadMultipleFile(files) {
Util.waitUntilElementIsVisible(this.uploadMultipleFileButton);
let allFiles = path.resolve(path.join(TestConfig.main.rootPath, files[0]));
for (let i = 1; i < files.length; i++) {
allFiles = allFiles + '\n' + path.resolve(path.join(TestConfig.main.rootPath, files[i]));
}
this.uploadMultipleFileButton.sendKeys(allFiles);
Util.waitUntilElementIsVisible(this.uploadMultipleFileButton);
return this;
}
uploadFolder(folder) {
Util.waitUntilElementIsVisible(this.uploadFolderButton);
this.uploadFolderButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, folder)));
Util.waitUntilElementIsVisible(this.uploadFolderButton);
return this;
}
getSingleFileButtonTooltip() {
Util.waitUntilElementIsVisible(this.uploadFileButton);
return this.uploadFileButton.getAttribute('title');
}
getMultipleFileButtonTooltip() {
Util.waitUntilElementIsVisible(this.uploadMultipleFileButton);
return this.uploadMultipleFileButton.getAttribute('title');
}
getFolderButtonTooltip() {
Util.waitUntilElementIsVisible(this.uploadFolderButton);
return this.uploadFolderButton.getAttribute('title');
}
checkUploadButton() {
Util.waitUntilElementIsVisible(this.uploadFileButton);
Util.waitUntilElementIsClickable(this.uploadFileButton);
return this;
}
uploadButtonIsEnabled() {
return this.uploadFileButton.isEnabled();
}
deleteContent(content) {
this.contentList.deleteContent(content);
return this;
}
deleteContents(content) {
for (let i = 0; i < content.length; i++) {
this.deleteContent(content[i]);
this.checkContentIsNotDisplayed(content[i]);
browser.driver.sleep(1000);
}
return this;
}
getErrorMessage() {
Util.waitUntilElementIsVisible(this.errorSnackBar);
let deferred = protractor.promise.defer();
this.errorSnackBar.getText().then(function (text) {
deferred.fulfill(text);
});
return deferred.promise;
}
checkItemInDocList(fileName) {
Util.waitUntilElementIsVisible(element(by.css('div[data-automation-id="text_' + fileName + '"]')));
}
enableInfiniteScrolling() {
let infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
Util.waitUntilElementIsVisible(infiniteScrollButton);
infiniteScrollButton.click();
return this;
}
enableCustomPermissionMessage() {
let customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
Util.waitUntilElementIsVisible(customPermissionMessage);
customPermissionMessage.click();
return this;
}
enableMediumTimeFormat() {
let mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
Util.waitUntilElementIsVisible(mediumTimeFormat);
mediumTimeFormat.click();
return this;
}
enableThumbnails() {
let thumbnailSlide = element(by.css('#adf-thumbnails-upload-switch'));
Util.waitUntilElementIsVisible(thumbnailSlide);
thumbnailSlide.click();
return this;
}
clickLoadMoreButton() {
Util.waitUntilElementIsVisible(this.loadMoreButton);
Util.waitUntilElementIsClickable(this.loadMoreButton);
this.loadMoreButton.click();
return this;
}
checkPaginationIsNotDisplayed() {
Util.waitUntilElementIsVisible(this.emptyPagination);
}
getDocumentListRowNumber() {
let documentList = element(by.css('adf-upload-drag-area adf-document-list'));
Util.waitUntilElementIsVisible(documentList);
let actualRows = $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
return actualRows;
}
checkColumnNameHeader() {
Util.waitUntilElementIsVisible(this.nameHeader);
}
checkColumnSizeHeader() {
Util.waitUntilElementIsVisible(this.sizeHeader);
}
checkColumnCreatedByHeader() {
Util.waitUntilElementIsVisible(this.createdByHeader);
}
checkColumnCreatedHeader() {
Util.waitUntilElementIsVisible(this.createdHeader);
}
checkDandDIsDisplayed() {
Util.waitUntilElementIsVisible(this.dragAndDrop);
}
checkLockIsDislpayedForElement(name) {
let lockButton = element(by.css(`div.adf-data-table-cell[filename="${name}"] button`));
Util.waitUntilElementIsVisible(lockButton);
}
getColumnValueForRow(file, columnName) {
let row = this.contentList.getRowByRowName(file);
Util.waitUntilElementIsVisible(row);
let rowColumn = row.element(by.css('div[title="' + columnName + '"] span'));
Util.waitUntilElementIsVisible(rowColumn);
return rowColumn.getText();
}
async getStyleValueForRowText(rowName, styleName) {
let row = element(by.css(`div.adf-data-table-cell[filename="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
Util.waitUntilElementIsVisible(row);
return row.getCssValue(styleName);
}
checkSpinnerIsShowed() {
Util.waitUntilElementIsPresent(this.documentListSpinner);
}
checkEmptyFolderTextToBe(text) {
Util.waitUntilElementIsVisible(this.emptyFolder);
expect(this.emptyFolder.getText()).toContain(text);
}
checkEmptyFolderImageUrlToContain(url) {
Util.waitUntilElementIsVisible(this.emptyFolderImage);
expect(this.emptyFolderImage.getAttribute('src')).toContain(url);
}
checkEmptyRecentFileIsDisplayed() {
Util.waitUntilElementIsVisible(this.emptyRecent);
}
checkIconForRowIsDisplayed(fileName) {
let iconRow = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${fileName}"] img`));
Util.waitUntilElementIsVisible(iconRow);
return iconRow;
}
async getRowIconImageUrl(fileName) {
let iconRow = this.checkIconForRowIsDisplayed(fileName);
return iconRow.getAttribute('src');
}
checkGridViewButtonIsVisible() {
Util.waitUntilElementIsVisible(this.gridViewButton);
}
clickGridViewButton() {
this.checkGridViewButtonIsVisible();
this.gridViewButton.click();
}
checkCardViewContainerIsDisplayed() {
Util.waitUntilElementIsVisible(this.cardViewContainer);
}
getCardElementShowedInPage() {
this.checkCardViewContainerIsDisplayed();
let actualCards = $$('div.document-list-container div.adf-data-table-card div.cell-value img').count();
return actualCards;
}
getDocumentCardIconForElement(elementName) {
let elementIcon = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"] img`));
return elementIcon.getAttribute('src');
}
checkDocumentCardPropertyIsShowed(elementName, propertyName) {
let elementProperty = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"][title="${propertyName}"]`));
Util.waitUntilElementIsVisible(elementProperty);
}
getAttributeValueForElement(elementName, propertyName) {
let elementSize = element(by.css(`.document-list-container div.adf-data-table-cell[filename="${elementName}"][title="${propertyName}"] span`));
return elementSize.getText();
}
checkMenuIsShowedForElementIndex(elementIndex) {
let elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
Util.waitUntilElementIsVisible(elementMenu);
}
navigateToCardFolder(folderName) {
let folderCard = element(by.css(`.document-list-container div.image-table-cell.adf-data-table-cell[filename="${folderName}"]`));
folderCard.click();
let folderSelected = element(by.css(`.adf-datatable-row.is-selected div[filename="${folderName}"].adf-data-table-cell--image`));
Util.waitUntilElementIsVisible(folderSelected);
browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
getGridViewSortingDropdown() {
let sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
Util.waitUntilElementIsVisible(sortingDropdown);
return sortingDropdown;
}
selectGridSortingFromDropdown(sortingChosen) {
let dropdownSorting = this.getGridViewSortingDropdown();
dropdownSorting.click();
let optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
Util.waitUntilElementIsPresent(optionToClick);
optionToClick.click();
}
checkRowIsDisplayed(rowName) {
let row = this.contentList.getRowByRowName(rowName);
Util.waitUntilElementIsVisible(row);
}
typeIntoNodeSelectorSearchField(text) {
Util.waitUntilElementIsVisible(this.searchInputElement);
this.searchInputElement.sendKeys(text);
}
clickContentNodeSelectorResult(name) {
let resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[filename="${name}"`)).first();
Util.waitUntilElementIsVisible(resultElement);
resultElement.click();
}
clickCopyButton() {
Util.waitUntilElementIsClickable(this.copyButton);
this.copyButton.click();
}
clickShareButton() {
Util.waitUntilElementIsClickable(this.shareNodeButton);
this.shareNodeButton.click();
}
}

View File

@ -18,6 +18,7 @@
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']"));
@ -334,7 +335,6 @@ var ContentList = function () {
this.checkIconColumn = function (file, extension) {
var row = this.getRowByRowName(file);
Util.waitUntilElementIsVisible(row);
Util.waitUntilElementIsVisible(row.element(by.css("div[class*='--image'] img[alt*='" + extension + "']")));
};

View File

@ -27,7 +27,6 @@ var SearchDialog = function () {
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']"));
var allRows = element.all(by.css("h4[class*='adf-search-fixed-text']"));
this.pressDownArrowAndEnter = function () {
element(by.css("adf-search-control div input")).sendKeys(protractor.Key.ARROW_DOWN);

View File

@ -1,154 +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 UserInfoDialog = function () {
var dialog = element(by.css("mat-card[class*='adf-userinfo-card']"));
var contentServicesTab = element(by.css("div[id*='mat-tab-label-0-0']"));
var processServicesTab = element(by.css("div[id*='mat-tab-label-0-1']"));
var userImage = element(by.css("div[id='user-initial-image']"));
var userInfoEcmHeaderTitle = element(by.css("div[id='ecm-username']"));
var userInfoEcmTitle = element(by.css("mat-card-content span[id='ecm-full-name']"));
var ecmEmail = element(by.css("span[id='ecm-email']"));
var ecmJobTitle = element(by.css("span[id='ecm-job-title']"));
var userInfoProcessHeaderTitle = element(by.css("div[id='bpm-username']"));
var userInfoProcessTitle = element(by.css("mat-card-content span[id='bpm-full-name']"));
var processEmail = element(by.css("span[id='bpm-email']"));
var processTenant = element(by.css("span[class='detail-profile']"));
var apsImage = element(by.css("img[id='bpm-user-detail-image']"));
var acsImage = element(by.css("img[id='ecm-user-detail-image']"));
var initialImage = element.all(by.css("div[id='user-initials-image']")).first();
this.dialogIsDisplayed = function () {
Util.waitUntilElementIsVisible(dialog);
return this;
};
this.dialogIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(dialog);
return this;
};
this.contentServicesTabIsDisplayed = function () {
Util.waitUntilElementIsVisible(contentServicesTab);
return this;
};
this.contentServicesTabIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(contentServicesTab);
return this;
};
this.clickOnContentServicesTab = function () {
this.contentServicesTabIsDisplayed();
contentServicesTab.click();
return this;
};
this.processServicesTabIsDisplayed = function () {
Util.waitUntilElementIsVisible(processServicesTab);
return this;
};
this.processServicesTabIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(processServicesTab);
return this;
};
this.clickOnProcessServicesTab = function () {
this.processServicesTabIsDisplayed();
processServicesTab.click();
return this;
};
this.userImageIsDisplayed = function () {
Util.waitUntilElementIsVisible(userImage);
return this;
};
this.getContentHeaderTitle = function () {
Util.waitUntilElementIsVisible(userInfoEcmHeaderTitle);
return userInfoEcmHeaderTitle.getText();
};
this.getContentTitle = function () {
Util.waitUntilElementIsVisible(userInfoEcmTitle);
return userInfoEcmTitle.getText();
};
this.getContentEmail = function () {
Util.waitUntilElementIsVisible(ecmEmail);
return ecmEmail.getText();
};
this.getContentJobTitle = function () {
Util.waitUntilElementIsVisible(ecmJobTitle);
return ecmJobTitle.getText();
};
this.getProcessHeaderTitle = function () {
Util.waitUntilElementIsVisible(userInfoProcessHeaderTitle);
return userInfoProcessHeaderTitle.getText();
};
this.getProcessTitle = function () {
Util.waitUntilElementIsVisible(userInfoProcessTitle);
return userInfoProcessTitle.getText();
};
this.getProcessEmail = function () {
Util.waitUntilElementIsVisible(processEmail);
return processEmail.getText();
};
this.getProcessTenant = function () {
Util.waitUntilElementIsVisible(processTenant);
return processTenant.getText();
};
this.closeUserProfile = function () {
Util.waitUntilElementIsVisible(dialog);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
};
this.checkACSProfileImage = function () {
Util.waitUntilElementIsVisible(acsImage);
};
this.checkAPSProfileImage = function () {
Util.waitUntilElementIsVisible(apsImage);
};
this.checkInitialImage = function () {
Util.waitUntilElementIsVisible(initialImage);
};
this.initialImageNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(initialImage);
};
this.ACSProfileImageNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(acsImage);
};
this.APSProfileImageNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(apsImage);
};
};
module.exports = UserInfoDialog;

View File

@ -0,0 +1,132 @@
/*!
* @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 = require('../../../util/util');
import { TabsPage } from '../material/tabsPage';
export class UserInfoDialog {
dialog = element(by.css('mat-card[class*="adf-userinfo-card"]'));
userImage = element(by.css('div[id="user-initial-image"]'));
userInfoEcmHeaderTitle = element(by.css('div[id="ecm-username"]'));
userInfoEcmTitle = element(by.css('mat-card-content span[id="ecm-full-name"]'));
ecmEmail = element(by.css('span[id="ecm-email"]'));
ecmJobTitle = element(by.css('span[id="ecm-job-title"]'));
userInfoProcessHeaderTitle = element(by.css('div[id="bpm-username"]'));
userInfoProcessTitle = element(by.css('mat-card-content span[id="bpm-full-name"]'));
processEmail = element(by.css('span[id="bpm-email"]'));
processTenant = element(by.css('span[class="detail-profile"]'));
apsImage = element(by.css('img[id="bpm-user-detail-image"]'));
acsImage = element(by.css('img[id="ecm-user-detail-image"]'));
initialImage = element.all(by.css('div[id="user-initials-image"]')).first();
dialogIsDisplayed() {
Util.waitUntilElementIsVisible(this.dialog);
return this;
}
dialogIsNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.dialog);
return this;
}
clickOnContentServicesTab() {
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Content Services');
return this;
}
clickOnProcessServicesTab() {
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Process Services');
return this;
}
userImageIsDisplayed() {
Util.waitUntilElementIsVisible(this.userImage);
return this;
}
getContentHeaderTitle() {
Util.waitUntilElementIsVisible(this.userInfoEcmHeaderTitle);
return this.userInfoEcmHeaderTitle.getText();
}
getContentTitle() {
Util.waitUntilElementIsVisible(this.userInfoEcmTitle);
return this.userInfoEcmTitle.getText();
}
getContentEmail() {
Util.waitUntilElementIsVisible(this.ecmEmail);
return this.ecmEmail.getText();
}
getContentJobTitle() {
Util.waitUntilElementIsVisible(this.ecmJobTitle);
return this.ecmJobTitle.getText();
}
getProcessHeaderTitle() {
Util.waitUntilElementIsVisible(this.userInfoProcessHeaderTitle);
return this.userInfoProcessHeaderTitle.getText();
}
getProcessTitle() {
Util.waitUntilElementIsVisible(this.userInfoProcessTitle);
return this.userInfoProcessTitle.getText();
}
getProcessEmail() {
Util.waitUntilElementIsVisible(this.processEmail);
return this.processEmail.getText();
}
getProcessTenant() {
Util.waitUntilElementIsVisible(this.processTenant);
return this.processTenant.getText();
}
closeUserProfile() {
Util.waitUntilElementIsVisible(this.dialog);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
checkACSProfileImage() {
Util.waitUntilElementIsVisible(this.acsImage);
}
checkAPSProfileImage() {
Util.waitUntilElementIsVisible(this.apsImage);
}
checkInitialImage() {
Util.waitUntilElementIsVisible(this.initialImage);
}
initialImageNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.initialImage);
}
ACSProfileImageNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.acsImage);
}
APSProfileImageNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.apsImage);
}
}

View File

@ -1,559 +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 TestConfig = require('../../test.config');
var AdfSettingsPage = require('./settingsPage');
var LoginPage = function () {
var loginURL = TestConfig.adf.url + TestConfig.adf.port + "/login";
var txtUsername = element(by.css("input[id='username']"));
var txtPassword = element(by.css("input[id='password']"));
var logoImg = element(by.css("img[id='adf-login-img-logo']"));
var successRouteTxt = element(by.css("input[data-automation-id='adf-success-route']"));
var logoTxt = element(by.css("input[data-automation-id='adf-url-logo']"));
var usernameTooltip = element(by.css("span[data-automation-id='username-error']"));
var passwordTooltip = element(by.css("span[data-automation-id='password-required']"));
var loginTooltip = element(by.css("span[class='login-error-message']"));
var usernameInactive = element(by.css("input[id='username'][aria-invalid='false']"));
var passwordInactive = element(by.css("input[id='password'][aria-invalid='false']"));
var adfLogo = element(by.css("img[class='adf-img-logo ng-star-inserted']"));
var usernameHighlighted = element(by.css("input[id='username'][aria-invalid='true']"));
var passwordHighlighted = element(by.css("input[id='password'][aria-invalid='true']"));
var signInButton = element(by.id('login-button'));
var showPassword = element(by.css("mat-icon[data-automation-id='show_password']"));
var hidePassword = element(by.css("mat-icon[data-automation-id='hide_password']"));
var rememberMe = element(by.css("mat-checkbox[id='adf-login-remember']"));
var needHelp = element(by.css("div[id='adf-login-action-left']"));
var register = element(by.css("div[id='adf-login-action-right']"));
var footerSwitch = element(by.id("switch4"));
var rememberMeSwitch = element(by.id("adf-toogle-show-rememberme"));
var successRouteSwitch = element(by.id("adf-toogle-show-successRoute"));
var logoSwitch = element(by.id("adf-toogle-logo"));
var userPicture = element(by.id("userinfo_container"));
var header = element(by.id("adf-header"));
var cardBackground = element(by.css("mat-card[class*='adf-login-card']"));
var adfSettingsPage = new AdfSettingsPage();
var loginForm = element(by.css("form[id='adf-login-form'"));
this.checkLoginFormIsDisplayed = function () {
Util.waitUntilElementIsVisible(loginForm);
};
/**
* Provides the longer wait required
* @property waitForElements
* @type protractor.Element
* */
this.waitForElements = function () {
var deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(txtUsername).then(() => {
Util.waitUntilElementIsVisible(txtPassword).then(() => {
deferred.fulfill();
}, () => {
deferred.rejected();
})
});
return deferred.promise;
};
/**
* Fills the username input
* @method enterUsername
* @param {String} username
*/
this.enterUsername = function (username) {
Util.waitUntilElementIsVisible(txtUsername);
txtUsername.sendKeys('');
return txtUsername.clear().sendKeys(username);
};
/**
* Fills the password input
* @method enterPassword
* @param {String} password
*/
this.enterPassword = function (password) {
Util.waitUntilElementIsVisible(txtPassword);
return txtPassword.clear().sendKeys(password);
};
/**
* clears username input
* @method clearUsername
* @param {String} username
*/
this.clearUsername = function () {
Util.waitUntilElementIsVisible(txtUsername);
return txtUsername.click().clear();
};
/**
* clears password input
* @method clearPassword
* @param {String} password
*/
this.clearPassword = function () {
Util.waitUntilElementIsVisible(txtPassword);
txtPassword.getAttribute('value').then(function (value) {
for (var i = value.length; i >= 0; i--) {
txtPassword.sendKeys(protractor.Key.BACK_SPACE);
}
});
};
/**
* checks username tooltips
* @method checkUsernameTooltip
* @param {String} message
*/
this.checkUsernameTooltip = function () {
Util.waitUntilElementIsVisible(usernameTooltip);
};
/**
* checks password tooltips
* @method checkPasswordTooltip
* @param {String} message
*/
this.checkPasswordTooltip = function () {
Util.waitUntilElementIsVisible(passwordTooltip);
};
/**
* checks login error tooltips
* @method checkLoginError
* @param {String} message
*/
this.checkLoginError = function (message) {
Util.waitUntilElementIsVisible(loginTooltip);
expect(loginTooltip.getText()).toEqual(message);
};
/**
* checks login error tooltips
* @method checkLoginError
* @param {String} message
*/
this.checkLoginImgURL = function (url) {
Util.waitUntilElementIsVisible(logoImg);
expect(logoImg.getAttribute('src')).toEqual(url);
};
/**
* checks username field is inactive
* @method checkUsernameInactive
*/
this.checkUsernameInactive = function () {
Util.waitUntilElementIsVisible(usernameInactive);
};
/**
* checks password field is inactive
* @method checkPasswordInactive
*/
this.checkPasswordInactive = function () {
Util.waitUntilElementIsVisible(passwordInactive);
};
/**
* checks username field is highlighted
* @method checkUsernameHighlighted
*/
this.checkUsernameHighlighted = function () {
adfLogo.click();
Util.waitUntilElementIsVisible(usernameHighlighted);
};
/**
* checks password field is highlighted
* @method checkPasswordHighlighted
*/
this.checkPasswordHighlighted = function () {
adfLogo.click();
Util.waitUntilElementIsVisible(passwordHighlighted);
};
/**
* check Username tooltip is not visible
* @method checkUsernameTooltipIsNotVisible
*/
this.checkUsernameTooltipIsNotVisible = function () {
Util.waitUntilElementIsNotVisible(usernameTooltip);
};
/**
* checks password tooltip is not visible
* @method checkPasswordTooltipIsNotVisible
*/
this.checkPasswordTooltipIsNotVisible = function () {
Util.waitUntilElementIsNotVisible(passwordTooltip);
};
/**
* checks sign in button is enabled
* @method checkSignInButtonIsEnabled
*/
this.checkSignInButtonIsEnabled = function () {
Util.waitUntilElementIsVisible(signInButton);
expect(signInButton.isEnabled()).toBe(true);
};
/**
* Logs into adf using default host config
* @method defaultLogin
*/
this.defaultLogin = function () {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
};
/**
* Logs into adf using userModel
* @method loginUsingUserModel
*/
this.loginUsingUserModel = function (userModel) {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
this.waitForElements();
this.login(userModel.getId(), userModel.getPassword());
};
/**
* Logs into ADF using userModel - only Process Services enabled
* @method loginUsingUserModel
*/
this.loginToProcessServicesUsingUserModel = function (userModel) {
adfSettingsPage.setProviderBpm();
this.waitForElements();
this.login(userModel.email, userModel.password);
};
this.loginToProcessServicesUsingDefaultUser = function () {
adfSettingsPage.setProviderBpm();
this.waitForElements();
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
};
this.loginToContentServicesUsingUserModel = function (userModel) {
adfSettingsPage.setProviderEcm();
this.waitForElements();
this.login(userModel.getId(), userModel.getPassword());
};
this.loginToContentServices = function (username, password) {
adfSettingsPage.setProviderEcm();
this.waitForElements();
this.login(username, password);
};
/**
* Go to adf login page
* @method goToLoginPage
*/
this.goToLoginPage = function () {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
this.waitForElements();
};
/**
* checks sign in button is disabled
* @method checkSignInButtonIsDisabled
*/
this.checkSignInButtonIsDisabled = function () {
Util.waitUntilElementIsVisible(signInButton);
expect(signInButton.isEnabled()).toBe(false);
};
/**
* clicks the sign in button
* @method clickSignInButton
*/
this.clickSignInButton = function () {
Util.waitUntilElementIsVisible(signInButton);
signInButton.click();
};
/**
* clicks the remember me checkbox
*/
this.clickRememberMe = function () {
Util.waitUntilElementIsVisible(rememberMe);
rememberMe.click();
};
/**
* clicks icon to show password
* @method showPassword
*/
this.showPassword = function () {
Util.waitUntilElementIsVisible(showPassword);
showPassword.click();
};
this.getShowPasswordIconColor = function () {
var deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(showPassword);
showPassword.getCssValue('color').then(function (value) {
deferred.fulfill(value);
});
return deferred.promise;
};
this.getSignInButtonColor = function () {
var deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(signInButton);
signInButton.getCssValue("color").then(function (value) {
deferred.fulfill(value);
});
return deferred.promise;
};
this.getBackgroundColor = function () {
var deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(cardBackground);
cardBackground.getCssValue("color").then(function (value) {
deferred.fulfill(value);
});
return deferred.promise;
};
/**
* clicks icon to hide password
* @method hidePassword
*/
this.hidePassword = function () {
Util.waitUntilElementIsVisible(hidePassword);
hidePassword.click();
};
/**
* checks if password is shown
* @method checkPasswordIsShown
* @param password
*/
this.checkPasswordIsShown = function (password) {
txtPassword.getAttribute('value').then(function (text) {
expect(text).toEqual(password);
});
};
/**
* checks if password is hidden
* @method checkPasswordIsHidden
*/
this.checkPasswordIsHidden = function () {
Util.waitUntilElementIsVisible(txtPassword);
};
/**
* checks 'Remember me' is displayed
* @method checkRememberIsDisplayed
*/
this.checkRememberIsDisplayed = function () {
Util.waitUntilElementIsVisible(rememberMe);
};
/**
* checks 'Remember me' is not displayed
* @method checkRememberIsNotDisplayed
*/
this.checkRememberIsNotDisplayed = function () {
Util.waitUntilElementIsNotVisible(rememberMe);
};
/**
* checks 'Need help' is Displayed
* @method checkNeedHelpIsDisplayed
*/
this.checkNeedHelpIsDisplayed = function () {
Util.waitUntilElementIsVisible(needHelp);
};
/**
* checks 'Need Help' is not displayed
* @method checkNeedHelpIsNotDisplayed
*/
this.checkNeedHelpIsNotDisplayed = function () {
Util.waitUntilElementIsNotVisible(needHelp);
};
/**
* checks 'Register' is displayed
* @method checkRegisterDisplayed
*/
this.checkRegisterDisplayed = function () {
Util.waitUntilElementIsVisible(register);
};
/**
* checks 'Register' is not displayed
* @method checkRegisterIsNotDisplayed
*/
this.checkRegisterIsNotDisplayed = function () {
Util.waitUntilElementIsNotVisible(register);
};
/**
* enables footer switch
* @method enableFooter
*/
this.enableFooter = function () {
Util.waitUntilElementIsVisible(footerSwitch);
footerSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary') {
footerSwitch.click();
expect(footerSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
}
})
};
/**
* disables footer switch
* @method disableFooter
*/
this.disableFooter = function () {
Util.waitUntilElementIsVisible(footerSwitch);
footerSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary mat-checked') {
footerSwitch.click();
expect(footerSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
}
})
};
/**
* disables RememberMe
*/
this.disableRememberMe = function () {
Util.waitUntilElementIsVisible(rememberMeSwitch);
rememberMeSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary mat-checked') {
rememberMeSwitch.click();
expect(rememberMeSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
}
})
};
/**
* enables footer switch
* @method enableFooter
*/
this.enableRememberMe = function () {
Util.waitUntilElementIsVisible(rememberMeSwitch);
rememberMeSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary') {
rememberMeSwitch.click();
expect(rememberMeSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
}
})
};
/**
* disables successRouteSwitch
*/
this.disableSuccessRouteSwitch = function () {
Util.waitUntilElementIsVisible(successRouteSwitch);
successRouteSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary mat-checked') {
successRouteSwitch.click();
expect(successRouteSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
}
})
};
/**
* enables successRouteSwitch
* @method enableFooter
*/
this.enableSuccessRouteSwitch = function () {
Util.waitUntilElementIsVisible(rememberMeSwitch);
successRouteSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary') {
successRouteSwitch.click();
expect(successRouteSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
}
})
};
/**
* disables successRouteSwitch
*/
this.disableLogowitch = function () {
Util.waitUntilElementIsVisible(logoSwitch);
logoSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary mat-checked') {
logoSwitch.click();
expect(logoSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
}
})
};
/**
* enables successRouteSwitch
* @method enableFooter
*/
this.enableLogoSwitch = function () {
Util.waitUntilElementIsVisible(rememberMeSwitch);
logoSwitch.getAttribute('class').then(function (check) {
if (check === 'mat-slide-toggle mat-primary') {
logoSwitch.click();
expect(logoSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
}
})
};
this.enterSuccessRoute = function (route) {
Util.waitUntilElementIsVisible(successRouteTxt);
successRouteTxt.sendKeys('');
return successRouteTxt.clear().sendKeys(route);
};
this.enterLogo = function (logo) {
Util.waitUntilElementIsVisible(logoTxt);
logoTxt.sendKeys('');
return logoTxt.clear().sendKeys(logo);
};
/**
* logs in with a valid user
* @method login
* @param {String, String} username, password
*/
this.login = function (username, password) {
this.waitForElements();
this.enterUsername(username);
this.enterPassword(password);
this.clickSignInButton();
return Util.waitUntilElementIsVisible(header);
};
};
module.exports = LoginPage;

333
e2e/pages/adf/loginPage.ts Normal file
View File

@ -0,0 +1,333 @@
/*!
* @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 { FormControllersPage } from './material/formControllersPage';
import Util = require('../../util/util');
import TestConfig = require('../../test.config');
import { SettingsPage } from './settingsPage';
export class LoginPage {
formControllersPage = new FormControllersPage();
txtUsername = element(by.css('input[id="username"]'));
txtPassword = element(by.css('input[id="password"]'));
logoImg = element(by.css('img[id="adf-login-img-logo"]'));
successRouteTxt = element(by.css('input[data-automation-id="adf-success-route"]'));
logoTxt = element(by.css('input[data-automation-id="adf-url-logo"]'));
usernameTooltip = element(by.css('span[data-automation-id="username-error"]'));
passwordTooltip = element(by.css('span[data-automation-id="password-required"]'));
loginTooltip = element(by.css('span[class="login-error-message"]'));
usernameInactive = element(by.css('input[id="username"][aria-invalid="false"]'));
passwordInactive = element(by.css('input[id="password"][aria-invalid="false"]'));
adfLogo = element(by.css('img[class="adf-img-logo ng-star-inserted"]'));
usernameHighlighted = element(by.css('input[id="username"][aria-invalid="true"]'));
passwordHighlighted = element(by.css('input[id="password"][aria-invalid="true"]'));
signInButton = element(by.id('login-button'));
showPasswordElement = element(by.css('mat-icon[data-automation-id="show_password"]'));
hidePasswordElement = element(by.css('mat-icon[data-automation-id="hide_password"]'));
rememberMe = element(by.css('mat-checkbox[id="adf-login-remember"]'));
needHelp = element(by.css('div[id="adf-login-action-left"]'));
register = element(by.css('div[id="adf-login-action-right"]'));
footerSwitch = element(by.id('switch4'));
rememberMeSwitch = element(by.id('adf-toogle-show-rememberme'));
successRouteSwitch = element(by.id('adf-toogle-show-successRoute'));
logoSwitch = element(by.id('adf-toogle-logo'));
header = element(by.id('adf-header'));
cardBackground = element(by.css('mat-card[class*="adf-login-card"]'));
settingsPage = new SettingsPage();
loginForm = element(by.css('form[id="adf-login-form"'));
checkLoginFormIsDisplayed() {
Util.waitUntilElementIsVisible(this.loginForm);
}
waitForElements() {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.txtUsername).then(() => {
Util.waitUntilElementIsVisible(this.txtPassword).then(() => {
deferred.fulfill();
}, () => {
deferred.rejected();
});
});
return deferred.promise;
}
enterUsername(username) {
Util.waitUntilElementIsVisible(this.txtUsername);
this.txtUsername.sendKeys('');
return this.txtUsername.clear().sendKeys(username);
}
enterPassword(password) {
Util.waitUntilElementIsVisible(this.txtPassword);
return this.txtPassword.clear().sendKeys(password);
}
clearUsername() {
Util.waitUntilElementIsVisible(this.txtUsername);
return this.txtUsername.click().clear();
}
clearPassword() {
Util.waitUntilElementIsVisible(this.txtPassword);
this.txtPassword.getAttribute('value').then((value) => {
for (let i = value.length; i >= 0; i--) {
this.txtPassword.sendKeys(protractor.Key.BACK_SPACE);
}
});
}
checkUsernameTooltip() {
Util.waitUntilElementIsVisible(this.usernameTooltip);
}
checkPasswordTooltip() {
Util.waitUntilElementIsVisible(this.passwordTooltip);
}
checkLoginError(message) {
Util.waitUntilElementIsVisible(this.loginTooltip);
expect(this.loginTooltip.getText()).toEqual(message);
}
checkLoginImgURL(url) {
Util.waitUntilElementIsVisible(this.logoImg);
expect(this.logoImg.getAttribute('src')).toEqual(url);
}
checkUsernameInactive() {
Util.waitUntilElementIsVisible(this.usernameInactive);
}
checkPasswordInactive() {
Util.waitUntilElementIsVisible(this.passwordInactive);
}
checkUsernameHighlighted() {
this.adfLogo.click();
Util.waitUntilElementIsVisible(this.usernameHighlighted);
}
checkPasswordHighlighted() {
this.adfLogo.click();
Util.waitUntilElementIsVisible(this.passwordHighlighted);
}
checkUsernameTooltipIsNotVisible() {
Util.waitUntilElementIsNotVisible(this.usernameTooltip);
}
checkPasswordTooltipIsNotVisible() {
Util.waitUntilElementIsNotVisible(this.passwordTooltip);
}
checkSignInButtonIsEnabled() {
Util.waitUntilElementIsVisible(this.signInButton);
expect(this.signInButton.isEnabled()).toBe(true);
}
defaultLogin() {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
}
loginUsingUserModel(userModel) {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
this.waitForElements();
this.login(userModel.getId(), userModel.getPassword());
}
loginToProcessServicesUsingUserModel(userModel) {
this.settingsPage.setProviderBpm();
this.waitForElements();
this.login(userModel.email, userModel.password);
}
loginToProcessServicesUsingDefaultUser() {
this.settingsPage.setProviderBpm();
this.waitForElements();
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
}
loginToContentServicesUsingUserModel(userModel) {
this.settingsPage.setProviderEcm();
this.waitForElements();
this.login(userModel.getId(), userModel.getPassword());
}
loginToContentServices(username, password) {
this.settingsPage.setProviderEcm();
this.waitForElements();
this.login(username, password);
}
goToLoginPage() {
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
this.waitForElements();
}
checkSignInButtonIsDisabled() {
Util.waitUntilElementIsVisible(this.signInButton);
expect(this.signInButton.isEnabled()).toBe(false);
}
clickSignInButton() {
Util.waitUntilElementIsVisible(this.signInButton);
this.signInButton.click();
}
clickRememberMe() {
Util.waitUntilElementIsVisible(this.rememberMe);
this.rememberMe.click();
}
showPassword() {
Util.waitUntilElementIsVisible(this.showPasswordElement);
this.showPasswordElement.click();
}
getShowPasswordIconColor() {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.showPasswordElement);
this.showPasswordElement.getCssValue('color').then((value) => {
deferred.fulfill(value);
});
return deferred.promise;
}
getSignInButtonColor() {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.signInButton);
this.signInButton.getCssValue('color').then((value) => {
deferred.fulfill(value);
});
return deferred.promise;
}
getBackgroundColor() {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.cardBackground);
this.cardBackground.getCssValue('color').then((value) => {
deferred.fulfill(value);
});
return deferred.promise;
}
hidePassword() {
Util.waitUntilElementIsVisible(this.hidePasswordElement);
this.hidePasswordElement.click();
}
checkPasswordIsShown(password) {
this.txtPassword.getAttribute('value').then((text) => {
expect(text).toEqual(password);
});
}
checkPasswordIsHidden() {
Util.waitUntilElementIsVisible(this.txtPassword);
}
checkRememberIsDisplayed() {
Util.waitUntilElementIsVisible(this.rememberMe);
}
checkRememberIsNotDisplayed() {
Util.waitUntilElementIsNotVisible(this.rememberMe);
}
checkNeedHelpIsDisplayed() {
Util.waitUntilElementIsVisible(this.needHelp);
}
checkNeedHelpIsNotDisplayed() {
Util.waitUntilElementIsNotVisible(this.needHelp);
}
checkRegisterDisplayed() {
Util.waitUntilElementIsVisible(this.register);
}
checkRegisterIsNotDisplayed() {
Util.waitUntilElementIsNotVisible(this.register);
}
enableFooter() {
this.formControllersPage.enableToggle(this.footerSwitch);
}
disableFooter() {
this.formControllersPage.disableToggle(this.footerSwitch);
}
disableRememberMe() {
this.formControllersPage.disableToggle(this.rememberMeSwitch);
}
enableRememberMe() {
this.formControllersPage.enableToggle(this.rememberMeSwitch);
}
disableSuccessRouteSwitch() {
this.formControllersPage.disableToggle(this.successRouteSwitch);
}
enableSuccessRouteSwitch() {
this.formControllersPage.enableToggle(this.successRouteSwitch);
}
disableLogowitch() {
this.formControllersPage.disableToggle(this.logoSwitch);
}
enableLogoSwitch() {
this.formControllersPage.enableToggle(this.logoSwitch);
}
enterSuccessRoute(route) {
Util.waitUntilElementIsVisible(this.successRouteTxt);
this.successRouteTxt.sendKeys('');
return this.successRouteTxt.clear().sendKeys(route);
}
enterLogo(logo) {
Util.waitUntilElementIsVisible(this.logoTxt);
this.logoTxt.sendKeys('');
return this.logoTxt.clear().sendKeys(logo);
}
login(username, password) {
this.waitForElements();
this.enterUsername(username);
this.enterPassword(password);
this.clickSignInButton();
return Util.waitUntilElementIsVisible(this.header);
}
}

View File

@ -15,10 +15,10 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import Util = require('../../../util/util');
export class FormControllersPage {
enableToggle(toggle) {
Util.waitUntilElementIsVisible(toggle);
toggle.getAttribute('class').then((check) => {

View File

@ -35,37 +35,21 @@ var NavigationBarPage = function () {
var headerDataButton = element(by.css("a[data-automation-id='Header Data']"));
var menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
/**
* Click Content Services Button
* @method clickContentServicesButton
*/
this.clickContentServicesButton = function () {
Util.waitUntilElementIsVisible(contentServicesButton);
contentServicesButton.click();
};
/**
* Click on Config Editor Button
* @method clickContentServicesButton
*/
this.clickConfigEditorButton = function () {
Util.waitUntilElementIsVisible(configEditoButton);
configEditoButton.click();
};
/**
* Click Process Services Button
* @method clickProcessServicesButton
*/
this.clickProcessServicesButton = function () {
Util.waitUntilElementIsVisible(processServicesButton);
processServicesButton.click();
};
/**
* Click Login Button
* @method clickLoginButton
*/
this.clickLoginButton = function () {
Util.waitUntilElementIsVisible(loginButton);
loginButton.click();
@ -162,11 +146,6 @@ var NavigationBarPage = function () {
appTitle.click();
};
this.checkLogoTooltip = function (logoTooltip) {
var logoTooltip = element(by.css('a[title="'+ logoTooltip +'"]'));
Util.waitUntilElementIsVisible(logoTooltip);
}
this.openViewer = function (nodeId) {
browser.get(TestConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
return this;

View File

@ -1,135 +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 NotificationPage = function () {
var messageField = element(by.css("input[data-automation-id='notification-message']"));
var horizontalPosition = element(by.css("mat-select[data-automation-id='notification-horizontal-position']"));
var verticalPosition = element(by.css("mat-select[data-automation-id='notification-vertical-position']"));
var durationField = element(by.css("input[data-automation-id='notification-duration']"));
var direction = element(by.css("mat-select[data-automation-id='notification-direction']"));
var actionToggle = element(by.css("mat-slide-toggle[data-automation-id='notification-action-toggle']"));
var notificationSnackBar = element.all(by.css("simple-snack-bar")).first();
var actionOutput = element(by.css("div[data-automation-id='notification-action-output']"));
var actionButton = element(by.css("simple-snack-bar > div > button"));
var defaultNotificationButton = element(by.css("button[data-automation-id='notification-default-button']"));
var customNotificationButton = element(by.css("button[data-automation-id='notification-custom-config-button']"));
var selectionDropDown = element.all(by.css("div[class*='mat-select-content']")).first();
var notificationsPage = element(by.css("a[data-automation-id='Notifications']"));
var notificationConfig = element(by.css("p[data-automation-id='notification-custom-object']"));
this.checkNotifyContains = function (message) {
Util.waitUntilElementIsVisible(element(by.cssContainingText('simple-snack-bar', message)));
return this;
};
this.goToNotificationsPage = function () {
Util.waitUntilElementIsVisible(notificationsPage);
notificationsPage.click();
};
this.getConfigObject = function () {
Util.waitUntilElementIsVisible(notificationConfig);
return notificationConfig.getText();
};
this.getSnackBarText = function () {
return notificationSnackBar.getText();
};
this.checkNotificationSnackBarIsDisplayed = function () {
Util.waitUntilElementIsVisible(notificationSnackBar);
return this;
};
this.checkNotificationSnackBarIsDisplayedWithMessage = function (message) {
let notificationSnackBarMessage = element(by.cssContainingText("simple-snack-bar", message));
Util.waitUntilElementIsVisible(notificationSnackBarMessage);
return this;
};
this.checkNotificationSnackBarIsNotDisplayed = function () {
Util.waitUntilElementIsNotVisible(notificationSnackBar);
return this;
};
this.enterMessageField = function (text) {
Util.waitUntilElementIsVisible(messageField);
messageField.clear().sendKeys(text);
};
this.enterDurationField = function (time) {
Util.waitUntilElementIsVisible(durationField);
durationField.clear().sendKeys(time);
};
this.selectHorizontalPosition = function (selectedItem) {
var selectItem = element(by.cssContainingText("span[class='mat-option-text']", selectedItem));
horizontalPosition.click();
Util.waitUntilElementIsVisible(selectionDropDown);
selectItem.click();
};
this.selectVerticalPosition = function (selectedItem) {
var selectItem = element(by.cssContainingText("span[class='mat-option-text']", selectedItem));
verticalPosition.click();
Util.waitUntilElementIsVisible(selectionDropDown);
selectItem.click();
};
this.selectDirection = function (selectedItem) {
var selectItem = element(by.cssContainingText("span[class='mat-option-text']", selectedItem));
direction.click();
Util.waitUntilElementIsVisible(selectionDropDown);
selectItem.click();
};
this.clickDefaultNotificationButton = function () {
Util.waitUntilElementIsVisible(defaultNotificationButton);
defaultNotificationButton.click();
};
this.clickCustomNotificationButton = function () {
Util.waitUntilElementIsVisible(customNotificationButton);
customNotificationButton.click();
};
this.checkActionEvent = function () {
Util.waitUntilElementIsVisible(actionOutput);
return this;
};
this.clickActionToggle = function () {
Util.waitUntilElementIsVisible(actionToggle);
actionToggle.click();
};
this.clickActionButton = function () {
actionButton.click();
};
this.clearMessage = function () {
Util.waitUntilElementIsVisible(messageField);
messageField.clear();
messageField.sendKeys('a');
messageField.sendKeys(protractor.Key.BACK_SPACE);
}
};
module.exports = NotificationPage;

View File

@ -0,0 +1,123 @@
/*!
* @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 = require('../../util/util');
export class NotificationPage {
messageField = element(by.css('input[data-automation-id="notification-message"]'));
horizontalPosition = element(by.css('mat-select[data-automation-id="notification-horizontal-position"]'));
verticalPosition = element(by.css('mat-select[data-automation-id="notification-vertical-position"]'));
durationField = element(by.css('input[data-automation-id="notification-duration"]'));
direction = element(by.css('mat-select[data-automation-id="notification-direction"]'));
actionToggle = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
notificationSnackBar = element.all(by.css('simple-snack-bar')).first();
actionOutput = element(by.css('div[data-automation-id="notification-action-output"]'));
actionButton = element(by.css('simple-snack-bar > div > button'));
customNotificationButton = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
selectionDropDown = element.all(by.css('div[class*="mat-select-content"]')).first();
notificationsPage = element(by.css('a[data-automation-id="Notifications"]'));
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
checkNotifyContains(message) {
Util.waitUntilElementIsVisible(element(by.cssContainingText('simple-snack-bar', message)));
return this;
}
goToNotificationsPage() {
Util.waitUntilElementIsVisible(this.notificationsPage);
this.notificationsPage.click();
}
getConfigObject() {
Util.waitUntilElementIsVisible(this.notificationConfig);
return this.notificationConfig.getText();
}
checkNotificationSnackBarIsDisplayed() {
Util.waitUntilElementIsVisible(this.notificationSnackBar);
return this;
}
checkNotificationSnackBarIsDisplayedWithMessage(message) {
let notificationSnackBarMessage = element(by.cssContainingText('simple-snack-bar', message));
Util.waitUntilElementIsVisible(notificationSnackBarMessage);
return this;
}
checkNotificationSnackBarIsNotDisplayed() {
Util.waitUntilElementIsNotVisible(this.notificationSnackBar);
return this;
}
enterMessageField(text) {
Util.waitUntilElementIsVisible(this.messageField);
this.messageField.clear().sendKeys(text);
}
enterDurationField(time) {
Util.waitUntilElementIsVisible(this.durationField);
this.durationField.clear().sendKeys(time);
}
selectHorizontalPosition(selectedItem) {
let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
this.horizontalPosition.click();
Util.waitUntilElementIsVisible(this.selectionDropDown);
selectItem.click();
}
selectVerticalPosition(selectedItem) {
let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
this.verticalPosition.click();
Util.waitUntilElementIsVisible(this.selectionDropDown);
selectItem.click();
}
selectDirection(selectedItem) {
let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
this.direction.click();
Util.waitUntilElementIsVisible(this.selectionDropDown);
selectItem.click();
}
clickNotificationButton() {
Util.waitUntilElementIsVisible(this.customNotificationButton);
this.customNotificationButton.click();
}
checkActionEvent() {
Util.waitUntilElementIsVisible(this.actionOutput);
return this;
}
clickActionToggle() {
Util.waitUntilElementIsVisible(this.actionToggle);
this.actionToggle.click();
}
clickActionButton() {
this.actionButton.click();
}
clearMessage() {
Util.waitUntilElementIsVisible(this.messageField);
this.messageField.clear();
this.messageField.sendKeys('a');
this.messageField.sendKeys(protractor.Key.BACK_SPACE);
}
}

View File

@ -1,53 +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 AppNavigationBarPage = function () {
var tasksButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Tasks")).first();
var tagButton = element.all(by.css("[data-automation-id='Tag']"));
var processButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Process")).first();
var reportsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Reports")).first();
var settingsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Settings")).first();
var reportsButtonSelected = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div[aria-selected='true']", "Reports")).first();
this.clickTasksButton = function () {
Util.waitUntilElementIsVisible(tasksButton);
return tasksButton.click();
};
this.clickProcessButton = function () {
return processButton.click();
};
this.clickTagButton = function () {
return tagButton.click();
};
this.clickSettingsButton = function () {
return settingsButton.click();
};
this.clickReportsButton = function () {
Util.waitUntilElementIsVisible(reportsButton);
reportsButton.click();
return Util.waitUntilElementIsVisible(reportsButtonSelected);
};
};
module.exports = AppNavigationBarPage;

View File

@ -0,0 +1,51 @@
/*!
* @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 = require('../../../util/util');
export class AppNavigationBarPage {
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
tagButton = element.all(by.css('[data-automation-id="Tag"]'));
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
clickTasksButton() {
Util.waitUntilElementIsVisible(this.tasksButton);
return this.tasksButton.click();
}
clickProcessButton() {
return this.processButton.click();
}
clickTagButton() {
return this.tagButton.click();
}
clickSettingsButton() {
return this.settingsButton.click();
}
clickReportsButton() {
Util.waitUntilElementIsVisible(this.reportsButton);
this.reportsButton.click();
return Util.waitUntilElementIsVisible(this.reportsButtonSelected);
}
}

View File

@ -26,7 +26,6 @@ export class AttachmentListPage {
attachFileButton = element(by.css("input[type='file']"));
buttonMenu = element(by.css("button[data-automation-id='action_menu_0']"));
menuPanel = element(by.css("div[class*='mat-menu-panel'] div[class*='mat-menu-content']"));
viewButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']"));
removeButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']"));
downloadButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']"));

View File

@ -1,108 +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 AppNavigationBarPage = require('./appNavigationBarPage');
var ProcessServicesPage = function(){
var apsAppsContainer = element(by.css("div[class='adf-app-listgrid ng-star-inserted']"));
var processServices = element(by.css("a[data-automation-id='Process Services']"));
var taskApp = element(by.css("mat-card[title='Task App']"));
var iconTypeLocator = by.css("mat-icon[class*='card-logo-icon']");
var descriptionLocator = by.css("mat-card-subtitle[class*='subtitle']");
var processInstanceList = element(by.css("adf-process-instance-list"));
/**
* Check Process Page Container is displayed
* @method checkApsContainer
*/
this.checkApsContainer = function(){
Util.waitUntilElementIsVisible(apsAppsContainer);
};
/**
* Go to Process Services Page
* @method goToProcessServices
* */
this.goToProcessServices = function() {
Util.waitUntilElementIsVisible(processServices);
processServices.click();
this.checkApsContainer();
return this;
};
/**
* Go to App
* @method goToApp
* */
this.goToApp = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
app.click();
return new AppNavigationBarPage();
};
/**
* Go to Task App
* @method goToTaskApp
* */
this.goToTaskApp = function() {
Util.waitUntilElementIsVisible(taskApp);
taskApp.click();
return new AppNavigationBarPage();
};
this.getAppIconType = function (applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
var iconType = app.element(iconTypeLocator);
Util.waitUntilElementIsVisible(iconType);
return iconType.getText();
};
this.getBackgroundColor = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
return app.getCssValue("background-color");
};
this.getDescription = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
var description = app.element(descriptionLocator);
Util.waitUntilElementIsVisible(description);
return description.getText();
};
this.checkAppIsNotDisplayed = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
return Util.waitUntilElementIsNotOnPage(app);
};
this.checkAppIsDisplayed = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
return Util.waitUntilElementIsVisible(app);
};
this.checkProcessListIsDisplayed = function() {
Util.waitUntilElementIsVisible(processInstanceList);
}
};
module.exports = ProcessServicesPage;

View File

@ -0,0 +1,90 @@
/*!
* @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 = require('../../../util/util');
import { AppNavigationBarPage } from './appNavigationBarPage';
export class ProcessServicesPage {
apsAppsContainer = element(by.css('div[class="adf-app-listgrid ng-star-inserted"]'));
processServices = element(by.css('a[data-automation-id="Process Services"]'));
taskApp = element(by.css('mat-card[title="Task App"]'));
iconTypeLocator = by.css('mat-icon[class*="card-logo-icon"]');
descriptionLocator = by.css('mat-card-subtitle[class*="subtitle"]');
processInstanceList = element(by.css('adf-process-instance-list'));
checkApsContainer() {
Util.waitUntilElementIsVisible(this.apsAppsContainer);
}
goToProcessServices() {
Util.waitUntilElementIsVisible(this.processServices);
this.processServices.click();
this.checkApsContainer();
return this;
}
goToApp(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
app.click();
return new AppNavigationBarPage();
}
goToTaskApp() {
Util.waitUntilElementIsVisible(this.taskApp);
this.taskApp.click();
return new AppNavigationBarPage();
}
getAppIconType(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
let iconType = app.element(this.iconTypeLocator);
Util.waitUntilElementIsVisible(iconType);
return iconType.getText();
}
getBackgroundColor(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
return app.getCssValue('background-color');
}
getDescription(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
let description = app.element(this.descriptionLocator);
Util.waitUntilElementIsVisible(description);
return description.getText();
}
checkAppIsNotDisplayed(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
return Util.waitUntilElementIsNotOnPage(app);
}
checkAppIsDisplayed(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
return Util.waitUntilElementIsVisible(app);
}
checkProcessListIsDisplayed() {
Util.waitUntilElementIsVisible(this.processInstanceList);
}
}

View File

@ -16,11 +16,11 @@
*/
import { AppSettingsToggles } from './dialog/appSettingsToggles';
import { TabsPage } from '../material/tabsPage';
import Util = require('../../../util/util');
export class TaskDetailsPage {
appSettingsToggles = new AppSettingsToggles();
formNameField = element(by.css('span[data-automation-id*="formName"] span'));
assigneeField = element(by.css('span[data-automation-id*="assignee"] span'));
statusField = element(by.css('span[data-automation-id*="status"] span'));
@ -33,14 +33,11 @@ export class TaskDetailsPage {
activitiesTitle = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div'));
commentField = element(by.id('comment-input'));
addCommentButton = element(by.css('[data-automation-id="comments-input-add"]'));
activityTab = element(by.cssContainingText('div[class*="mat-tab-label"]', 'Activity'));
detailsTab = element(by.cssContainingText('div[class*="mat-tab-label""]', 'Details'));
involvePeopleButton = element(by.css('div[class*="add-people"]'));
addPeopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
addInvolvedUserButton = element(by.css('button[id="add-people"] span'));
emailInvolvedUser = by.xpath('following-sibling::div[@class="people-email ng-star-inserted"]');
editActionInvolvedUser = by.xpath('following-sibling::div[@class="people-edit-label ng-star-inserted"]');
involvedUserPic = by.xpath('ancestor::div/ancestor::div/preceding-sibling::div//div[@class="adf-people-search-people-pic ng-star-inserted"]');
tadkDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
taskDetailsSection = element(by.css('div[data-automation-id="adf-tasks-details"]'));
taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
@ -187,24 +184,14 @@ export class TaskDetailsPage {
}
selectActivityTab() {
Util.waitUntilElementIsVisible(this.activityTab);
activityTab.getAttribute('aria-selected').then((check) => {
if (check === 'false') {
this.activityTab.click();
expect(this.activityTab.getAttribute('aria-selected') === 'true');
}
});
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Activity');
return this;
}
selectDetailsTab() {
Util.waitUntilElementIsVisible(this.detailsTab);
detailsTab.getAttribute('aria-selected').then((check) => {
if (check === 'false') {
this.detailsTab.click();
expect(this.detailsTab.getAttribute('aria-selected') === 'true');
}
});
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Details');
return this;
}
@ -275,13 +262,13 @@ export class TaskDetailsPage {
}
getInvolvedUserEmail(user) {
let email = this.getRowsUser(user).element(emailInvolvedUser);
let email = this.getRowsUser(user).element(this.emailInvolvedUser);
Util.waitUntilElementIsVisible(email);
return email.getText();
}
getInvolvedUserEditAction(user) {
let edit = this.getRowsUser(user).element(editActionInvolvedUser);
let edit = this.getRowsUser(user).element(this.editActionInvolvedUser);
Util.waitUntilElementIsVisible(edit);
return edit.getText();
}
@ -292,7 +279,7 @@ export class TaskDetailsPage {
}
appSettingsToggles() {
return this.appSettingsToggles;
return new AppSettingsToggles();
}
taskInfoDrawerIsDisplayed() {
@ -346,12 +333,6 @@ export class TaskDetailsPage {
return this.peopleTitle.getText();
}
getInvolvedPeopleInitialImage(user) {
let pic = this.getRowsUser(user).element(this.involvedUserPic);
Util.waitUntilElementIsVisible(pic);
return pic.getText();
}
checkTaskDetails() {
Util.waitUntilElementIsVisible(this.taskDetailsSection);
return this.taskDetailsSection.getText();

View File

@ -1,174 +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 StartTaskDialog = require('./dialog/startTaskDialog');
var FormFields = require('./formFields');
var TaskDetails = require('./taskDetailsPage');
var FiltersPage = require('./filtersPage');
var ChecklistDialog = require('./dialog/createChecklistDialog');
var TasksListPage = require('./tasksListPage');
var TasksPage = function () {
var createButton = element(by.css("button[data-automation-id='create-button'"));
var newTaskButton = element(by.css("button[data-automation-id='btn-start-task']"));
var addChecklistButton = element(by.css("button[class*='adf-add-to-checklist-button']"));
var rowByRowName = by.xpath("ancestor::mat-chip");
var checklistContainer = by.css("div[class*='checklist-menu']");
var taskTitle = "h2[class='activiti-task-details__header'] span";
var rows = by.css("div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[class*='adf-data-table-cell']");
var completeButtonNoForm = element(by.id("adf-no-form-complete-button"));
var checklistDialog = element(by.id("checklist-dialog"));
var checklistNoMessage = element(by.id("checklist-none-message"));
var numberOfChecklists = element(by.css("[data-automation-id='checklist-label'] mat-chip"));
this.createNewTask = function () {
this.createButtonIsDisplayed();
this.clickOnCreateButton();
this.newTaskButtonIsDisplayed();
newTaskButton.click();
return new StartTaskDialog();
};
this.clickOnNewTaskButton = function() {
Util.waitUntilElementIsClickable(newTaskButton);
newTaskButton.click();
return this;
};
this.createButtonIsDisplayed = function() {
Util.waitUntilElementIsVisible(createButton);
return this;
};
this.newTaskButtonIsDisplayed = function() {
Util.waitUntilElementIsVisible(newTaskButton);
return this;
};
this.clickOnCreateButton = function() {
Util.waitUntilElementIsClickable(createButton);
createButton.click();
return this;
};
this.formFields = function () {
return new FormFields();
};
this.taskDetails = function () {
return new TaskDetails();
};
this.filtersPage = function () {
return new FiltersPage();
};
this.tasksListPage = function () {
return new TasksListPage();
};
this.usingCheckListDialog = function () {
return new ChecklistDialog();
};
this.clickOnAddChecklistButton = function () {
Util.waitUntilElementIsClickable(addChecklistButton);
addChecklistButton.click();
return new ChecklistDialog();
};
this.getRowsName = function (name) {
var row = element(checklistContainer).element(by.cssContainingText("span", name));
Util.waitUntilElementIsVisible(row);
return row;
};
this.getChecklistByName = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsVisible(row);
return row;
};
this.checkChecklistIsDisplayed = function (checklist) {
Util.waitUntilElementIsVisible(this.getChecklistByName(checklist));
return this;
};
this.checkChecklistIsNotDisplayed = function (checklist) {
Util.waitUntilElementIsNotOnPage(element(checklistContainer).element(by.cssContainingText("span", checklist)));
return this;
};
this.checkTaskTitle = function(taskName) {
Util.waitUntilElementIsVisible(element(by.css(taskTitle)));
var title = element(by.cssContainingText(taskTitle, taskName));
Util.waitUntilElementIsVisible(title);
return this;
};
this.getAllDisplayedRows = function(){
return element.all(rows).count();
};
this.completeTaskNoForm = function () {
Util.waitUntilElementIsClickable(completeButtonNoForm);
completeButtonNoForm.click();
};
this.completeTaskNoFormNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(completeButtonNoForm);
return this;
};
this.checkChecklistDialogIsDisplayed = function () {
Util.waitUntilElementIsVisible(checklistDialog);
return this;
};
this.checkChecklistDialogIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(checklistDialog);
return this;
};
this.checkNoChecklistIsDisplayed = function () {
Util.waitUntilElementIsVisible(checklistNoMessage);
return this;
};
this.getNumberOfChecklists = function () {
Util.waitUntilElementIsVisible(numberOfChecklists);
return numberOfChecklists.getText();
};
this.removeChecklists = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsVisible(row.element(by.css('button')));
row.element(by.css('button')).click();
return this;
};
this.checkChecklistsRemoveButtonIsNotDisplayed = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsNotOnPage(row.element(by.css('button')));
return this;
};
};
module.exports = TasksPage;

View File

@ -0,0 +1,167 @@
/*!
* @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 = require('../../../util/util');
import StartTaskDialog = require('./dialog/startTaskDialog');
import FormFields = require('./formFields');
import { TaskDetailsPage } from './taskDetailsPage';
import FiltersPage = require('./filtersPage');
import ChecklistDialog = require('./dialog/createChecklistDialog');
import TasksListPage = require('./tasksListPage');
export class TasksPage {
createButton = element(by.css('button[data-automation-id="create-button"'));
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
addChecklistButton = element(by.css('button[class*="adf-add-to-checklist-button"]'));
rowByRowName = by.xpath('ancestor::mat-chip');
checklistContainer = by.css('div[class*="checklist-menu"]');
taskTitle = 'h2[class="activiti-task-details__header"] span';
rows = by.css('div[class*="adf-datatable-body"] div[class*="adf-datatable-row"] div[class*="adf-data-table-cell"]');
completeButtonNoForm = element(by.id('adf-no-form-complete-button'));
checklistDialog = element(by.id('checklist-dialog'));
checklistNoMessage = element(by.id('checklist-none-message'));
numberOfChecklists = element(by.css('[data-automation-id="checklist-label"] mat-chip'));
createNewTask() {
this.createButtonIsDisplayed();
this.clickOnCreateButton();
this.newTaskButtonIsDisplayed();
this.newTaskButton.click();
return new StartTaskDialog();
}
createButtonIsDisplayed() {
Util.waitUntilElementIsVisible(this.createButton);
return this;
}
newTaskButtonIsDisplayed() {
Util.waitUntilElementIsVisible(this.newTaskButton);
return this;
}
clickOnCreateButton() {
Util.waitUntilElementIsClickable(this.createButton);
this.createButton.click();
return this;
}
formFields() {
return new FormFields();
}
taskDetails() {
return new TaskDetailsPage();
}
filtersPage() {
return new FiltersPage();
}
tasksListPage() {
return new TasksListPage();
}
usingCheckListDialog() {
return new ChecklistDialog();
}
clickOnAddChecklistButton() {
Util.waitUntilElementIsClickable(this.addChecklistButton);
this.addChecklistButton.click();
return new ChecklistDialog();
}
getRowsName(name) {
let row = element(this.checklistContainer).element(by.cssContainingText('span', name));
Util.waitUntilElementIsVisible(row);
return row;
}
getChecklistByName(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsVisible(row);
return row;
}
checkChecklistIsDisplayed(checklist) {
Util.waitUntilElementIsVisible(this.getChecklistByName(checklist));
return this;
}
checkChecklistIsNotDisplayed(checklist) {
Util.waitUntilElementIsNotOnPage(element(this.checklistContainer).element(by.cssContainingText('span', checklist)));
return this;
}
checkTaskTitle(taskName) {
Util.waitUntilElementIsVisible(element(by.css(this.taskTitle)));
let title = element(by.cssContainingText(this.taskTitle, taskName));
Util.waitUntilElementIsVisible(title);
return this;
}
getAllDisplayedRows() {
return element.all(this.rows).count();
}
completeTaskNoForm() {
Util.waitUntilElementIsClickable(this.completeButtonNoForm);
this.completeButtonNoForm.click();
}
completeTaskNoFormNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.completeButtonNoForm);
return this;
}
checkChecklistDialogIsDisplayed() {
Util.waitUntilElementIsVisible(this.checklistDialog);
return this;
}
checkChecklistDialogIsNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.checklistDialog);
return this;
}
checkNoChecklistIsDisplayed() {
Util.waitUntilElementIsVisible(this.checklistNoMessage);
return this;
}
getNumberOfChecklists() {
Util.waitUntilElementIsVisible(this.numberOfChecklists);
return this.numberOfChecklists.getText();
}
removeChecklists(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsVisible(row.element(by.css('mat-icon')));
row.element(by.css('mat-icon')).click();
return this;
}
checkChecklistsRemoveButtonIsNotDisplayed(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsNotOnPage(row.element(by.css('mat-icon')));
return this;
}
}

View File

@ -1,59 +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 FormFields = require('../formFields');
var TestConfig = require('../../../../test.config');
var path = require('path');
var Util = require('../../../../util/util');
var remote = require('selenium-webdriver/remote');
var AttachFile = function () {
var formFields = new FormFields();
var uploadLocator = by.css("button[id='attachfile']");
var localStorageButton = element(by.css("input[id='attachfile']"));
var filesListLocator = by.css("div[id='adf-attach-widget-readonly-list']");
this.attachFile = function (fieldId, fileLocation) {
browser.setFileDetector(new remote.FileDetector());
var widget = formFields.getWidget(fieldId);
var uploadButton = widget.element(uploadLocator);
Util.waitUntilElementIsVisible(uploadButton);
uploadButton.click();
Util.waitUntilElementIsVisible(localStorageButton);
localStorageButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
return this;
};
this.checkFileIsAttached = function (fieldId, name) {
var widget = formFields.getWidget(fieldId);
var fileAttached = widget.element(filesListLocator).element(by.cssContainingText("mat-list-item span ", name));
Util.waitUntilElementIsVisible(fileAttached);
return this;
};
this.viewFile = function (name) {
var fileView = element(filesListLocator).element(by.cssContainingText("mat-list-item span ", name));
Util.waitUntilElementIsVisible(fileView);
fileView.click();
browser.actions().doubleClick(fileView).perform();
return this;
};
};
module.exports = AttachFile;

View File

@ -1,33 +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 FormFields = require('../formFields');
var DisplayText = function () {
var formFields = new FormFields();
var labelLocator = by.css("div[class*='display-text-widget']");
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
};
module.exports = DisplayText;

View File

@ -1,32 +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 FormFields = require('../formFields');
var Dropdown = function () {
var formFields = new FormFields();
var selectedOptionLocator = by.css("mat-select[id='dropdown'] span span");
this.getSelectedOptionText = function (fieldId) {
return formFields.getFieldText(fieldId, selectedOptionLocator);
};
};
module.exports = Dropdown;

View File

@ -1,103 +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 FormFields = require('../formFields');
var Util = require('../../../../util/util');
var DynamicTable = function () {
var formFields = new FormFields();
var labelLocator = by.css("dynamic-table-widget div div");
var columnNameLocator = by.css("table[id*='dynamic-table'] th");
var addButton = element(by.id("label-add-row"));
var columnDateTime = element(by.id("columnDateTime"));
var columnDate = element(by.id("columnDate"));
var calendarHeader = element(by.css("div[class='mat-datetimepicker-calendar-header-date-time']"));
var calendarContent = element(by.css("div[class='mat-datetimepicker-calendar-content']"));
var saveButton = element(by.cssContainingText('button span', 'Save'));
var errorMessage = element(by.css('div[class="adf-error-text"]'));
var dateWidget = element(by.css('button[aria-label="Open calendar"]'));
var calendarNumber = element.all(by.css('td div'));
var tableRow = element.all(by.css('tbody tr'));
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
this.getColumnName = function (fieldId) {
return formFields.getFieldText(fieldId, columnNameLocator);
};
this.clickAddButton = function () {
Util.waitUntilElementIsVisible(addButton);
return addButton.click();
};
this.clickColumnDateTime = function () {
Util.waitUntilElementIsVisible(columnDateTime);
columnDateTime.click();
Util.waitUntilElementIsVisible(calendarHeader);
Util.waitUntilElementIsVisible(calendarContent);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
};
this.addRandomStringOnDateTime = function (randomText) {
Util.waitUntilElementIsVisible(columnDateTime);
columnDateTime.click();
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
columnDateTime.sendKeys(randomText);
columnDateTime.sendKeys(protractor.Key.ENTER);
return columnDateTime.getAttribute('value');
};
this.addRandomStringOnDate = function(randomText) {
Util.waitUntilElementIsVisible(columnDate);
columnDate.click();
return columnDate.sendKeys(randomText);
};
this.clickSaveButton = function () {
Util.waitUntilElementIsVisible(saveButton);
return saveButton.click();
};
this.checkErrorMessage = function () {
Util.waitUntilElementIsVisible(errorMessage);
return errorMessage.getText();
};
this.clickDateWidget = function () {
Util.waitUntilElementIsVisible(dateWidget);
return dateWidget.click();
};
this.getDateCalendarNumber = function (date) {
return calendarNumber.get(date).click();
};
this.getTableRow = function (rowNumber) {
return Util.waitUntilElementIsVisible(tableRow.get(rowNumber));
};
this.waitForCalendarToDisappear = function () {
Util.waitUntilElementIsNotVisible(calendarNumber);
};
};
module.exports = DynamicTable;

View 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 FormFields = require('../formFields');
import TestConfig = require('../../../../test.config');
import path = require('path');
import Util = require('../../../../util/util');
import remote = require('selenium-webdriver/remote');
export class AttachFile {
formFields = new FormFields();
uploadLocator = by.css('button[id="attachfile"]');
localStorageButton = element(by.css('input[id="attachfile"]'));
filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
attachFile(fieldId, fileLocation) {
browser.setFileDetector(new remote.FileDetector());
let widget = this.formFields.getWidget(fieldId);
let uploadButton = widget.element(this.uploadLocator);
Util.waitUntilElementIsVisible(uploadButton);
uploadButton.click();
Util.waitUntilElementIsVisible(this.localStorageButton);
this.localStorageButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
return this;
}
checkFileIsAttached(fieldId, name) {
let widget = this.formFields.getWidget(fieldId);
let fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
Util.waitUntilElementIsVisible(fileAttached);
return this;
}
viewFile(name) {
let fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
Util.waitUntilElementIsVisible(fileView);
fileView.click();
browser.actions().doubleClick(fileView).perform();
return this;
}
}

View File

@ -15,19 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var MultilineText = function () {
export class DisplayText {
var formFields = new FormFields();
formFields = new FormFields();
var valueLocator = by.css("textarea");
labelLocator = by.css('div[class*="display-text-widget"]');
this.getFieldValue = function (fieldId) {
return formFields.getFieldValue(fieldId, valueLocator);
};
};
module.exports = MultilineText;
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
}

View File

@ -15,18 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var Header = function () {
export class DisplayValue {
var formFields = new FormFields();
formFields = new FormFields();
var labelLocator = by.css("span[id='container-header-label']");
labelLocator = by.css('span[class*="unknown-text"]');
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
};
module.exports = Header;
}

View File

@ -15,18 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var Hyperlink = function () {
export class Dropdown {
var formFields = new FormFields();
formFields = new FormFields();
var fieldLocator = by.css("div[class='adf-hyperlink-widget '] a");
selectedOptionLocator = by.css('mat-select[id="dropdown"] span span');
this.getFieldText = function (fieldId) {
return formFields.getFieldText(fieldId, fieldLocator);
};
getSelectedOptionText(fieldId) {
return this.formFields.getFieldText(fieldId, this.selectedOptionLocator);
}
};
module.exports = Hyperlink;
}

View File

@ -0,0 +1,99 @@
/*!
* @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 FormFields = require('../formFields');
import Util = require('../../../../util/util');
export class DynamicTable {
formFields = new FormFields();
labelLocator = by.css('dynamic-table-widget div div');
columnNameLocator = by.css('table[id*="dynamic-table"] th');
addButton = element(by.id('label-add-row'));
columnDateTime = element(by.id('columnDateTime'));
columnDate = element(by.id('columnDate'));
calendarHeader = element(by.css('div[class="mat-datetimepicker-calendar-header-date-time"]'));
calendarContent = element(by.css('div[class="mat-datetimepicker-calendar-content"]'));
saveButton = element(by.cssContainingText('button span', 'Save'));
errorMessage = element(by.css('div[class="adf-error-text"]'));
dateWidget = element(by.css('button[aria-label="Open calendar"]'));
calendarNumber = element.all(by.css('td div'));
tableRow = element.all(by.css('tbody tr'));
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getColumnName(fieldId) {
return this.formFields.getFieldText(fieldId, this.columnNameLocator);
}
clickAddButton() {
Util.waitUntilElementIsVisible(this.addButton);
return this.addButton.click();
}
clickColumnDateTime() {
Util.waitUntilElementIsVisible(this.columnDateTime);
this.columnDateTime.click();
Util.waitUntilElementIsVisible(this.calendarHeader);
Util.waitUntilElementIsVisible(this.calendarContent);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
addRandomStringOnDateTime(randomText) {
Util.waitUntilElementIsVisible(this.columnDateTime);
this.columnDateTime.click();
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
this.columnDateTime.sendKeys(randomText);
this.columnDateTime.sendKeys(protractor.Key.ENTER);
return this.columnDateTime.getAttribute('value');
}
addRandomStringOnDate(randomText) {
Util.waitUntilElementIsVisible(this.columnDate);
this.columnDate.click();
return this.columnDate.sendKeys(randomText);
}
clickSaveButton() {
Util.waitUntilElementIsVisible(this.saveButton);
return this.saveButton.click();
}
checkErrorMessage() {
Util.waitUntilElementIsVisible(this.errorMessage);
return this.errorMessage.getText();
}
clickDateWidget() {
Util.waitUntilElementIsVisible(this.dateWidget);
return this.dateWidget.click();
}
getDateCalendarNumber(date) {
return this.calendarNumber.get(date).click();
}
getTableRow(rowNumber) {
return Util.waitUntilElementIsVisible(this.tableRow.get(rowNumber));
}
waitForCalendarToDisappear() {
Util.waitUntilElementIsNotVisible(this.calendarNumber);
}
}

View File

@ -15,20 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var DisplayValue = function () {
export class Header {
var formFields = new FormFields();
formFields = new FormFields();
var labelLocator = by.css("span[class*='unknown-text']");
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
};
module.exports = DisplayValue;
labelLocator = by.css('span[id="container-header-label"]');
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
}

View File

@ -0,0 +1,30 @@
/*!
* @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 FormFields = require('../formFields');
export class Hyperlink {
formFields = new FormFields();
fieldLocator = by.css('div[class="adf-hyperlink-widget "] a');
getFieldText(fieldId) {
return this.formFields.getFieldText(fieldId, this.fieldLocator);
}
}

View File

@ -0,0 +1,30 @@
/*!
* @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 FormFields = require('../formFields');
export class MultilineText {
formFields = new FormFields();
valueLocator = by.css('textarea');
getFieldValue(fieldId) {
return this.formFields.getFieldValue(fieldId, this.valueLocator);
}
}

View File

@ -15,20 +15,19 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
var Util = require('../../../../util/util');
import FormFields = require('../formFields');
import Util = require('../../../../util/util');
var RadioButtons = function () {
export class RadioButtons {
var formFields = new FormFields();
formFields = new FormFields();
this.getSpecificOptionLabel = function (fieldId, optionNumber) {
var optionLocator = by.css("label[for*='radiobuttons-option_" + optionNumber + "'] div[class*='content']");
var option = formFields.getWidget(fieldId).element(optionLocator);
getSpecificOptionLabel(fieldId, optionNumber) {
let optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"] div[class*="content"]');
let option = this.formFields.getWidget(fieldId).element(optionLocator);
Util.waitUntilElementIsVisible(option);
return option.getText();
};
}
};
module.exports = RadioButtons;
}

View File

@ -15,55 +15,52 @@
* limitations under the License.
*/
var MultilineText = require('./MultilineText');
var Header = require('./Header');
var DisplayText = require('./DisplayText');
var AttachFile = require('./AttachFile');
var DisplayValue = require('./DisplayValue');
var RadioButtons = require('./RadioButtons');
var Hyperlink = require('./Hyperlink');
var Dropdown = require('./Dropdown');
var DynamicTable = require('./DynamicTable');
import { MultilineText } from './multilineText';
import { Header } from './header';
import { DisplayText } from './displayText';
import { AttachFile } from './attachFile';
import { DisplayValue } from './displayValue';
import { RadioButtons } from './radioButtons';
import { Hyperlink } from './hyperlink';
import { Dropdown } from './dropdown';
import { DynamicTable } from './dynamicTable';
var Widget = function () {
export class Widget {
this.multilineTextWidget = function () {
multilineTextWidget() {
return new MultilineText();
};
}
this.headerWidget = function () {
headerWidget() {
return new Header();
};
}
this.displayTextWidget = function () {
displayTextWidget() {
return new DisplayText();
};
}
this.attachFileWidget = function () {
attachFileWidget() {
return new AttachFile();
};
}
this.displayValueWidget = function () {
displayValueWidget() {
return new DisplayValue();
};
}
this.radioWidget = function () {
radioWidget() {
return new RadioButtons();
};
}
this.hyperlink = function () {
hyperlink() {
return new Hyperlink();
};
}
this.dropdown = function () {
dropdown() {
return new Dropdown();
};
}
this.dynamicTable = function () {
dynamicTable() {
return new DynamicTable();
};
};
module.exports = Widget;
}
}

View File

@ -1,135 +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 TestConfig = require('../../test.config');
var Util = require('../../util/util');
var SettingsPage = function () {
var settingsURL = TestConfig.adf.url + TestConfig.adf.port + "/settings";
var providerDropdown = element(by.css("mat-select[aria-label='Provider'] div[class='mat-select-arrow-wrapper']"));
var ecmAndBpm = {
option: element(by.xpath("//SPAN[@class='mat-option-text'][contains(text(),'ALL')]")),
text: "ALL"
};
var bpm = {
option: element(by.xpath("//SPAN[@class='mat-option-text'][contains(text(),'BPM') and not (contains(text(),'and'))]")),
text: "BPM"
};
var ecm = {
option: element(by.xpath("//SPAN[@class='mat-option-text'][contains(text(),'ECM') and not (contains(text(),'and'))]")),
text: "ECM"
};
var oauth = {
option: element(by.xpath("//SPAN[@class='mat-option-text'][contains(text(),'OAUTH')]")),
text: "OAUTH"
};
var selectedOption = element.all(by.css("span[class*='ng-star-inserted']")).first();
var ecmText = element(by.css("input[data-automation-id*='ecmHost']"));
var bpmText = element(by.css("input[data-automation-id*='bpmHost']"));
var authHostText = element(by.css("input[id='oauthHost']"));
var silentLoginToggle = element(by.css("mat-slide-toggle[name='silentLogin'] div[class='mat-slide-toggle-thumb']"));
var silentLoginEnabled = element(by.css("mat-slide-toggle[class*='mat-checked'][name='silentLogin'] div[class='mat-slide-toggle-thumb']"));
var backButton = element(by.cssContainingText("span[class='mat-button-wrapper']", "Back"));
var applyButton = element(by.css("button[data-automation-id*='host-button']"));
this.goToSettingsPage = function () {
browser.driver.get(settingsURL);
Util.waitUntilElementIsVisible(providerDropdown);
return this;
};
/**
* Selects provider
* @method setProvider
* @param {String} option, {String} selected
*/
this.setProvider = function (option, selected) {
Util.waitUntilElementIsVisible(providerDropdown);
providerDropdown.click();
Util.waitUntilElementIsVisible(option);
option.click();
return expect(selectedOption.getText()).toEqual(selected);
};
/**
* Sets provider as ECM and BPM
* @method setProviderEcmBpm
*/
this.setProviderEcmBpm = function () {
this.goToSettingsPage();
this.setProvider(ecmAndBpm.option, ecmAndBpm.text);
Util.waitUntilElementIsVisible(bpmText);
Util.waitUntilElementIsVisible(ecmText);
this.clickApply();
return this;
};
/**
* Sets provider as BPM
* @method setProviderBpm
*/
this.setProviderBpm = function () {
this.goToSettingsPage();
this.setProvider(bpm.option, bpm.text);
Util.waitUntilElementIsVisible(bpmText);
expect(ecmText.isPresent()).toBe(false);
this.clickApply();
return this;
};
/**
* Sets provider as ECM
* @method setProviderEcm
*/
this.setProviderEcm = function () {
this.goToSettingsPage();
this.setProvider(ecm.option, ecm.text);
Util.waitUntilElementIsVisible(ecmText);
expect(bpmText.isPresent()).toBe(false);
this.clickApply();
return this;
};
/**
* Sets provider as OAUTH
* @method setProviderOauth
*/
this.setProviderOauth = function () {
this.goToSettingsPage();
this.setProvider(oauth.option, oauth.text);
Util.waitUntilElementIsVisible(bpmText);
Util.waitUntilElementIsVisible(ecmText);
expect(authHostText.isPresent()).toBe(true);
this.clickApply();
return this;
};
/**
* Clicks Apply button
* @method clickApply
*/
this.clickApply = function () {
Util.waitUntilElementIsVisible(applyButton);
applyButton.click();
};
this.checkProviderDropdownIsDisplayed = function () {
Util.waitUntilElementIsVisible(providerDropdown);
};
};
module.exports = SettingsPage;

View File

@ -0,0 +1,106 @@
/*!
* @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 TestConfig = require('../../test.config');
import Util = require('../../util/util');
export class SettingsPage {
settingsURL = TestConfig.adf.url + TestConfig.adf.port + '/settings';
providerDropdown = element(by.css('mat-select[aria-label="Provider"] div[class="mat-select-arrow-wrapper"]'));
ecmAndBpm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"ALL")]')),
text: 'ALL'
};
bpm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"BPM") and not (contains(text(),"and"))]')),
text: 'BPM'
};
ecm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"ECM") and not (contains(text(),"and"))]')),
text: 'ECM'
};
oauth = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"OAUTH")]')),
text: 'OAUTH'
};
selectedOption = element.all(by.css('span[class*="ng-star-inserted"]')).first();
ecmText = element(by.css('input[data-automation-id*="ecmHost"]'));
bpmText = element(by.css('input[data-automation-id*="bpmHost"]'));
authHostText = element(by.css('input[id="oauthHost"]'));
applyButton = element(by.css('button[data-automation-id*="host-button"]'));
goToSettingsPage() {
browser.driver.get(this.settingsURL);
Util.waitUntilElementIsVisible(this.providerDropdown);
return this;
}
setProvider(option, selected) {
Util.waitUntilElementIsVisible(this.providerDropdown);
this.providerDropdown.click();
Util.waitUntilElementIsVisible(option);
option.click();
return expect(this.selectedOption.getText()).toEqual(selected);
}
setProviderEcmBpm() {
this.goToSettingsPage();
this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
Util.waitUntilElementIsVisible(this.bpmText);
Util.waitUntilElementIsVisible(this.ecmText);
this.clickApply();
return this;
}
setProviderBpm() {
this.goToSettingsPage();
this.setProvider(this.bpm.option, this.bpm.text);
Util.waitUntilElementIsVisible(this.bpmText);
expect(this.ecmText.isPresent()).toBe(false);
this.clickApply();
return this;
}
setProviderEcm() {
this.goToSettingsPage();
this.setProvider(this.ecm.option, this.ecm.text);
Util.waitUntilElementIsVisible(this.ecmText);
expect(this.bpmText.isPresent()).toBe(false);
this.clickApply();
return this;
}
setProviderOauth() {
this.goToSettingsPage();
this.setProvider(this.oauth.option, this.oauth.text);
Util.waitUntilElementIsVisible(this.bpmText);
Util.waitUntilElementIsVisible(this.ecmText);
expect(this.authHostText.isPresent()).toBe(true);
this.clickApply();
return this;
}
clickApply() {
Util.waitUntilElementIsVisible(this.applyButton);
this.applyButton.click();
}
checkProviderDropdownIsDisplayed() {
Util.waitUntilElementIsVisible(this.providerDropdown);
}
}

View File

@ -1,225 +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 TestConfig = require('../../test.config');
var Util = require('../../util/util');
var ContentList = require('./dialog/contentList');
var TagPage = function () {
var tagURL = TestConfig.adf.url + TestConfig.adf.port + "/tag";
var addTagButton = element(by.css("button[id='add-tag']"));
var insertNodeId = element(by.css("input[id='nodeId']"));
var newTagInput = element(by.css("input[id='new-tag-text']"));
var tagListRow = element(by.css("adf-tag-node-actions-list mat-list-item"));
var tagListByNodeIdRow = element(by.css("adf-tag-node-list mat-chip"));
var errorMessage = element(by.css("mat-hint[data-automation-id='errorMessage']"));
var tagListRowLocator = by.css("adf-tag-node-actions-list mat-list-item div");
var tagListByNodeIdRowLocator = by.css("adf-tag-node-list mat-chip span");
var tagListContentServicesRowLocator = by.css("div[class*='adf-list-tag']");
var showDeleteButton = element(by.id('adf-remove-button-tag'));
var showMoreButton = element(by.css('button[data-automation-id="show-more-tags"]'));
var showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]'));
var tagsOnPage = element.all(by.css('div[class*="adf-list-tag"]'));
this.getNodeId = function () {
Util.waitUntilElementIsVisible(insertNodeId);
return insertNodeId.getAttribute('value');
};
this.insertNodeId = function (nodeId) {
Util.waitUntilElementIsVisible(insertNodeId);
insertNodeId.clear();
insertNodeId.sendKeys(nodeId);
browser.driver.sleep(200);
insertNodeId.sendKeys(' ')
browser.driver.sleep(200);
insertNodeId.sendKeys(protractor.Key.BACK_SPACE);
};
this.addNewTagInput = function (tag) {
Util.waitUntilElementIsVisible(newTagInput);
newTagInput.sendKeys(tag);
return this;
};
this.addTag = function (tag) {
this.addNewTagInput(tag);
Util.waitUntilElementIsVisible(addTagButton);
Util.waitUntilElementIsClickable(addTagButton);
addTagButton.click();
return this;
};
this.deleteTagFromTagListByNodeId = function (name) {
var deleteChip = element(by.css('button[id="tag_chips_delete_' + name + '"]'));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
};
this.deleteTagFromTagList = function (name) {
var deleteChip = element(by.xpath('//*[@id="tag_chips_delete_' + name + '"]/mat-icon'));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
};
this.getNewTagInput = function () {
Util.waitUntilElementIsVisible(newTagInput);
return newTagInput.getAttribute('value');
};
this.getNewTagPlaceholder = function () {
Util.waitUntilElementIsVisible(newTagInput);
return newTagInput.getAttribute("placeholder");
};
this.addTagButtonIsEnabled = function () {
Util.waitUntilElementIsVisible(addTagButton);
return addTagButton.isEnabled();
};
this.checkTagIsDisplayedInTagList = function (tagName) {
var tag = element(by.cssContainingText("div[id*='tag_name']", tagName));
return Util.waitUntilElementIsVisible(tag);
};
this.checkTagIsNotDisplayedInTagList = function (tagName) {
var tag = element(by.cssContainingText("div[id*='tag_name']", tagName));
return Util.waitUntilElementIsNotOnPage(tag);
};
this.checkTagIsNotDisplayedInTagListByNodeId = function (tagName) {
var tag = element(by.cssContainingText("span[id*='tag_name']", tagName));
return Util.waitUntilElementIsNotOnPage(tag);
};
this.checkTagIsDisplayedInTagListByNodeId = function (tagName) {
var tag = element(by.cssContainingText("span[id*='tag_name']", tagName));
return Util.waitUntilElementIsVisible(tag);
};
this.checkTagListIsEmpty = function () {
Util.waitUntilElementIsNotOnPage(tagListRow);
};
this.checkTagListByNodeIdIsEmpty = function () {
return Util.waitUntilElementIsNotOnPage(tagListByNodeIdRow);
};
this.checkTagIsDisplayedInTagListContentServices = function (tagName) {
var tag = element(by.cssContainingText("div[class='adf-list-tag'][id*='tag_name']", tagName));
return Util.waitUntilElementIsVisible(tag);
};
this.getErrorMessage = function () {
Util.waitUntilElementIsPresent(errorMessage);
return errorMessage.getText();
};
this.checkTagListIsOrderedAscending = function () {
var deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, tagListRowLocator).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.checkTagListByNodeIdIsOrderedAscending = function () {
var deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, tagListByNodeIdRowLocator).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.checkTagListContentServicesIsOrderedAscending = function () {
var deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, tagListContentServicesRowLocator).then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
};
this.checkDeleteTagFromTagListByNodeIdIsDisplayed = function (name) {
var deleteChip = element(by.css('button[id="tag_chips_delete_' + name + '"]'));
return Util.waitUntilElementIsVisible(deleteChip);
};
this.clickShowDeleteButtonSwitch = function () {
Util.waitUntilElementIsVisible(showDeleteButton);
Util.waitUntilElementIsClickable(showDeleteButton);
showDeleteButton.click();
};
this.checkDeleteTagFromTagListByNodeIdIsNotDisplayed = function (name) {
var deleteChip = element(by.css('button[id="tag_chips_delete_' + name + '"]'));
return Util.waitUntilElementIsNotVisible(deleteChip);
};
this.checkShowMoreButtonIsDisplayed = function () {
return Util.waitUntilElementIsVisible(showMoreButton);
};
this.checkShowMoreButtonIsNotDisplayed = function () {
return Util.waitUntilElementIsNotVisible(showMoreButton);
};
this.clickShowMoreButton = function () {
Util.waitUntilElementIsClickable(showMoreButton);
return showMoreButton.click();
};
this.clickShowLessButton = function () {
Util.waitUntilElementIsClickable(showLessButton);
return showLessButton.click();
};
this.checkTagsOnList = function () {
return tagsOnPage.count();
};
this.checkShowLessButtonIsDisplayed = function () {
return Util.waitUntilElementIsVisible(showLessButton);
};
this.checkShowLessButtonIsNotDisplayed = function () {
return Util.waitUntilElementIsNotVisible(showLessButton);
};
this.clickShowMoreButtonUntilNotDisplayed = function () {
showMoreButton.isDisplayed().then((visible) => {
if(visible){
showMoreButton.click();
this.clickShowMoreButtonUntilNotDisplayed();
}
}, err => {})
};
this.clickShowLessButtonUntilNotDisplayed = function () {
showLessButton.isDisplayed().then((visible) => {
if(visible){
showLessButton.click();
this.clickShowLessButtonUntilNotDisplayed();
}
}, err => {})
};
};
module.exports = TagPage;

215
e2e/pages/adf/tagPage.ts Normal file
View File

@ -0,0 +1,215 @@
/*!
* @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 = require('../../util/util');
import ContentList = require('./dialog/contentList');
export class TagPage {
addTagButton = element(by.css('button[id="add-tag"]'));
insertNodeIdElement = element(by.css('input[id="nodeId"]'));
newTagInput = element(by.css('input[id="new-tag-text"]'));
tagListRow = element(by.css('adf-tag-node-actions-list mat-list-item'));
tagListByNodeIdRow = element(by.css('adf-tag-node-list mat-chip'));
errorMessage = element(by.css('mat-hint[data-automation-id="errorMessage"]'));
tagListRowLocator = by.css('adf-tag-node-actions-list mat-list-item div');
tagListByNodeIdRowLocator = by.css('adf-tag-node-list mat-chip span');
tagListContentServicesRowLocator = by.css('div[class*="adf-list-tag"]');
showDeleteButton = element(by.id('adf-remove-button-tag'));
showMoreButton = element(by.css('button[data-automation-id="show-more-tags"]'));
showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]'));
tagsOnPage = element.all(by.css('div[class*="adf-list-tag"]'));
getNodeId() {
Util.waitUntilElementIsVisible(this.insertNodeIdElement);
return this.insertNodeIdElement.getAttribute('value');
}
insertNodeId(nodeId) {
Util.waitUntilElementIsVisible(this.insertNodeIdElement);
this.insertNodeIdElement.clear();
this.insertNodeIdElement.sendKeys(nodeId);
browser.driver.sleep(200);
this.insertNodeIdElement.sendKeys(' ');
browser.driver.sleep(200);
this.insertNodeIdElement.sendKeys(protractor.Key.BACK_SPACE);
}
addNewTagInput(tag) {
Util.waitUntilElementIsVisible(this.newTagInput);
this.newTagInput.sendKeys(tag);
return this;
}
addTag(tag) {
this.addNewTagInput(tag);
Util.waitUntilElementIsVisible(this.addTagButton);
Util.waitUntilElementIsClickable(this.addTagButton);
this.addTagButton.click();
return this;
}
deleteTagFromTagListByNodeId(name) {
let deleteChip = element(by.id('tag_chips_delete_' + name ));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
}
deleteTagFromTagList(name) {
let deleteChip = element(by.id('tag_chips_delete_' + name));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
}
getNewTagInput() {
Util.waitUntilElementIsVisible(this.newTagInput);
return this.newTagInput.getAttribute('value');
}
getNewTagPlaceholder() {
Util.waitUntilElementIsVisible(this.newTagInput);
return this.newTagInput.getAttribute('placeholder');
}
addTagButtonIsEnabled() {
Util.waitUntilElementIsVisible(this.addTagButton);
return this.addTagButton.isEnabled();
}
checkTagIsDisplayedInTagList(tagName) {
let tag = element(by.cssContainingText('div[id*="tag_name"]', tagName));
return Util.waitUntilElementIsVisible(tag);
}
checkTagIsNotDisplayedInTagList(tagName) {
let tag = element(by.cssContainingText('div[id*="tag_name"]', tagName));
return Util.waitUntilElementIsNotOnPage(tag);
}
checkTagIsNotDisplayedInTagListByNodeId(tagName) {
let tag = element(by.cssContainingText('span[id*="tag_name"]', tagName));
return Util.waitUntilElementIsNotOnPage(tag);
}
checkTagIsDisplayedInTagListByNodeId(tagName) {
let tag = element(by.cssContainingText('span[id*="tag_name"]', tagName));
return Util.waitUntilElementIsVisible(tag);
}
checkTagListIsEmpty() {
Util.waitUntilElementIsNotOnPage(this.tagListRow);
}
checkTagListByNodeIdIsEmpty() {
return Util.waitUntilElementIsNotOnPage(this.tagListByNodeIdRow);
}
checkTagIsDisplayedInTagListContentServices(tagName) {
let tag = element(by.cssContainingText('div[class="adf-list-tag"][id*="tag_name"]', tagName));
return Util.waitUntilElementIsVisible(tag);
}
getErrorMessage() {
Util.waitUntilElementIsPresent(this.errorMessage);
return this.errorMessage.getText();
}
checkTagListIsOrderedAscending() {
let deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, this.tagListRowLocator).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
checkTagListByNodeIdIsOrderedAscending() {
let deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, this.tagListByNodeIdRowLocator).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
checkTagListContentServicesIsOrderedAscending() {
let deferred = protractor.promise.defer();
new ContentList().checkListIsSorted(false, this.tagListContentServicesRowLocator).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
}
checkDeleteTagFromTagListByNodeIdIsDisplayed(name) {
let deleteChip = element(by.id('tag_chips_delete_' + name ));
return Util.waitUntilElementIsVisible(deleteChip);
}
checkDeleteTagFromTagListByNodeIdIsNotDisplayed(name) {
let deleteChip = element(by.id('tag_chips_delete_' + name ));
return Util.waitUntilElementIsNotVisible(deleteChip);
}
clickShowDeleteButtonSwitch() {
Util.waitUntilElementIsVisible(this.showDeleteButton);
Util.waitUntilElementIsClickable(this.showDeleteButton);
this.showDeleteButton.click();
}
checkShowMoreButtonIsDisplayed() {
return Util.waitUntilElementIsVisible(this.showMoreButton);
}
clickShowMoreButton() {
Util.waitUntilElementIsClickable(this.showMoreButton);
return this.showMoreButton.click();
}
checkTagsOnList() {
return this.tagsOnPage.count();
}
checkShowLessButtonIsDisplayed() {
return Util.waitUntilElementIsVisible(this.showLessButton);
}
checkShowLessButtonIsNotDisplayed() {
return Util.waitUntilElementIsNotVisible(this.showLessButton);
}
clickShowMoreButtonUntilNotDisplayed() {
this.showMoreButton.isDisplayed().then((visible) => {
if (visible) {
this.showMoreButton.click();
this.clickShowMoreButtonUntilNotDisplayed();
}
}, err => {
});
}
clickShowLessButtonUntilNotDisplayed() {
this.showLessButton.isDisplayed().then((visible) => {
if (visible) {
this.showLessButton.click();
this.clickShowLessButtonUntilNotDisplayed();
}
}, err => {
});
}
}

View File

@ -16,7 +16,6 @@
*/
import Util = require('../../util/util');
import CardViewPage = require('./cardViewPageComponent');
import { TabsPage } from './material/tabsPage';
import { FormControllersPage } from './material/formControllersPage';
@ -65,7 +64,6 @@ export class ViewerPage {
imgViewer = element(by.css('adf-img-viewer'));
activeTab = element(by.css('div[class*="mat-tab-label-active"]'));
uploadNewVersionButton = element(by.css('input[data-automation-id="upload-single-file"]'));
rightChevron = element(by.css('div[class*="header-pagination-after"]'));
toolbarSwitch = element(by.id('adf-switch-toolbar'));
toolbar = element(by.id('adf-viewer-toolbar'));
datatableHeader = element(by.css('div.adf-datatable-header'));
@ -80,7 +78,7 @@ export class ViewerPage {
showLeftSidebarSwitch = element(by.id('adf-switch-showleftsidebar'));
moreActionsSwitch = element(by.id('adf-switch-moreactions'));
moreActions = element(by.id('adf-viewer-moreactions'));
pdfPageLoaded = element(by.css('[data-page-number="1"][data-loaded="true"], adf-img-viewer, adf-txt-viewer'));
downloadSwitch = element(by.id('adf-switch-download'));
downloadButton = element(by.id('adf-viewer-download'));
@ -148,20 +146,8 @@ export class ViewerPage {
Util.waitUntilElementIsVisible(this.datatableHeader);
}
checkPageCanvasIsDisplayed() {
Util.waitUntilElementIsVisible(this.pageCanvas);
}
checkToolbarIsDisplayed(timeout) {
Util.waitUntilElementIsVisible(this.toolbar, timeout);
}
checkViewerIsNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.viewer);
}
checkPdfViewerIsDisplayed() {
Util.waitUntilElementIsOnPage(this.pdfViewer);
checkFileIsLoaded() {
Util.waitUntilElementIsOnPage(this.pdfPageLoaded, 15000);
}
checkImgViewerIsDisplayed() {
@ -479,29 +465,6 @@ export class ViewerPage {
return this.activeTab.getText();
}
checkUnsupportedFileContainerIsDisplayed() {
Util.waitUntilElementIsVisible(this.unsupportedFileContainer);
}
clickRightChevronToGetToTab = (tabName) => {
element.all(by.css('.mat-tab-label'))
.map((element) => element.getAttribute('innerText'))
.then((texts) => {
for (let text of texts) {
if (text === tabName) {
break;
}
clickRightChevron();
}
});
}
clickRightChevron() {
Util.waitUntilElementIsVisible(this.rightChevron);
this.rightChevron.click();
return this;
}
clickOnVersionsTab() {
clickRightChevronToGetToTab('Versions');
tabsPage.clickTabByTitle('Versions');

View File

@ -16,8 +16,8 @@
*/
import { browser } from 'protractor';
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import CONSTANTS = require('../util/constants');

View File

@ -15,10 +15,11 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import Widget = require('../pages/adf/process_services/widgets/widget');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { Widget } from '../pages/adf/process_services/widgets/widget';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import CONSTANTS = require('../util/constants');

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import { AttachFormPage } from '../pages/adf/process_services/attachFormPage';
import FormFields = require('../pages/adf/process_services/formFields');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import FileModel = require('../models/ACS/fileModel');
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import CONSTANTS = require('../util/constants');
@ -135,7 +135,7 @@ describe('Checklist component', () => {
taskPage.removeChecklists(removeChecklist[1]);
taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
taskPage.checkChecklistIsNotDisplayed(removeChecklist[1]);
expect(taskPage.getNumberOfChecklists()).toEqual('1');
// expect(taskPage.getNumberOfChecklists()).toEqual('1');
});
it('[C261027] Should not be able to remove a completed Checklist when clicking on remove button', () => {

View File

@ -16,9 +16,9 @@
*/
import { browser } from 'protractor';
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import { CommentsPage } from '../pages/adf/commentsPage';
import TestConfig = require('../test.config');

View File

@ -17,9 +17,9 @@
import { browser } from 'protractor';
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import { CommentsPage } from '../pages/adf/commentsPage';
import CONSTANTS = require('../util/constants');

View File

@ -17,12 +17,12 @@
import { browser } from 'protractor';
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
import AppSettingsToggles = require('../pages/adf/process_services/dialog/appSettingsToggles');
import FiltersPage = require('../pages/adf/process_services/filtersPage.js');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import FiltersPage = require('../pages/adf/process_services/filtersPage');
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
import { AppSettingsToggles } from '../pages/adf/process_services/dialog/appSettingsToggles';
import TestConfig = require('../test.config');
@ -50,7 +50,7 @@ describe('New Process Filters', () => {
deleted: 'To delete'
};
beforeAll(async(done) => {
beforeAll(async (done) => {
let users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@ -69,7 +69,7 @@ describe('New Process Filters', () => {
done();
});
afterAll(async(done) => {
afterAll(async (done) => {
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
@ -94,7 +94,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.new_filter,
'icon': 'glyphicon-random',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
@ -118,7 +118,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.new_icon,
'icon': 'glyphicon-cloud',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
@ -145,7 +145,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.edited,
'icon': 'glyphicon-random',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
});
@ -165,7 +165,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-random',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
@ -183,7 +183,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-cloud',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
});
@ -220,7 +220,7 @@ describe('New Process Filters', () => {
'appId': null,
'name': processFilter.deleted,
'icon': 'glyphicon-random',
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;

View File

@ -17,10 +17,10 @@
import { browser } from 'protractor';
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
import FiltersPage = require('../pages/adf/process_services/filtersPage.js');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import FiltersPage = require('../pages/adf/process_services/filtersPage');
import TestConfig = require('../test.config');
import resources = require('../util/resources');

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
import DynamicTable = require('../pages/adf/process_services/widgets/DynamicTable');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
import { DynamicTable } from '../pages/adf/process_services/widgets/dynamicTable';
import TestConfig = require('../test.config');
import resources = require('../util/resources');

View File

@ -17,9 +17,9 @@
import TestConfig = require('../test.config');
import resources = require('../util/resources');
import LoginPage = require('../pages/adf/loginPage');
import { LoginPage } from '../pages/adf/loginPage';
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage');
import ProcessListPage = require('../pages/adf/process_services/processListPage');

View File

@ -15,10 +15,10 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import Widget = require('../pages/adf/process_services/widgets/widget');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import { Widget } from '../pages/adf/process_services/widgets/widget';
import CONSTANTS = require('../util/constants');
@ -28,12 +28,12 @@ import Task = require('../models/APS/Task');
import TestConfig = require('../test.config');
import resources = require('../util/resources');
let formInstance = new FormDefinitionModel();
import AlfrescoApi = require('alfresco-js-api-node');
import { AppsActions } from '../actions/APS/apps.actions';
import { UsersActions } from '../actions/users.actions';
let formInstance = new FormDefinitionModel();
describe('Form widgets', () => {
let loginPage = new LoginPage();

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import PaginationPage = require('../pages/adf/paginationPage');
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage');

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
import LoginPage = require('../pages/adf/loginPage');
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
import TasksPage = require('../pages/adf/process_services/tasksPage');
import { LoginPage } from '../pages/adf/loginPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { TasksPage } from '../pages/adf/process_services/tasksPage';
import PaginationPage = require('../pages/adf/paginationPage');
import CONSTANTS = require('../util/constants');

Some files were not shown because too many files have changed in this diff Show More