From 446efe429774008ae352acea1889cbe76f400df9 Mon Sep 17 00:00:00 2001 From: Marouan Bentaleb <38426175+marouanbentaleb@users.noreply.github.com> Date: Wed, 22 May 2019 18:32:46 +0100 Subject: [PATCH] [ADF-4514] Move widgets pages to Testing package (#4703) --- e2e/pages/adf/process-services/tasksPage.ts | 3 +- .../attach-file-widget.e2e.ts | 5 ++- .../attach-form-component.e2e.ts | 3 +- .../dynamic-table-date-picker.e2e.ts | 34 +++++++++---------- e2e/process-services/form-component.e2e.ts | 30 +++++++--------- .../form-people-widget.e2e.ts | 3 +- .../form-widgets-component.e2e.ts | 3 +- .../widgets/amount-widget.e2e.ts | 3 +- .../widgets/attach-folder-widget.e2e.ts | 3 +- .../widgets/checkbox-widget.e2e.ts | 3 +- .../widgets/date-time-widget.e2e.ts | 3 +- .../widgets/date-widget.e2e.ts | 3 +- .../widgets/document-template-widget.e2e.ts | 3 +- .../widgets/dropdown-widget.e2e.ts | 3 +- .../widgets/dynamic-table-widget.e2e.ts | 3 +- .../widgets/header-widget.e2e.ts | 3 +- .../widgets/hyperlink-widget.e2e.ts | 3 +- .../widgets/multi-line-widget.e2e.ts | 3 +- .../widgets/number-widget.e2e.ts | 3 +- .../widgets/people-widget.e2e.ts | 3 +- .../widgets/radio-buttons-widget.e2e.ts | 3 +- .../widgets/text-widget.e2e.ts | 3 +- .../src/lib/core/pages/form}/formFields.ts | 2 +- .../src/lib/core/pages/form}/formPage.ts | 2 +- .../src/lib/core/pages/form/public-api.ts | 21 ++++++++++++ .../core/pages/form}/widgets/amountWidget.ts | 2 +- .../pages/form}/widgets/attachFileWidget.ts | 8 ++--- .../pages/form}/widgets/checkboxWidget.ts | 2 +- .../pages/form}/widgets/containerWidget.ts | 0 .../pages/form}/widgets/dateTimeWidget.ts | 2 +- .../core/pages/form}/widgets/dateWidget.ts | 2 +- .../pages/form}/widgets/displayTextWidget.ts | 0 .../pages/form}/widgets/displayValueWidget.ts | 0 .../pages/form}/widgets/documentWidget.ts | 0 .../pages/form}/widgets/dropdownWidget.ts | 2 +- .../pages/form}/widgets/dynamicTableWidget.ts | 2 +- .../core/pages/form}/widgets/headerWidget.ts | 0 .../pages/form}/widgets/hyperlinkWidget.ts | 2 +- .../form}/widgets/multilineTextWidget.ts | 0 .../core/pages/form}/widgets/numberWidget.ts | 2 +- .../core/pages/form}/widgets/peopleWidget.ts | 2 +- .../lib/core/pages/form/widgets/public-api.ts | 18 ++++++++++ .../pages/form}/widgets/radioButtonsWidget.ts | 2 +- .../core/pages/form}/widgets/textWidget.ts | 0 .../lib/core/pages/form}/widgets/widget.ts | 0 lib/testing/src/lib/core/pages/public-api.ts | 2 ++ 46 files changed, 105 insertions(+), 94 deletions(-) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/formFields.ts (98%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/formPage.ts (96%) create mode 100644 lib/testing/src/lib/core/pages/form/public-api.ts rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/amountWidget.ts (96%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/attachFileWidget.ts (85%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/checkboxWidget.ts (95%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/containerWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/dateTimeWidget.ts (97%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/dateWidget.ts (96%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/displayTextWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/displayValueWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/documentWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/dropdownWidget.ts (95%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/dynamicTableWidget.ts (98%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/headerWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/hyperlinkWidget.ts (95%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/multilineTextWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/numberWidget.ts (95%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/peopleWidget.ts (96%) create mode 100644 lib/testing/src/lib/core/pages/form/widgets/public-api.ts rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/radioButtonsWidget.ts (95%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/textWidget.ts (100%) rename {e2e/pages/adf/process-services => lib/testing/src/lib/core/pages/form}/widgets/widget.ts (100%) diff --git a/e2e/pages/adf/process-services/tasksPage.ts b/e2e/pages/adf/process-services/tasksPage.ts index 37df788305d..eb0ef878992 100644 --- a/e2e/pages/adf/process-services/tasksPage.ts +++ b/e2e/pages/adf/process-services/tasksPage.ts @@ -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 { diff --git a/e2e/process-services/attach-file-widget.e2e.ts b/e2e/process-services/attach-file-widget.e2e.ts index fe28c4298b3..416f8e8ab43 100644 --- a/e2e/process-services/attach-file-widget.e2e.ts +++ b/e2e/process-services/attach-file-widget.e2e.ts @@ -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'; @@ -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); diff --git a/e2e/process-services/attach-form-component.e2e.ts b/e2e/process-services/attach-form-component.e2e.ts index 614205ace73..12fbb8eeec4 100644 --- a/e2e/process-services/attach-form-component.e2e.ts +++ b/e2e/process-services/attach-form-component.e2e.ts @@ -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'); diff --git a/e2e/process-services/dynamic-table-date-picker.e2e.ts b/e2e/process-services/dynamic-table-date-picker.e2e.ts index 411eccf274f..2142185918d 100644 --- a/e2e/process-services/dynamic-table-date-picker.e2e.ts +++ b/e2e/process-services/dynamic-table-date-picker.e2e.ts @@ -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'; @@ -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) => { @@ -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) => { @@ -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); }); }); diff --git a/e2e/process-services/form-component.e2e.ts b/e2e/process-services/form-component.e2e.ts index 6eec84bc0a2..aeec0defa2b 100644 --- a/e2e/process-services/form-component.e2e.ts +++ b/e2e/process-services/form-component.e2e.ts @@ -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'; @@ -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; @@ -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); diff --git a/e2e/process-services/form-people-widget.e2e.ts b/e2e/process-services/form-people-widget.e2e.ts index bf95565e184..0360ac2d31c 100644 --- a/e2e/process-services/form-people-widget.e2e.ts +++ b/e2e/process-services/form-people-widget.e2e.ts @@ -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'; diff --git a/e2e/process-services/form-widgets-component.e2e.ts b/e2e/process-services/form-widgets-component.e2e.ts index 52d5dca479d..b0d1aab06fe 100644 --- a/e2e/process-services/form-widgets-component.e2e.ts +++ b/e2e/process-services/form-widgets-component.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/amount-widget.e2e.ts b/e2e/process-services/widgets/amount-widget.e2e.ts index d17124168ed..a87214b8099 100644 --- a/e2e/process-services/widgets/amount-widget.e2e.ts +++ b/e2e/process-services/widgets/amount-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/attach-folder-widget.e2e.ts b/e2e/process-services/widgets/attach-folder-widget.e2e.ts index 1a7462df59c..df71905a633 100644 --- a/e2e/process-services/widgets/attach-folder-widget.e2e.ts +++ b/e2e/process-services/widgets/attach-folder-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/checkbox-widget.e2e.ts b/e2e/process-services/widgets/checkbox-widget.e2e.ts index ba6090abbbf..f122a4b0298 100644 --- a/e2e/process-services/widgets/checkbox-widget.e2e.ts +++ b/e2e/process-services/widgets/checkbox-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/date-time-widget.e2e.ts b/e2e/process-services/widgets/date-time-widget.e2e.ts index 2861866b39c..2df71fd5394 100644 --- a/e2e/process-services/widgets/date-time-widget.e2e.ts +++ b/e2e/process-services/widgets/date-time-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/date-widget.e2e.ts b/e2e/process-services/widgets/date-widget.e2e.ts index 3a41ddd6043..5cd2a9d97b6 100644 --- a/e2e/process-services/widgets/date-widget.e2e.ts +++ b/e2e/process-services/widgets/date-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/document-template-widget.e2e.ts b/e2e/process-services/widgets/document-template-widget.e2e.ts index 76b08d02c88..ba976043016 100644 --- a/e2e/process-services/widgets/document-template-widget.e2e.ts +++ b/e2e/process-services/widgets/document-template-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/dropdown-widget.e2e.ts b/e2e/process-services/widgets/dropdown-widget.e2e.ts index c1f119185e0..b2599634f4d 100644 --- a/e2e/process-services/widgets/dropdown-widget.e2e.ts +++ b/e2e/process-services/widgets/dropdown-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts index 9e74bcfc654..34dd2f688c3 100644 --- a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts +++ b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/header-widget.e2e.ts b/e2e/process-services/widgets/header-widget.e2e.ts index 82e3b8e0f32..5e056f96e08 100644 --- a/e2e/process-services/widgets/header-widget.e2e.ts +++ b/e2e/process-services/widgets/header-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/hyperlink-widget.e2e.ts b/e2e/process-services/widgets/hyperlink-widget.e2e.ts index 8d4917f8609..4941a0856c1 100644 --- a/e2e/process-services/widgets/hyperlink-widget.e2e.ts +++ b/e2e/process-services/widgets/hyperlink-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/multi-line-widget.e2e.ts b/e2e/process-services/widgets/multi-line-widget.e2e.ts index 5706d728a24..8ab620f3b78 100644 --- a/e2e/process-services/widgets/multi-line-widget.e2e.ts +++ b/e2e/process-services/widgets/multi-line-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/number-widget.e2e.ts b/e2e/process-services/widgets/number-widget.e2e.ts index 8e313ecae0c..c44b1003c60 100644 --- a/e2e/process-services/widgets/number-widget.e2e.ts +++ b/e2e/process-services/widgets/number-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/people-widget.e2e.ts b/e2e/process-services/widgets/people-widget.e2e.ts index c903685c8d2..0ae32c2687b 100644 --- a/e2e/process-services/widgets/people-widget.e2e.ts +++ b/e2e/process-services/widgets/people-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts index 8b093bb1ced..1438950375a 100644 --- a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts +++ b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts @@ -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'); diff --git a/e2e/process-services/widgets/text-widget.e2e.ts b/e2e/process-services/widgets/text-widget.e2e.ts index 66e96a0a4af..785d6956ae8 100644 --- a/e2e/process-services/widgets/text-widget.e2e.ts +++ b/e2e/process-services/widgets/text-widget.e2e.ts @@ -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'); diff --git a/e2e/pages/adf/process-services/formFields.ts b/lib/testing/src/lib/core/pages/form/formFields.ts similarity index 98% rename from e2e/pages/adf/process-services/formFields.ts rename to lib/testing/src/lib/core/pages/form/formFields.ts index bd20bad0c56..cb01ef7fa3d 100644 --- a/e2e/pages/adf/process-services/formFields.ts +++ b/lib/testing/src/lib/core/pages/form/formFields.ts @@ -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 { diff --git a/e2e/pages/adf/process-services/formPage.ts b/lib/testing/src/lib/core/pages/form/formPage.ts similarity index 96% rename from e2e/pages/adf/process-services/formPage.ts rename to lib/testing/src/lib/core/pages/form/formPage.ts index 0684eecde43..21ab0391299 100644 --- a/e2e/pages/adf/process-services/formPage.ts +++ b/lib/testing/src/lib/core/pages/form/formPage.ts @@ -16,7 +16,7 @@ */ import { element, by } from 'protractor'; -import { BrowserVisibility } from '@alfresco/adf-testing'; +import { BrowserVisibility } from '../../utils/browser-visibility'; export class FormPage { diff --git a/lib/testing/src/lib/core/pages/form/public-api.ts b/lib/testing/src/lib/core/pages/form/public-api.ts new file mode 100644 index 00000000000..f9243f3478c --- /dev/null +++ b/lib/testing/src/lib/core/pages/form/public-api.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './widgets/public-api'; + +export * from './formFields'; +export * from './formPage'; diff --git a/e2e/pages/adf/process-services/widgets/amountWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/amountWidget.ts similarity index 96% rename from e2e/pages/adf/process-services/widgets/amountWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/amountWidget.ts index 5acf93ff98f..c91d5f0ff11 100644 --- a/e2e/pages/adf/process-services/widgets/amountWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/amountWidget.ts @@ -16,7 +16,7 @@ */ import { element, by, protractor } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; import { FormFields } from '../formFields'; export class AmountWidget { diff --git a/e2e/pages/adf/process-services/widgets/attachFileWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidget.ts similarity index 85% rename from e2e/pages/adf/process-services/widgets/attachFileWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/attachFileWidget.ts index 6a489735d66..7914da85457 100644 --- a/e2e/pages/adf/process-services/widgets/attachFileWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidget.ts @@ -16,10 +16,8 @@ */ import { FormFields } from '../formFields'; -import TestConfig = require('../../../../test.config'); -import path = require('path'); -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; -import remote = require('selenium-webdriver/remote'); +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; +import * as remote from 'selenium-webdriver/remote'; import { element, by, browser } from 'protractor'; export class AttachFileWidget { @@ -35,7 +33,7 @@ export class AttachFileWidget { const uploadButton = widget.element(this.uploadLocator); BrowserActions.click(uploadButton); BrowserVisibility.waitUntilElementIsVisible(this.localStorageButton); - this.localStorageButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation))); + this.localStorageButton.sendKeys(fileLocation); return this; } diff --git a/e2e/pages/adf/process-services/widgets/checkboxWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts similarity index 95% rename from e2e/pages/adf/process-services/widgets/checkboxWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts index 4fb805dc08e..72260387a11 100644 --- a/e2e/pages/adf/process-services/widgets/checkboxWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts @@ -16,7 +16,7 @@ */ import { FormFields } from '../formFields'; -import { BrowserActions } from '@alfresco/adf-testing'; +import { BrowserActions } from '../../../utils/public-api'; import { by, element } from 'protractor'; export class CheckboxWidget { diff --git a/e2e/pages/adf/process-services/widgets/containerWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/containerWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/containerWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/containerWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/dateTimeWidget.ts similarity index 97% rename from e2e/pages/adf/process-services/widgets/dateTimeWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/dateTimeWidget.ts index 1b967dbf6c2..5882c919b61 100644 --- a/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/dateTimeWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { element, by, protractor } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class DateTimeWidget { diff --git a/e2e/pages/adf/process-services/widgets/dateWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/dateWidget.ts similarity index 96% rename from e2e/pages/adf/process-services/widgets/dateWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/dateWidget.ts index 28ab9cdd5c1..03250e2a722 100644 --- a/e2e/pages/adf/process-services/widgets/dateWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/dateWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { element, by, protractor } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class DateWidget { diff --git a/e2e/pages/adf/process-services/widgets/displayTextWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/displayTextWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/displayTextWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/displayTextWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/displayValueWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/displayValueWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/displayValueWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/displayValueWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/documentWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/documentWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/documentWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/documentWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/dropdownWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/dropdownWidget.ts similarity index 95% rename from e2e/pages/adf/process-services/widgets/dropdownWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/dropdownWidget.ts index ab1d4d0e751..c8153e7c930 100644 --- a/e2e/pages/adf/process-services/widgets/dropdownWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/dropdownWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { by, element } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class DropdownWidget { diff --git a/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/dynamicTableWidget.ts similarity index 98% rename from e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/dynamicTableWidget.ts index a796b8b07ca..7ad14f3dba5 100644 --- a/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/dynamicTableWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { by, element, protractor } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class DynamicTableWidget { diff --git a/e2e/pages/adf/process-services/widgets/headerWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/headerWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/headerWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/headerWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/hyperlinkWidget.ts similarity index 95% rename from e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/hyperlinkWidget.ts index 74aa526e21e..ae2b2f25d5a 100644 --- a/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/hyperlinkWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { by, element } from 'protractor'; -import { BrowserActions } from '@alfresco/adf-testing'; +import { BrowserActions } from '../../../utils/public-api'; export class HyperlinkWidget { diff --git a/e2e/pages/adf/process-services/widgets/multilineTextWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/multilineTextWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/multilineTextWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/multilineTextWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/numberWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts similarity index 95% rename from e2e/pages/adf/process-services/widgets/numberWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts index 8a12f09a51f..a86ecaf5de8 100644 --- a/e2e/pages/adf/process-services/widgets/numberWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts @@ -17,7 +17,7 @@ import { element, by } from 'protractor'; import { FormFields } from '../formFields'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class NumberWidget { diff --git a/e2e/pages/adf/process-services/widgets/peopleWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/peopleWidget.ts similarity index 96% rename from e2e/pages/adf/process-services/widgets/peopleWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/peopleWidget.ts index 41eccf27c53..2468645e405 100644 --- a/e2e/pages/adf/process-services/widgets/peopleWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/peopleWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { by, element } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class PeopleWidget { diff --git a/lib/testing/src/lib/core/pages/form/widgets/public-api.ts b/lib/testing/src/lib/core/pages/form/widgets/public-api.ts new file mode 100644 index 00000000000..cf9c9ed215d --- /dev/null +++ b/lib/testing/src/lib/core/pages/form/widgets/public-api.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './widget'; diff --git a/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/radioButtonsWidget.ts similarity index 95% rename from e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/radioButtonsWidget.ts index 6e51c878563..a59545b5f0f 100644 --- a/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/radioButtonsWidget.ts @@ -17,7 +17,7 @@ import { FormFields } from '../formFields'; import { by, element } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; export class RadioButtonsWidget { diff --git a/e2e/pages/adf/process-services/widgets/textWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/textWidget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/textWidget.ts rename to lib/testing/src/lib/core/pages/form/widgets/textWidget.ts diff --git a/e2e/pages/adf/process-services/widgets/widget.ts b/lib/testing/src/lib/core/pages/form/widgets/widget.ts similarity index 100% rename from e2e/pages/adf/process-services/widgets/widget.ts rename to lib/testing/src/lib/core/pages/form/widgets/widget.ts diff --git a/lib/testing/src/lib/core/pages/public-api.ts b/lib/testing/src/lib/core/pages/public-api.ts index c66c2d6c8a1..660bf348ecf 100644 --- a/lib/testing/src/lib/core/pages/public-api.ts +++ b/lib/testing/src/lib/core/pages/public-api.ts @@ -25,3 +25,5 @@ export * from './data-table-component.page'; export * from './pagination.page'; export * from './error.page'; export * from './login.page'; + +export * from './form/public-api';