[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

@@ -3,3 +3,5 @@
*/
export * from './header.page';
export * from '../../material/tabs.page';
export * from './user-info.page';

View File

@@ -0,0 +1,165 @@
/*!
* @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, browser, protractor } from 'protractor';
import { BrowserVisibility } from '../browser-visibility';
import { TabsPage } from '../../material/tabs.page';
export class UserInfoPage {
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'));
userProfileButton = element(by.css('button[data-automation-id="adf-user-profile"]'));
dialogIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
return this;
}
dialogIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.dialog);
return this;
}
clickUserProfile() {
BrowserVisibility.waitUntilElementIsVisible(this.userProfileButton);
this.userProfileButton.click();
}
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() {
BrowserVisibility.waitUntilElementIsVisible(this.userImage);
return this;
}
getContentHeaderTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
BrowserVisibility.waitUntilElementIsVisible(this.userInfoEcmHeaderTitle);
return this.userInfoEcmHeaderTitle.getText();
}
getContentTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoEcmTitle);
return this.userInfoEcmTitle.getText();
}
getContentEmail() {
BrowserVisibility.waitUntilElementIsVisible(this.ecmEmail);
return this.ecmEmail.getText();
}
getContentJobTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.ecmJobTitle);
return this.ecmJobTitle.getText();
}
getProcessHeaderTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoProcessHeaderTitle);
return this.userInfoProcessHeaderTitle.getText();
}
getProcessTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoProcessTitle);
return this.userInfoProcessTitle.getText();
}
getProcessEmail() {
BrowserVisibility.waitUntilElementIsVisible(this.processEmail);
return this.processEmail.getText();
}
getProcessTenant() {
BrowserVisibility.waitUntilElementIsVisible(this.processTenant);
return this.processTenant.getText();
}
getSsoHeaderTitle () {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoHeaderTitle);
return this.userInfoSsoHeaderTitle.getText();
}
getSsoTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoTitle);
return this.userInfoSsoTitle.getText();
}
getSsoEmail() {
BrowserVisibility.waitUntilElementIsVisible(this.ssoEmail);
return this.ssoEmail.getText();
}
closeUserProfile() {
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
checkACSProfileImage() {
BrowserVisibility.waitUntilElementIsVisible(this.acsImage);
}
checkAPSProfileImage() {
BrowserVisibility.waitUntilElementIsVisible(this.apsImage);
}
checkInitialImage() {
BrowserVisibility.waitUntilElementIsVisible(this.initialImage);
}
initialImageNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.initialImage);
}
ACSProfileImageNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.acsImage);
}
APSProfileImageNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.apsImage);
}
}

View File

@@ -0,0 +1,5 @@
/*
* Public API Surface of testing
*/
export * from './tabs.page';

View File

@@ -0,0 +1,35 @@
/*!
* @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 { BrowserVisibility } from '../core/browser-visibility';
export class TabsPage {
clickTabByTitle(tabTitle) {
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
BrowserVisibility.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

@@ -0,0 +1,5 @@
/*
* Public API Surface of testing
*/
export * from '../app/app-list-cloud.page';

View File

@@ -1,36 +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 { by, element } from 'protractor';
import { BrowserVisibility } from '../../core/browser-visibility';
import { AppListCloudPage } from './app-list-cloud.page';
export class NavigationBarPage {
processServicesCloudButton = element(by.css('a[data-automation-id="Process Cloud"]'));
userProfileButton = element(by.css('button[data-automation-id="adf-user-profile"]'));
navigateToProcessServicesCloudPage() {
BrowserVisibility.waitUntilElementIsVisible(this.processServicesCloudButton);
this.processServicesCloudButton.click();
return new AppListCloudPage();
}
clickUserProfile() {
BrowserVisibility.waitUntilElementIsVisible(this.userProfileButton);
this.userProfileButton.click();
}
}

View File

@@ -2,7 +2,6 @@
* Public API Surface of testing
*/
export * from './app-list-cloud.page';
export * from './navigation-bar.page';
export * from './login-sso.page';
export * from './user-info-dialog.page';
export * from '../../core/pages/user-info.page';
export * from '../app/app-list-cloud.page';

View File

@@ -1,47 +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, browser, protractor } from 'protractor';
import { BrowserVisibility } from '../../core/browser-visibility';
export class UserInfoDialogPage {
dialog = element.all(by.css('mat-card[class*="adf-userinfo-card"]')).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'));
getSsoHeaderTitle () {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoHeaderTitle);
return this.userInfoSsoHeaderTitle.getText();
}
getSsoTitle() {
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoTitle);
return this.userInfoSsoTitle.getText();
}
getSsoEmail() {
BrowserVisibility.waitUntilElementIsVisible(this.ssoEmail);
return this.ssoEmail.getText();
}
closeUserProfile() {
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
}

View File

@@ -4,3 +4,4 @@
export * from './pages/public-api';
export * from './actions/public-api';
export * from './app/public-api';

View File

@@ -3,6 +3,7 @@
*/
export * from './lib/core/public-api';
export * from './lib/material/public-api';
export * from './lib/content-services/public-api';
export * from './lib/process-services/public-api';
export * from './lib/process-services-cloud/public-api';