[no-issue] Parallel run e2e and e2e common action refactoring (#4702)

This commit is contained in:
Eugenio Romano
2019-05-13 04:44:35 +02:00
committed by GitHub
parent a48bfc3714
commit 898e3b5a80
288 changed files with 8704 additions and 5130 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
@@ -29,7 +29,6 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '../../actions/ACS/upload.actions';
import { browser } from 'protractor';
describe('Share file', () => {
@@ -57,80 +56,61 @@ describe('Share file', () => {
});
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);
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
nodeId = pngUploadedFile.entry.id;
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
afterAll(async (done) => {
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
try {
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
} catch (error) {
}
done();
});
describe('Shared link dialog', () => {
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
beforeAll(() => {
contentListPage.selectRow(pngFileModel.name);
});
afterEach(async (done) => {
await browser.refresh();
contentServicesPage.waitForTableBody();
done();
afterEach(() => {
BrowserActions.closeMenuAndDialogs();
});
it('[C286549] Should check automatically toggle button in Share dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
});
it('[C286544] Should display notification when clicking URL copy button', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
shareDialog.waitForNotificationToClose();
shareDialog.clickShareLinkButton();
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
});
it('[C286543] Should be possible to close Share dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
@@ -138,7 +118,6 @@ describe('Share file', () => {
});
it('[C286548] Should be possible to set expiry date for link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
@@ -152,12 +131,10 @@ describe('Share file', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.expirationDateInputHasValue(value);
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
BrowserActions.closeMenuAndDialogs();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
@@ -166,18 +143,16 @@ describe('Share file', () => {
});
describe('Shared link preview', () => {
afterEach( (done) => {
afterEach((done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
});
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
@@ -190,7 +165,7 @@ describe('Share file', () => {
shareDialog.clickShareLinkButton();
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
const sharedLink = await shareDialog.getShareLink();
browser.get(sharedLink);
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
@@ -208,7 +183,7 @@ describe('Share file', () => {
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
const secondSharedLink = await shareDialog.getShareLink();
expect(sharedLink).toEqual(secondSharedLink);
browser.get(sharedLink);
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
@@ -220,7 +195,7 @@ describe('Share file', () => {
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickCloseButton();
navigationBarPage.clickLogoutButton();
browser.get(sharedLink);
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
});