Skip to content

Commit

Permalink
[ADF-4514] Move widgets pages to Testing package (Alfresco#4703)
Browse files Browse the repository at this point in the history
  • Loading branch information
marouanbentaleb authored and DenysVuika committed May 22, 2019
1 parent 7a3b358 commit 446efe4
Show file tree
Hide file tree
Showing 46 changed files with 105 additions and 94 deletions.
3 changes: 1 addition & 2 deletions e2e/pages/adf/process-services/tasksPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
*/

import { StartTaskDialog } from './dialog/startTaskDialog';
import { FormFields } from './formFields';
import { TaskDetailsPage } from './taskDetailsPage';

import { FiltersPage } from './filtersPage';
import { ChecklistDialog } from './dialog/createChecklistDialog';
import { TasksListPage } from './tasksListPage';
import { element, by } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';

export class TasksPage {

Expand Down
5 changes: 2 additions & 3 deletions e2e/process-services/attach-file-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* limitations under the License.
*/

import { LoginPage } from '@alfresco/adf-testing';
import { Widget } from '../pages/adf/process-services/widgets/widget';
import { LoginPage, Widget } from '@alfresco/adf-testing';

import { TasksPage } from '../pages/adf/process-services/tasksPage';

Expand Down Expand Up @@ -92,7 +91,7 @@ describe('Start Task - Task App', () => {
.addForm(app.formName)
.clickStartButton();

widget.attachFileWidget().attachFile(appFields.attachFile_id, pdfFile.location);
widget.attachFileWidget().attachFile(appFields.attachFile_id, TestConfig.main.rootPath + pdfFile.location);
widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);

widget.attachFileWidget().viewFile(pdfFile.name);
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/attach-form-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
* limitations under the License.
*/

import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, FormFields } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/adf/process-services/tasksPage';
import { AttachFormPage } from '../pages/adf/process-services/attachFormPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { FormFields } from '../pages/adf/process-services/formFields';

import CONSTANTS = require('../util/constants');

Expand Down
34 changes: 16 additions & 18 deletions e2e/process-services/dynamic-table-date-picker.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
* limitations under the License.
*/

import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, Widget } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from '../pages/adf/process-services/processFiltersPage';
import { ProcessServiceTabBarPage } from '../pages/adf/process-services/processServiceTabBarPage';
import { DynamicTableWidget } from '../pages/adf/process-services/widgets/dynamicTableWidget';
import { DropdownWidget } from '../pages/adf/process-services/widgets/dropdownWidget';
import { DatePickerPage } from '../pages/adf/material/datePickerPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';

Expand All @@ -35,9 +33,9 @@ describe('Dynamic Table', () => {
const loginPage = new LoginPage();
const processFiltersPage = new ProcessFiltersPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const dynamicTable = new DynamicTableWidget();
const datePicker = new DatePickerPage();
const navigationBarPage = new NavigationBarPage();
const widget = new Widget();
let user, tenantId, appId, apps, users;

beforeAll(async(done) => {
Expand Down Expand Up @@ -106,30 +104,30 @@ describe('Dynamic Table', () => {
});

it('[C286277] Should have a datepicker and a mask for DateTime field', () => {
dynamicTable.clickAddButton();
dynamicTable.clickColumnDateTime();
widget.dynamicTable().clickAddButton();
widget.dynamicTable().clickColumnDateTime();

expect(dynamicTable.addRandomStringOnDateTime(randomText.dateTime)).toBe('');
expect(widget.dynamicTable().addRandomStringOnDateTime(randomText.dateTime)).toBe('');
});

it('[C286279] Should be able to save row with Date field', () => {
dynamicTable.clickAddButton();
dynamicTable.addRandomStringOnDate(randomText.date);
dynamicTable.clickSaveButton();
widget.dynamicTable().clickAddButton();
widget.dynamicTable().addRandomStringOnDate(randomText.date);
widget.dynamicTable().clickSaveButton();

expect(dynamicTable.checkErrorMessage()).toBe(randomText.error);
expect(widget.dynamicTable().checkErrorMessage()).toBe(randomText.error);

dynamicTable.clickDateWidget();
widget.dynamicTable().clickDateWidget();
datePicker.selectTodayDate()
.checkDatePickerIsNotDisplayed();
dynamicTable.clickSaveButton();
dynamicTable.getTableRow(rowPosition);
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().getTableRow(rowPosition);
});
});

describe('Required Dropdown', () => {
const app = resources.Files.APP_DYNAMIC_TABLE_DROPDOWN;
const dropdown = new DropdownWidget();
const dropdown = widget.dropdown();

beforeAll(async(done) => {

Expand Down Expand Up @@ -162,10 +160,10 @@ describe('Dynamic Table', () => {

it('[C286519] Should be able to save row with required dropdown column', () => {
const dropdownOption = 'Option 1';
dynamicTable.clickAddButton();
widget.dynamicTable().clickAddButton();
dropdown.selectOption(dropdownOption);
dynamicTable.clickSaveButton();
dynamicTable.checkItemIsPresent(dropdownOption);
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().checkItemIsPresent(dropdownOption);
});
});

Expand Down
30 changes: 12 additions & 18 deletions e2e/process-services/form-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
* limitations under the License.
*/

import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, Widget, FormPage } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { FormPage } from '../pages/adf/process-services/formPage';
import { DateWidget } from '../pages/adf/process-services/widgets/dateWidget';
import { AmountWidget } from '../pages/adf/process-services/widgets/amountWidget';
import { NumberWidget } from '../pages/adf/process-services/widgets/numberWidget';
import TestConfig = require('../test.config');

import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
Expand All @@ -31,9 +27,7 @@ describe('Form Component', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const formPage = new FormPage();
const dateWidget = new DateWidget();
const amountWidget = new AmountWidget();
const numberWidget = new NumberWidget();
const widget = new Widget();

let tenantId, user;

Expand Down Expand Up @@ -85,27 +79,27 @@ describe('Form Component', () => {
});

it('[C286505] Should be able to display errors under the Error Log section', () => {
numberWidget.getNumberFieldLabel(fields.numberWidgetId);
numberWidget.setFieldValue(fields.numberWidgetId, message.test);
widget.numberWidget().getNumberFieldLabel(fields.numberWidgetId);
widget.numberWidget().setFieldValue(fields.numberWidgetId, message.test);
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
formPage.checkErrorLogMessage(message.errorLogNumber);

dateWidget.checkLabelIsVisible(fields.dateWidgetId);
dateWidget.setDateInput(fields.dateWidgetId, message.test);
dateWidget.clickOutsideWidget(fields.dateWidgetId);
widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
widget.dateWidget().clickOutsideWidget(fields.dateWidgetId);
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
formPage.checkErrorLogMessage(message.errorLogDate);

amountWidget.getAmountFieldLabel(fields.amountWidgetId);
amountWidget.setFieldValue(fields.amountWidgetId, message.test);
widget.amountWidget().getAmountFieldLabel(fields.amountWidgetId);
widget.amountWidget().setFieldValue(fields.amountWidgetId, message.test);
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
formPage.checkErrorLogMessage(message.errorLogAmount);

amountWidget.removeFromAmountWidget(fields.amountWidgetId);
widget.amountWidget().removeFromAmountWidget(fields.amountWidgetId);
formPage.checkErrorMessageIsNotDisplayed(message.errorLogAmount);

dateWidget.clearDateInput(fields.dateWidgetId);
numberWidget.clearFieldValue(fields.numberWidgetId);
widget.dateWidget().clearDateInput(fields.dateWidgetId);
widget.numberWidget().clearFieldValue(fields.numberWidgetId);
formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
formPage.checkErrorLogMessage(message.errorLabel);
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/form-people-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, Widget } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from '../pages/adf/process-services/processFiltersPage';
import { Widget } from '../pages/adf/process-services/widgets/widget';
import { StartProcessPage } from '../pages/adf/process-services/startProcessPage';
import { ProcessDetailsPage } from '../pages/adf/process-services/processDetailsPage';
import { TaskDetailsPage } from '../pages/adf/process-services/taskDetailsPage';
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/form-widgets-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/adf/process-services/tasksPage';
import { Widget } from '../pages/adf/process-services/widgets/widget';

import CONSTANTS = require('../util/constants');

Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/amount-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';

import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/attach-folder-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/checkbox-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/date-time-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/date-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/document-template-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/dropdown-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/dynamic-table-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/header-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/hyperlink-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/multi-line-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/number-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';

import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/people-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/radio-buttons-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
3 changes: 1 addition & 2 deletions e2e/process-services/widgets/text-widget.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../../actions/APS/apps.actions';
import { UsersActions } from '../../actions/users.actions';
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
import { Widget } from '../../pages/adf/process-services/widgets/widget';
import CONSTANTS = require('../../util/constants');
import TestConfig = require('../../test.config');
import resources = require('../../util/resources');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { by, element } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
import { ElementFinder } from 'protractor/built/element';

export class FormFields {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { element, by } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
import { BrowserVisibility } from '../../utils/browser-visibility';

export class FormPage {

Expand Down
Loading

0 comments on commit 446efe4

Please sign in to comment.