mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4396] Automation test for cancelling new version upload (#4607)
This commit is contained in:
committed by
Eugenio Romano
parent
36ce9bce0d
commit
e1a0475dfc
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
@@ -33,6 +33,8 @@ import { Util } from '../../util/util';
|
||||
import path = require('path');
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { TrashcanPage } from '../../pages/adf/trashcanPage';
|
||||
|
||||
describe('Version component actions', () => {
|
||||
|
||||
@@ -40,6 +42,7 @@ describe('Version component actions', () => {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const trashcanPage = new TrashcanPage();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
|
||||
@@ -147,4 +150,24 @@ describe('Version component actions', () => {
|
||||
versionManagePage.checkFileVersionExist('2.0');
|
||||
});
|
||||
|
||||
it('[C307033] Should be possible to cancel the upload of a new version', async () => {
|
||||
await browser.refresh();
|
||||
contentServicesPage.versionManagerContent(txtFileModel.name);
|
||||
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 1000)');
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
await expect(new UploadDialog().getTitleText()).toEqual('Upload canceled');
|
||||
|
||||
navigationBarPage.clickTrashcanButton();
|
||||
await trashcanPage.waitForTableBody();
|
||||
trashcanPage.checkTrashcanIsEmpty();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -24,6 +24,7 @@ export class TrashcanPage {
|
||||
rows = by.css('adf-document-list div[class*="adf-datatable-body"] div[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
pagination = element(by.css('adf-pagination'));
|
||||
emptyTrashcan = element(by.css('adf-empty-content'));
|
||||
|
||||
numberOfResultsDisplayed() {
|
||||
return element.all(this.rows).count();
|
||||
@@ -37,4 +38,8 @@ export class TrashcanPage {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.pagination);
|
||||
}
|
||||
|
||||
checkTrashcanIsEmpty() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyTrashcan);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -224,7 +224,7 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(columnName, columnValue) {
|
||||
const row = this.getRow(columnName, columnValue);
|
||||
const row = this.getRowElement(columnName, columnValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user