[ADF-4089] Refactoring ContentListPage (#4162)

* [ADF-NO-ISSUE] Refactoring ContentListPage

* Applying changes

* [ADF-4089] contentListPage refactoring

* Fixing missing dependencies

* Fixing core and search failing tests

* Fix tooltip document-list tests

* no message
This commit is contained in:
Marouan Bentaleb
2019-03-08 10:49:23 +00:00
committed by Eugenio Romano
parent 88ef01011e
commit 27c6e18a10
93 changed files with 3409 additions and 3840 deletions
@@ -35,7 +35,7 @@ describe('Share file', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const contentListPage = contentServicesPage.getUploadAreaDocumentList();
const contentListPage = contentServicesPage.getDocumentList();
const shareDialog = new ShareDialog();
const navigationBarPage = new NavigationBarPage();
const viewerPage = new ViewerPage();
@@ -66,6 +66,10 @@ describe('Share file', () => {
nodeId = pngUploadedFile.entry.id;
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
});
@@ -81,16 +85,21 @@ describe('Share file', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.navigateToDocumentList();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
done();
});
afterEach(async (done) => {
await browser.refresh();
contentServicesPage.waitForTableBody();
done();
});
it('[C286549] Should check automatically toggle button in Share dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
@@ -99,6 +108,7 @@ describe('Share file', () => {
});
it('[C286544] Should display notification when clicking URL copy button', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
@@ -111,6 +121,7 @@ describe('Share file', () => {
});
it('[C286543] Should be possible to close Share dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
@@ -118,7 +129,16 @@ describe('Share file', () => {
shareDialog.dialogIsClosed();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.calendarTodayDayIsDisabled();
});
it('[C286548] Should be possible to set expiry date for link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
@@ -137,6 +157,7 @@ describe('Share file', () => {
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
@@ -147,7 +168,7 @@ describe('Share file', () => {
describe('Shared link preview', () => {
afterEach( (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.navigateToDocumentList();
navigationBarPage.clickContentServicesButton();
done();
});
@@ -155,7 +176,7 @@ describe('Share file', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.navigateToDocumentList();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
@@ -163,7 +184,7 @@ describe('Share file', () => {
});
it('[C286565] Should open file when logged user access shared link', async () => {
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
@@ -174,7 +195,7 @@ describe('Share file', () => {
});
it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => {
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
@@ -192,7 +213,7 @@ describe('Share file', () => {
});
it('[C286539] Should open file when non-logged user access shared link', async () => {
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
@@ -20,7 +20,6 @@ import { Util } from '../../util/util';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
import { ErrorPage } from '../../pages/adf/errorPage';
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -35,8 +34,8 @@ describe('Unshare file', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const contentListPage = contentServicesPage.getUploadAreaDocumentList();
let navBar = new NavigationBarPage();
const contentListPage = contentServicesPage.getDocumentList();
const navBar = new NavigationBarPage();
const errorPage = new ErrorPage();
const shareDialog = new ShareDialog();
const siteName = `PRIVATE-TEST-SITE-${Util.generateRandomString(5)}`;
@@ -102,7 +101,8 @@ describe('Unshare file', () => {
nodeId = pngUploadedFile.entry.id;
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.navigateToDocumentList();
navBar.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
@@ -118,7 +118,7 @@ describe('Unshare file', () => {
});
it('[C286550] Should display unshare confirmation dialog', () => {
contentListPage.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(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.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(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.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(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.clickRowToSelectWithRoot(pngFileModel.name);
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
let sharedLink = await shareDialog.getShareLink();
@@ -168,8 +168,8 @@ describe('Unshare file', () => {
it('[C286555] Should NOT be able to unshare file without permission', () => {
navBar.goToSite(testSite);
contentListPage.navigateToFolder('documentLibrary');
contentListPage.clickRowToSelect(nodeBody.name);
contentListPage.doubleClickRow('documentLibrary');
contentListPage.selectRow(nodeBody.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();