From 48fd873f2911d2c07d532e53fe8bd3ef55a91083 Mon Sep 17 00:00:00 2001 From: germanm Date: Thu, 12 Mar 2026 17:07:46 +0100 Subject: [PATCH 1/4] refactor(testing): add stable Playwright test hooks Expose framework-agnostic test ids in shared UI primitives and update common Playwright helpers to use them. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .../Fields/ShopperPhoneField.tsx | 3 ++- .../PaymentDetailsForm/Fields/AmountField.tsx | 10 ++++++++-- .../Fields/ValidityField.tsx | 11 +++++++++-- .../PayoutDetails/components/PayoutData.tsx | 18 +++++++++++++++--- .../TransactionsExport/TransactionsExport.tsx | 11 ++++++++--- .../external/UIElement/UIElement.tsx | 2 +- src/components/internal/Alert/Alert.tsx | 14 +++++++++++--- src/components/internal/Alert/types.ts | 1 + .../components/CalendarGrid/CalendarGrid.tsx | 2 +- .../CalendarGrid/CalendarGridDate.tsx | 1 + .../internal/DataGrid/DataGridCell.tsx | 1 + .../internal/DatePicker/DatePicker.tsx | 6 ++++-- .../internal/FilterBar/FilterBar.tsx | 2 +- .../FormFields/FieldError/FieldError.tsx | 5 +++-- .../FileInput/components/Dropzone.tsx | 2 +- .../internal/FormFields/InputBase.tsx | 4 +++- .../BalanceAccountSelector.tsx | 7 ++++++- src/components/internal/FormFields/types.ts | 1 + .../internal/FormWrappers/FormField.tsx | 5 +++-- .../internal/FormWrappers/FormSelect.tsx | 7 +++++-- .../internal/FormWrappers/FormTextInput.tsx | 10 +++++++++- .../internal/StructuredList/StructuredList.tsx | 2 +- .../transactionDetails.page.ts | 6 +++--- .../transactionsOverview.page.ts | 2 +- tests/models/internal-components/dataGrid.ts | 8 +++++--- tests/models/internal-components/filterBar.ts | 6 ++++-- tests/utils/datePicker.ts | 8 ++++---- tests/utils/utils.ts | 2 +- 28 files changed, 113 insertions(+), 44 deletions(-) diff --git a/src/components/external/PaymentLinkCreation/components/Form/CustomerDetailsForm/Fields/ShopperPhoneField.tsx b/src/components/external/PaymentLinkCreation/components/Form/CustomerDetailsForm/Fields/ShopperPhoneField.tsx index 0e47021a0..c6767ab35 100644 --- a/src/components/external/PaymentLinkCreation/components/Form/CustomerDetailsForm/Fields/ShopperPhoneField.tsx +++ b/src/components/external/PaymentLinkCreation/components/Form/CustomerDetailsForm/Fields/ShopperPhoneField.tsx @@ -95,7 +95,7 @@ export const ShopperPhoneField = () => { return ( name="telephoneNumber"> - + name="telephoneNumber" control={control} @@ -136,6 +136,7 @@ export const ShopperPhoneField = () => { isValid={!fieldState.error && !!field.value} isInvalid={isInvalid} errorMessage={fieldState.error?.message} + errorTestId="field-error-telephoneNumber" maxLength={PAYMENT_LINK_CREATION_FIELD_LENGTHS.telephoneNumber.max} readonly={isReadOnly} /> diff --git a/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/AmountField.tsx b/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/AmountField.tsx index 7e0660ef1..eaa3f7eac 100644 --- a/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/AmountField.tsx +++ b/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/AmountField.tsx @@ -61,7 +61,13 @@ export const AmountField = () => { return ( name={VALUE_FIELD_NAME}> - + name={VALUE_FIELD_NAME} control={control} @@ -88,7 +94,7 @@ export const AmountField = () => { maxValue={MAX_AMOUNT} readonly={{ amount: isAmountReadOnly, currency: isCurrencyReadOnly }} /> - {isInvalid && errorMessage && } + {isInvalid && errorMessage && } ); }} diff --git a/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/ValidityField.tsx b/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/ValidityField.tsx index 4d221134d..ed54c30d5 100644 --- a/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/ValidityField.tsx +++ b/src/components/external/PaymentLinkCreation/components/Form/PaymentDetailsForm/Fields/ValidityField.tsx @@ -175,6 +175,7 @@ export const ValidityField: FunctionalComponent = ({ configu label={i18n.get('payByLink.creation.fields.validity.label')} supportText={i18n.get('payByLink.creation.fields.validity.supportText')} optional={!isDurationUnitRequired && !isDurationQuantityRequired} + testId="form-field-linkValidity.durationUnit" >