mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[no-issue] Parallel run e2e and e2e common action refactoring (#4702)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user