[ADF-4166] move app-list-cloud.page to adf-testing (#4404)

* in progress

* moved UserInfoDialogPage, AppListCloudPage, LoginSSOPage and TabsPage. ADF-4166

* moved UserInfoDialogPage, AppListCloudPage, LoginSSOPage and TabsPage. ADF-4166

* linting fixes

* crc's

* crc's

* added adf-testing to package.json file

* fix for failing unit tests

* fixes

* test failure fixes

* test failure fixes

* reverted ot old location pages/adf/navigationBarPage

* added the testing variable to affected-libs file and changed the version to 3.1.0-beta5 and added the missing adf-content-services dependency.

* Fix the material export

* Remove the reference to the tse2econfig not allowed

* fix failing test

* Update user-info.page.ts
This commit is contained in:
gmandakini
2019-03-12 10:00:09 +00:00
committed by Eugenio Romano
parent 4feb8c3f95
commit 285e56e9fb
35 changed files with 243 additions and 353 deletions

View File

@@ -18,7 +18,7 @@
import { element, by } from 'protractor';
import { Util } from '../../util/util';
import { TabsPage } from './material/tabsPage';
import { TabsPage } from '@alfresco/adf-testing';
export class CommentsPage {

View File

@@ -1,158 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Util } from '../../../util/util';
import { TabsPage } from '../material/tabsPage';
import { element, by, browser, protractor } from 'protractor';
export class UserInfoDialog {
dialog = element.all(by.css('mat-card[class*="adf-userinfo-card"]')).first();
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();
userInfoSsoHeaderTitle = this.dialog.element(by.css('div[id="identity-username"]'));
userInfoSsoTitle = element(by.css('.adf-userinfo__detail-title'));
ssoEmail = element(by.id('identity-email'));
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;
}
checkProcessServicesTabIsSelected() {
let tabsPage = new TabsPage;
tabsPage.checkTabIsSelectedByTitle('Process 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.dialog);
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();
}
getSsoHeaderTitle () {
Util.waitUntilElementIsVisible(this.userInfoSsoHeaderTitle);
return this.userInfoSsoHeaderTitle.getText();
}
getSsoTitle() {
Util.waitUntilElementIsVisible(this.userInfoSsoTitle);
return this.userInfoSsoTitle.getText();
}
getSsoEmail() {
Util.waitUntilElementIsVisible(this.ssoEmail);
return this.ssoEmail.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,59 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Util } from '../../util/util';
import { element, by, browser, protractor } from 'protractor';
export class LoginSSOPage {
ssoButton = element(by.css(`[data-automation-id="login-button-sso"]`));
usernameField = element(by.id('username'));
passwordField = element(by.id('password'));
loginButton = element(by.css('input[class="submit"]'));
header = element(by.id('adf-header'));
loginAPS(username, password) {
browser.ignoreSynchronization = true;
this.enterUsername(username);
this.enterPassword(password);
this.clickLoginButton();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
return Util.waitUntilElementIsVisible(this.header);
}
clickOnSSOButton() {
Util.waitUntilElementIsVisible(this.ssoButton);
this.ssoButton.click();
}
enterUsername(username) {
Util.waitUntilElementIsVisible(this.usernameField);
this.usernameField.clear();
this.usernameField.sendKeys(username);
}
enterPassword(password) {
Util.waitUntilElementIsVisible(this.passwordField);
this.passwordField.clear();
this.passwordField.sendKeys(password);
}
clickLoginButton() {
Util.waitUntilElementIsVisible(this.loginButton);
return this.loginButton.click();
}
}

View File

@@ -1,35 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { element, by } from 'protractor';
import { Util } from '../../../util/util';
export class TabsPage {
clickTabByTitle(tabTitle) {
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
Util.waitUntilElementIsVisible(tab);
tab.click();
}
checkTabIsSelectedByTitle(tabTitle) {
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
tab.getAttribute('aria-selected').then((result) => {
expect(result).toBe('true');
});
}
}

View File

@@ -18,7 +18,7 @@
import { Util } from '../../util/util';
import { browser, by, element } from 'protractor';
import { ProcessServicesPage } from './process-services/processServicesPage';
import { AppListCloudComponent } from './process-cloud/appListCloudComponent';
import { AppListCloudPage } from '@alfresco/adf-testing';
import TestConfig = require('../../test.config');
import { PeopleGroupCloudComponentPage } from './demo-shell/process-services/peopleGroupCloudComponentPage';
@@ -33,7 +33,8 @@ export class NavigationBarPage {
loginButton = element(by.css('a[data-automation-id="Login"]'));
trashcanButton = element(by.css('a[data-automation-id="Trashcan"]'));
overlayViewerButton = element(by.css('a[data-automation-id="Overlay Viewer"]'));
userProfileButton = element(by.css('button[data-automation-id="adf-user-profile"]'));
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
logoutButton = element(by.css('a[adf-logout]'));
cardViewButton = element(by.cssContainingText('.adf-sidenav-menu-label', 'CardView'));
languageMenuButton = element(by.css('button[data-automation-id="language-menu-button"]'));
@@ -77,7 +78,7 @@ export class NavigationBarPage {
navigateToProcessServicesCloudPage() {
Util.waitUntilElementIsVisible(this.processServicesCloudButton);
this.processServicesCloudButton.click();
return new AppListCloudComponent();
return new AppListCloudPage();
}
navigateToPeopleGroupCloudPage() {
@@ -89,7 +90,7 @@ export class NavigationBarPage {
navigateToSettingsPage() {
Util.waitUntilElementIsVisible(this.settingsButton);
this.settingsButton.click();
return new AppListCloudComponent();
return new AppListCloudPage();
}
clickLoginButton() {
@@ -108,9 +109,17 @@ export class NavigationBarPage {
return this;
}
clickUserProfile() {
Util.waitUntilElementIsVisible(this.userProfileButton);
this.userProfileButton.click();
clickThemeButton() {
Util.waitUntilElementIsVisible(this.themeButton);
this.themeButton.click();
Util.waitUntilElementIsVisible(this.themeMenuContent);
}
clickOnSpecificThemeButton(themeName) {
let themeElement = element(by.css(`button[data-automation-id="${themeName}"]`));
Util.waitUntilElementIsVisible(themeElement);
Util.waitUntilElementIsClickable(themeElement);
themeElement.click();
}
clickLogoutButton() {
@@ -188,6 +197,11 @@ export class NavigationBarPage {
Util.waitUntilElementIsVisible(logoTooltip);
}
openViewer(nodeId) {
browser.get(TestConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
return this;
}
goToSite(site) {
browser.get(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
}

View File

@@ -1,46 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Util } from '../../../util/util';
import { element, by } from 'protractor';
export class AppListCloudComponent {
apsAppsContainer = element(by.css('adf-cloud-app-list'));
checkApsContainer() {
Util.waitUntilElementIsVisible(this.apsAppsContainer);
}
goToApp(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
app.click();
}
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);
}
}

View File

@@ -18,7 +18,7 @@
import { AppSettingsToggles } from './dialog/appSettingsToggles';
import { Util } from '../../../util/util';
import { element, by, protractor, browser } from 'protractor';
import { TabsPage } from '../material/tabsPage';
import { TabsPage } from '@alfresco/adf-testing';
export class TaskDetailsPage {

View File

@@ -17,7 +17,7 @@
import { Util } from '../../util/util';
import { TabsPage } from './material/tabsPage';
import { TabsPage } from '@alfresco/adf-testing';
import { FormControllersPage } from './material/formControllersPage';
import { element, by, browser, protractor } from 'protractor';