mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-3931]Fix share and lock files automated tests (#4195)
* Fix share-files tests * Moved a locator to a page object * Fix lock-file tests * no message * Fix lock-file * Excluded viewer tests * Fix unshare tests.
This commit is contained in:
committed by
Eugenio Romano
parent
54a1a90083
commit
e63aa9a684
@@ -17,7 +17,7 @@
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { ContentListPage } from '../pages/adf/dialog/contentListPage';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
|
||||
import { LockFilePage } from '../pages/adf/lockFilePage';
|
||||
|
||||
@@ -32,13 +32,13 @@ import resources = require('../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Lock File', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentList = new ContentListPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentList = contentServicesPage.getUploadAreaDocumentList();
|
||||
const lockFilePage = new LockFilePage();
|
||||
|
||||
let adminUser = new AcsUserModel();
|
||||
@@ -337,10 +337,6 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
contentList.lockContent(pngFileToLock.name);
|
||||
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
@@ -348,7 +344,7 @@ describe('Lock File', () => {
|
||||
lockFilePage.clickAllowOwnerCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
contentList.deleteContent(pngFileToBeLocked.entry.name);
|
||||
contentList.deleteContentWithRoot(pngFileToBeLocked.entry.name);
|
||||
contentList.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||
@@ -36,7 +35,7 @@ describe('Share file', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const contentListPage = contentServicesPage.getUploadAreaDocumentList();
|
||||
const shareDialog = new ShareDialog();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
@@ -67,10 +66,6 @@ describe('Share file', () => {
|
||||
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -81,20 +76,29 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
describe('Shared link dialog', () => {
|
||||
afterEach( (done) => {
|
||||
browser.refresh();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C286549] Should check automatically toggle button in Share dialog', () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.shareToggleButtonIsChecked();
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286544] Should display notification when clicking URL copy button', () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickShareLinkButton();
|
||||
@@ -102,11 +106,11 @@ describe('Share file', () => {
|
||||
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.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.checkShareLinkIsDisplayed();
|
||||
@@ -114,16 +118,7 @@ describe('Share file', () => {
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286578] Should disable today option in expiration day calendar', () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
shareDialog.calendarTodayDayIsDisabled();
|
||||
});
|
||||
|
||||
it('[C286548] Should be possible to set expiry date for link', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
@@ -137,6 +132,15 @@ describe('Share file', () => {
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.expirationDateInputHasValue(value);
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286578] Should disable today option in expiration day calendar', () => {
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
shareDialog.calendarTodayDayIsDisabled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -147,8 +151,19 @@ describe('Share file', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C286565] Should open file when logged user access shared link', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickShareLinkButton();
|
||||
@@ -159,7 +174,7 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickShareLinkButton();
|
||||
@@ -177,7 +192,7 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
it('[C286539] Should open file when non-logged user access shared link', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.checkShareLinkIsDisplayed();
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('Unshare file', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const contentListPage = contentServicesPage.getUploadAreaDocumentList();
|
||||
let navBar = new NavigationBarPage();
|
||||
const errorPage = new ErrorPage();
|
||||
const shareDialog = new ShareDialog();
|
||||
@@ -118,7 +118,7 @@ describe('Unshare file', () => {
|
||||
});
|
||||
|
||||
it('[C286550] Should display unshare confirmation dialog', () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickUnShareFile();
|
||||
@@ -126,7 +126,7 @@ describe('Unshare file', () => {
|
||||
});
|
||||
|
||||
it('[C286551] Should be able to cancel unshare action', () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickUnShareFile();
|
||||
@@ -136,7 +136,7 @@ describe('Unshare file', () => {
|
||||
});
|
||||
|
||||
it('[C286552] Should be able to confirm unshare action', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickUnShareFile();
|
||||
@@ -146,7 +146,7 @@ describe('Unshare file', () => {
|
||||
});
|
||||
|
||||
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
|
||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
let sharedLink = await shareDialog.getShareLink();
|
||||
|
||||
Reference in New Issue
Block a user