diff --git a/cypress/elements/shared/addressForm.js b/cypress/elements/shared/addressForm.js index 5a8d7aa12..45ccab343 100644 --- a/cypress/elements/shared/addressForm.js +++ b/cypress/elements/shared/addressForm.js @@ -8,6 +8,6 @@ export const ADDRESS_SELECTORS = { city: '[name="city"]', postalCode: '[name="postalCode"]', country: '[data-test-id="address-edit-country-select-field"]', - countryArea: '[name="countryArea"]', - saveButton: '[data-test-id="order-address-edit-dialog-confirm-button"]' + countryArea: '[data-test-id="address-edit-country-area-field"]', + saveButton: '[data-test-id="order-address-edit-dialog-confirm-button"]', }; diff --git a/cypress/fixtures/addresses.json b/cypress/fixtures/addresses.json index 932143592..64dc62784 100644 --- a/cypress/fixtures/addresses.json +++ b/cypress/fixtures/addresses.json @@ -23,6 +23,7 @@ "postalCode": "70957", "country": "US", "countryArea": "LA", + "countryAreaFullName": "Louisiana", "phone": "+12025550189", "currency": "USD", "countryFullName": "United States of America" @@ -37,6 +38,7 @@ "postalCode": "37745", "country": "US", "countryArea": "TN", + "countryAreaFullName": "Tennessee", "phone": "+12025550169", "currency": "USD", "countryFullName": "United States of America" diff --git a/cypress/support/customCommands/sharedElementsOperations/addressForm.js b/cypress/support/customCommands/sharedElementsOperations/addressForm.js index 8410f7b8f..cf2eb344e 100644 --- a/cypress/support/customCommands/sharedElementsOperations/addressForm.js +++ b/cypress/support/customCommands/sharedElementsOperations/addressForm.js @@ -14,8 +14,11 @@ Cypress.Commands.add("fillUpBasicAddress", address => { .clearAndType(address.city) .get(ADDRESS_SELECTORS.postalCode) .clearAndType(address.postalCode) - .fillAutocompleteSelect(ADDRESS_SELECTORS.country, address.countryFullName); - cy.get(ADDRESS_SELECTORS.countryArea).clearAndType(address.countryArea); + .fillAutocompleteSelect(ADDRESS_SELECTORS.country, address.countryFullName) + .fillAutocompleteSelect( + ADDRESS_SELECTORS.countryArea, + address.countryAreaFullName, + ); }); Cypress.Commands.add("fillUpAddressForm", address => {