C307984 automated (#4657)

This commit is contained in:
gmandakini
2019-04-26 17:22:22 +01:00
committed by Eugenio Romano
parent 934386fb16
commit f24245aa23
4 changed files with 46 additions and 1 deletions

View File

@@ -24,16 +24,25 @@ import TestConfig = require('../../test.config');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { NotificationPage } from '../../pages/adf/notificationPage';
import { DropActions } from '../../actions/drop.actions';
import resources = require('../../util/resources');
import { FileModel } from '../../models/ACS/fileModel';
describe('Datatable component', () => {
const dataTablePage = new DataTablePage('defaultTable');
const copyContentDataTablePage = new DataTablePage('copyClipboardDataTable');
const dragAndDropDataTablePage = new DataTablePage();
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
const navigationBarPage = new NavigationBarPage();
const dataTableComponent = new DataTableComponentPage();
const notificationPage = new NotificationPage();
const dragAndDrop = new DropActions();
const pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
@@ -190,4 +199,23 @@ describe('Datatable component', () => {
expect(copyContentDataTablePage.getClipboardInputText()).toContain(jsonValue);
});
});
describe('Datatable component - Drag and Drop', () => {
beforeAll(async (done) => {
navigationBarPage.navigateToDragAndDropDatatable();
done();
});
it('[C307984] Should trigger the event handling header-drop and cell-drop', () => {
const dragAndDropHeader = dragAndDropDataTablePage.getDropTargetIdColumnHeader();
dragAndDrop.dropFile(dragAndDropHeader, pngFile.location);
notificationPage.checkNotifyContains('Dropped data on [ id ] header');
notificationPage.checkNotificationSnackBarIsNotDisplayed();
const dragAndDropCell = dragAndDropDataTablePage.getDropTargetIdColumnCell(1);
dragAndDrop.dropFile(dragAndDropCell, pngFile.location);
notificationPage.checkNotifyContains('Dropped data on [ id ] cell');
});
});
});