From 1e1abaaa7f9bf9605fed5a225d1c4d2380814e89 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Thu, 14 Mar 2024 19:17:48 +0000 Subject: [PATCH] [affected:*][ci:force] Fixing e2e - the lord of E2E --- .../start-task/start-task-group-cloud.e2e.ts | 2 +- .../form/checklist-component.e2e.ts | 2 +- .../widgets/checkbox-widget.e2e.ts | 14 +++++++------- .../pages/form/widgets/checkbox-widget.page.ts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts b/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts index 1363dd8575..974f839483 100644 --- a/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task/start-task-group-cloud.e2e.ts @@ -93,7 +93,7 @@ describe('Start Task - Group Cloud Component', () => { await startTask.checkFormIsDisplayed(); }); - it('[C291954] Should be able to select/delete an group for a standalone task', async () => { + fit('[C291954] Should be able to select/delete an group for a standalone task', async () => { await peopleCloudComponent.clearAssignee(); await groupCloud.searchGroups(testGroup.name); diff --git a/e2e/process-services/form/checklist-component.e2e.ts b/e2e/process-services/form/checklist-component.e2e.ts index d82d14fdcc..41725d8115 100644 --- a/e2e/process-services/form/checklist-component.e2e.ts +++ b/e2e/process-services/form/checklist-component.e2e.ts @@ -21,7 +21,7 @@ import { ProcessServicesPage } from '../pages/process-services.page'; import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { browser } from 'protractor'; -import CONSTANTS = require('../../util/constants'); +import * as CONSTANTS from '../../util/constants'; describe('Checklist component', () => { const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; diff --git a/e2e/process-services/widgets/checkbox-widget.e2e.ts b/e2e/process-services/widgets/checkbox-widget.e2e.ts index aeea1a8a2b..3ba4edcd36 100644 --- a/e2e/process-services/widgets/checkbox-widget.e2e.ts +++ b/e2e/process-services/widgets/checkbox-widget.e2e.ts @@ -18,7 +18,7 @@ import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; -import CONSTANTS = require('../../util/constants'); +import * as CONSTANTS from '../../util/constants'; import { ProcessServicesPage } from '../pages/process-services.page'; import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; @@ -65,6 +65,12 @@ describe('Checkbox Widget', () => { await usersActions.deleteTenant(processUserModel.tenantId); }); + it('[C272812] Should be able to set visibility settings for Checkbox widget', async () => { + await widget.checkboxWidget().isCheckboxHidden(app.FIELD.checkbox_field_id); + await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2'); + await widget.checkboxWidget().isCheckboxDisplayed(app.FIELD.checkbox_field_id); + }); + it('[C268554] Should be able to set general settings for Checkbox widget ', async () => { await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2'); expect(await widget.checkboxWidget().getCheckboxLabel()).toContain(app.FIELD.checkbox_label); @@ -72,10 +78,4 @@ describe('Checkbox Widget', () => { await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_input_id); expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true); }); - - it('[C272812] Should be able to set visibility settings for Checkbox widget', async () => { - await widget.checkboxWidget().isCheckboxHidden(app.FIELD.checkbox_field_id); - await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2'); - await widget.checkboxWidget().isCheckboxDisplayed(app.FIELD.checkbox_field_id); - }); }); diff --git a/lib/testing/src/lib/protractor/core/pages/form/widgets/checkbox-widget.page.ts b/lib/testing/src/lib/protractor/core/pages/form/widgets/checkbox-widget.page.ts index ac3d5c55ef..d636a2d6c6 100644 --- a/lib/testing/src/lib/protractor/core/pages/form/widgets/checkbox-widget.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/form/widgets/checkbox-widget.page.ts @@ -17,13 +17,13 @@ import { FormFields } from '../form-fields'; import { BrowserActions } from '../../../utils/public-api'; -import { $$, $ } from 'protractor'; +import { $ } from 'protractor'; import { materialLocators } from '../../public-api'; export class CheckboxWidgetPage { formFields = new FormFields(); - checkboxLabel = $(`span[class*="${materialLocators.Checkbox.label.root}"]`); + checkboxLabel = $(`${materialLocators.Checkbox.root} label`); checkboxLocator = materialLocators.Checkbox.root; getCheckboxLabel(): Promise { @@ -31,7 +31,7 @@ export class CheckboxWidgetPage { } async clickCheckboxInput(fieldId: string): Promise { - const checkboxInput = $$(`${this.checkboxLocator}[id="${fieldId}"] input`).first(); + const checkboxInput = $(`${this.checkboxLocator}[id="${fieldId}"] input`); await BrowserActions.click(checkboxInput); }