From f5a8db9f2e7627f219d36f6f16fc72307f519626 Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Fri, 11 Feb 2022 12:28:55 +0100 Subject: [PATCH] Update data test ids for 3.1 (#1814) * add update data test ids * fix not changed test ids * fix data-test-id for gift cards * remove comment * fix base url --- .../account/left-menu/left-menu-selectors.js | 2 +- cypress/elements/account/login-selectors.js | 10 +- cypress/elements/account/setPassword.js | 4 +- cypress/elements/apps/appDetails.js | 6 +- cypress/elements/apps/appsList.js | 2 +- .../elements/attribute/attributes_details.js | 42 +- cypress/elements/attribute/attributes_list.js | 2 +- .../catalog/categories/categories-list.js | 2 +- .../catalog/categories/category-details.js | 12 +- .../elements/catalog/collection-selectors.js | 2 +- .../catalog/giftCard/giftCardDialog.js | 6 +- .../catalog/products/product-details.js | 32 +- .../catalog/products/products-list.js | 53 +- .../catalog/products/variants-selectors.js | 4 +- .../channels/add-channel-form-selectors.js | 10 +- .../channels/available-channels-form.js | 4 +- .../channels/channel-form-selectors.js | 4 +- .../elements/channels/channels-selectors.js | 4 +- .../configuration/configuration-selectors.js | 25 +- cypress/elements/customer/customer-details.js | 2 +- cypress/elements/customer/customers-list.js | 2 +- .../elements/homePage/homePage-selectors.js | 2 +- cypress/elements/navigation/menu-details.js | 5 +- cypress/elements/navigation/menu-list.js | 2 +- cypress/elements/orders/order-refund.js | 2 +- cypress/elements/orders/orders-selectors.js | 12 +- cypress/elements/pageTypes/pageTypeDetails.js | 2 +- cypress/elements/pageTypes/pageTypesList.js | 2 +- cypress/elements/pages/page-details.js | 7 +- cypress/elements/pages/pages-list.js | 2 +- .../permissionGroup/permissionGroupDetails.js | 4 +- .../permissionGroup/permissionGroupsList.js | 4 +- .../productTypes/productTypeDetails.js | 4 +- .../elements/productTypes/productTypesList.js | 2 +- .../shared/assign-elements-selectors.js | 2 +- cypress/elements/shared/button-selectors.js | 4 +- .../elements/shared/metadata/metadata-form.js | 7 +- cypress/elements/shared/sharedElements.js | 12 +- .../shipping/select-shipping-method-form.js | 2 +- .../shipping/shipping-rate-details.js | 2 +- .../shipping/shipping-zone-details.js | 2 +- .../elements/shipping/shipping-zones-list.js | 2 +- .../staffMembers/staffMemberDetails.js | 2 +- .../elements/staffMembers/staffMembersList.js | 2 +- .../translations/element-translation.js | 2 +- .../elements/warehouses/warehouses-list.js | 2 +- cypress/fixtures/permissions.js | 4 +- cypress/integration/login.js | 1 + .../createAndEditVariantsInPreorder.js | 7 +- .../products/productsList/pagination.js | 5 +- cypress/support/pages/shippingMethodPage.js | 3 + .../CustomAppTokens/CustomAppTokens.tsx | 2 +- src/apps/components/CustomApps/CustomApps.tsx | 2 +- .../TokenCreateDialog/TokenCreateDialog.tsx | 4 +- .../AttributeDetails/NumericUnits.tsx | 2 +- .../AttributeList/AttributeList.tsx | 13 +- .../AttributeListPage/AttributeListPage.tsx | 2 +- .../AttributeSwatchField.tsx | 2 +- .../AttributeValueEditDialog.tsx | 4 +- .../AttributeValues/AttributeValues.tsx | 2 +- src/auth/components/LoginPage/LoginPage.tsx | 11 +- .../NewPasswordPage/NewPasswordPage.tsx | 4 +- .../ResetPasswordPage/ResetPasswordPage.tsx | 4 +- .../components/CategoryList/CategoryList.tsx | 5 +- .../CategoryListPage/CategoryListPage.tsx | 6 +- .../CategoryProductList.tsx | 2 +- .../CategoryProducts/CategoryProducts.tsx | 4 +- .../CategoryUpdatePage/CategoryUpdatePage.tsx | 4 +- .../components/ChannelForm/ChannelForm.tsx | 6 +- src/channels/components/ChannelForm/types.ts | 2 +- .../ShippingZonesCardListFooter.tsx | 2 +- .../ChannelsListPage/ChannelsListPage.tsx | 4 +- .../CollectionList/CollectionList.tsx | 7 +- .../AccountPermissionGroups.tsx | 2 +- .../AccountPermissions/AccountPermissions.tsx | 2 +- src/components/ActionDialog/DialogButtons.tsx | 1 - src/components/AppLayout/menuStructure.ts | 2 +- .../AssignProductDialog.tsx | 2 +- .../AssignVariantDialog.tsx | 2 +- src/components/Attributes/Attributes.tsx | 2 +- .../Attributes/BasicAttributeRow.tsx | 4 +- .../Attributes/ExtendedAttributeRow.tsx | 8 +- .../AutocompleteSelectMenu.tsx | 2 +- src/components/BackButton.tsx | 2 +- src/components/CardMenu/CardMenu.tsx | 3 +- .../ChannelAvailabilityItemWrapper.tsx | 5 +- .../ChannelsAvailabilityCardWrapper.tsx | 2 +- src/components/DeleteButton/DeleteButton.tsx | 2 +- .../FileUploadField/FileUploadField.tsx | 6 +- .../Filter/FilterAutocompleteField.tsx | 18 +- .../Filter/FilterContent/FilterContent.tsx | 3 +- .../FilterContent/FilterContentBody.tsx | 13 +- .../FilterContentBodyNameField.tsx | 3 +- .../FilterContent/FilterContentHeader.tsx | 4 +- .../FilterContent/FilterDateTimeField.tsx | 12 +- .../Filter/FilterContent/FilterGroupLabel.tsx | 3 +- .../FilterContent/FilterNumericField.tsx | 6 +- .../Filter/FilterContent/FilterRangeField.tsx | 6 +- .../FilterContent/FilterSingleSelectField.tsx | 2 +- .../Filter/FilterContent/FilterTextField.tsx | 3 +- src/components/Filter/FilterContent/utils.ts | 2 +- src/components/Filter/FilterOptionField.tsx | 6 +- src/components/Form/ExitFormDialog.tsx | 7 +- src/components/LinkChoice/LinkChoice.tsx | 2 +- src/components/MediaTile/MediaTile.tsx | 2 +- src/components/Metadata/Metadata.test.tsx | 10 +- src/components/Metadata/MetadataCard.tsx | 11 +- .../MultiAutocompleteSelectField.tsx | 2 +- .../MultiAutocompleteSelectFieldContent.tsx | 2 +- .../NavigatorButton/NavigatorButton.tsx | 2 +- .../RichTextEditor/RichTextEditor.tsx | 3 +- .../RowNumberSelect/RowNumberSelect.tsx | 4 +- src/components/SearchBar/SearchInput.tsx | 2 +- .../SingleAutocompleteSelectFieldContent.tsx | 12 +- .../SingleSelectField/SingleSelectField.tsx | 5 +- src/components/SortableChip/SortableChip.tsx | 6 +- .../TableCellAvatar/TableCellAvatar.tsx | 2 +- .../TablePaginationActions.tsx | 4 +- src/components/UserChip/UserChip.tsx | 6 +- src/configuration/ConfigurationPage.tsx | 8 +- src/configuration/index.tsx | 22 +- .../CustomerAddresses/CustomerAddresses.tsx | 2 +- .../CustomerListPage/CustomerListPage.tsx | 6 +- .../GiftCardExpirySettingsCard.tsx | 2 +- .../GiftCardsListHeader.tsx | 2 +- .../GiftCardSettingsExpirySelect.tsx | 2 +- src/home/components/HomeHeader/HomeHeader.tsx | 4 +- .../MenuCreateDialog/MenuCreateDialog.tsx | 2 +- .../MenuItemDialog/MenuItemDialog.tsx | 2 +- .../components/MenuItems/MenuItems.tsx | 2 +- .../components/MenuListPage/MenuListPage.tsx | 2 +- .../OrderCustomerAddressEdit.tsx | 10 +- .../OrderCustomerAddressesEditDialog.tsx | 8 +- .../OrderDetailsPage/OrderDetailsPage.tsx | 2 +- .../OrderDiscountCommonModal.tsx | 2 +- .../OrderFulfilledProductsCard.tsx | 2 +- .../OrderFulfillmentApproveDialog.tsx | 2 +- .../OrderFulfillmentCancelDialog.tsx | 4 +- .../OrderFulfillmentSettings.tsx | 6 +- .../OrderProductAddDialog.tsx | 2 +- .../OrderRefundFulfilledProducts.tsx | 8 +- .../OrderRefundReturnAmount.tsx | 2 +- .../RefundAmountInput.tsx | 2 +- .../OrderRefundUnfulfilledProducts.tsx | 5 +- .../MaximalButton.tsx | 2 +- .../OrderSettings/OrderSettings.tsx | 6 +- .../PageTypeAttributes/PageTypeAttributes.tsx | 11 +- .../components/PageTypeList/PageTypeList.tsx | 5 +- .../PageTypeListPage/PageTypeListPage.tsx | 6 +- .../components/PageListPage/PageListPage.tsx | 2 +- .../PageOrganizeContent.tsx | 2 +- .../AssignMembersDialog.tsx | 4 +- .../PermissionGroupList.tsx | 7 +- .../PermissionGroupListPage.tsx | 2 +- .../PermissionGroupMemberList.tsx | 2 +- .../ProductTypeAttributes.tsx | 9 +- .../ProductTypeDetailsPage.tsx | 4 +- .../ProductTypeList/ProductTypeList.tsx | 5 +- .../ProductTypeListPage.tsx | 6 +- .../ProductTypeVariantAttributes.tsx | 9 +- .../ProductExportDialog.tsx | 8 +- .../ProductExportDialogInfo.tsx | 12 +- .../components/ProductList/ProductList.tsx | 28 +- .../ProductListPage/ProductListPage.tsx | 4 +- .../components/ProductMedia/ProductMedia.tsx | 2 +- .../ProductMediaPopper/ProductMediaPopper.tsx | 4 +- .../ProductOrganization.tsx | 6 +- .../components/ProductTaxes/ProductTaxes.tsx | 6 +- .../ProductUpdatePage.test.tsx | 4 +- .../ProductUpdatePage/ProductUpdatePage.tsx | 2 +- .../ProductVariantAttributes.tsx | 2 +- .../ProductVariantCreateDialog.tsx | 1 - .../ProductVariantSetDefault.tsx | 2 +- .../ProductVariants/ProductVariants.tsx | 17 +- .../ShippingWeightUnitForm.tsx | 2 +- .../ShippingZoneInfo/ShippingZoneInfo.tsx | 2 +- .../ShippingZonePostalCodeRangeDialog.tsx | 2 +- .../ShippingZonePostalCodes.tsx | 5 +- .../StaffAddMemberDialog.tsx | 2 +- .../StaffListPage/StaffListPage.tsx | 2 +- .../__snapshots__/Stories.test.ts.snap | 5943 ++++++++--------- .../WarehouseInfo/WarehouseInfo.tsx | 2 +- .../WarehouseList/WarehouseList.tsx | 16 +- .../WarehouseListPage/WarehouseListPage.tsx | 2 +- .../components/WebhooksList/WebhooksList.tsx | 2 +- 185 files changed, 3293 insertions(+), 3623 deletions(-) diff --git a/cypress/elements/account/left-menu/left-menu-selectors.js b/cypress/elements/account/left-menu/left-menu-selectors.js index fd19aabfe..a6aa78a56 100644 --- a/cypress/elements/account/left-menu/left-menu-selectors.js +++ b/cypress/elements/account/left-menu/left-menu-selectors.js @@ -15,7 +15,7 @@ export const DISCOUNTS_MENU_SELECTORS = { }; export const ORDERS = { orders: "[data-test='submenu-item-label'][data-test-id='orders']", - draftOrders: "[data-test='submenu-item-label'][data-test-id='order drafts']" + draftOrders: "[data-test='submenu-item-label'][data-test-id='order-drafts']" }; export const CATALOG = { products: "[data-test='submenu-item-label'][data-test-id='products']", diff --git a/cypress/elements/account/login-selectors.js b/cypress/elements/account/login-selectors.js index d14245082..6e351eb5c 100644 --- a/cypress/elements/account/login-selectors.js +++ b/cypress/elements/account/login-selectors.js @@ -1,12 +1,12 @@ export const LOGIN_SELECTORS = { - accountSettings: "[data-test=accountSettingsButton]", + accountSettings: "[data-test-id=account-settings-button]", emailAddressInput: "input[name='email']", emailPasswordInput: "input[name='password']", - signInButton: "[data-test=submit]", + signInButton: "[data-test-id=submit]", userMenu: "[data-test=userMenu]", - warningCredentialMessage: "[data-test=loginErrorMessage]", - welcomePage: "[data-test=welcomeHeader]", - logOutButton: "[data-test='logOutButton']", + warningCredentialMessage: "[data-test-id=login-error-message]", + welcomePage: "[data-test-id=welcome-header]", + logOutButton: "[data-test-id='log-out-button']", resetPasswordLink: "[data-test-id='reset-password-link']", confirmPassword: "[name='confirmPassword']" }; diff --git a/cypress/elements/account/setPassword.js b/cypress/elements/account/setPassword.js index cc8bc9905..b3643a289 100644 --- a/cypress/elements/account/setPassword.js +++ b/cypress/elements/account/setPassword.js @@ -1,4 +1,4 @@ export const SET_PASSWORD = { - passwordInput: '[data-test="password"]', - confirmPasswordInput: '[data-test="confirm-password"]' + passwordInput: '[data-test-id="password"]', + confirmPasswordInput: '[data-test-id="confirm-password"]' }; diff --git a/cypress/elements/apps/appDetails.js b/cypress/elements/apps/appDetails.js index d54642cd9..8cdefc9c5 100644 --- a/cypress/elements/apps/appDetails.js +++ b/cypress/elements/apps/appDetails.js @@ -1,12 +1,12 @@ export const APP_DETAILS = { nameInput: '[name="name"]', manageAppsPermissionCheckbox: '[id="MANAGE_APPS"]', - createWebhookButton: '[data-test-id = "createWebhook"]', - createTokenButton: '[data-test-id="createToken"]', + createWebhookButton: '[data-test-id = "create-webhook"]', + createTokenButton: '[data-test-id="create-token"]', createTokenForm: { tokenDialog: '[role="dialog"]', nameInput: '[name="name"]', - tokenToCopy: '[data-test-id="generatedToken"]', + tokenToCopy: '[data-test-id="generated-token"]', doneButton: '[data-test-id="done"]' } }; diff --git a/cypress/elements/apps/appsList.js b/cypress/elements/apps/appsList.js index 96b3e7b28..d026f1b9d 100644 --- a/cypress/elements/apps/appsList.js +++ b/cypress/elements/apps/appsList.js @@ -1,3 +1,3 @@ export const APPS_LIST = { - createLocalAppButton: '[data-test-id="createApp"]' + createLocalAppButton: '[data-test-id="create-app"]' }; diff --git a/cypress/elements/attribute/attributes_details.js b/cypress/elements/attribute/attributes_details.js index 8b196aa73..601b59faf 100644 --- a/cypress/elements/attribute/attributes_details.js +++ b/cypress/elements/attribute/attributes_details.js @@ -2,47 +2,47 @@ export const ATTRIBUTES_DETAILS = { nameInput: '[name="name"]', codeInput: '[name="slug"]', inputTypeSelect: '[id="mui-component-select-inputType"]', - assignValuesButton: '[data-test-id="assignValueButton"]', + assignValuesButton: '[data-test-id="assign-value-button"]', valueRequired: '[name="valueRequired"]', - valueNameInput: '[data-test-id="valueName"]', + valueNameInput: '[data-test-id="value-name"]', dashboardProperties: { useInFilteringCheckbox: '[name="filterableInDashboard"]' }, attributesInputTypes: { - DROPDOWN: '[data-test-id="DROPDOWN"]', - DATE: '[data-test-id="DATE"]', - DATE_TIME: '[data-test-id="DATE_TIME"]', - MULTISELECT: '[data-test-id="MULTISELECT"]', - FILE: '[data-test-id="FILE"]', - REFERENCE: '[data-test-id="REFERENCE"]', - RICH_TEXT: '[data-test-id="RICH_TEXT"]', - NUMERIC: '[data-test-id="NUMERIC"]', - BOOLEAN: '[data-test-id="BOOLEAN"]', - SWATCH: '[data-test-id="SWATCH"]' + DROPDOWN: '[data-test-id="select-field-option-DROPDOWN"]', + DATE: '[data-test-id="select-field-option-DATE"]', + DATE_TIME: '[data-test-id="select-field-option-DATE_TIME"]', + MULTISELECT: '[data-test-id="select-field-option-MULTISELECT"]', + FILE: '[data-test-id="select-field-option-FILE"]', + REFERENCE: '[data-test-id="select-field-option-REFERENCE"]', + RICH_TEXT: '[data-test-id="select-field-option-RICH_TEXT"]', + NUMERIC: '[data-test-id="select-field-option-NUMERIC"]', + BOOLEAN: '[data-test-id="select-field-option-BOOLEAN"]', + SWATCH: '[data-test-id="select-field-option-SWATCH"]' }, entityTypeSelect: '[id="mui-component-select-entityType"]', entityTypeOptions: { - PRODUCT: '[data-test-id="PRODUCT"]', - PAGE: '[data-test-id="PAGE"]' + PRODUCT: '[data-test-id*="PRODUCT"]', + PAGE: '[data-test-id*="PAGE"]' }, selectUnitCheckbox: '[name="selectUnit"]', unitSystemSelect: '[data-test-id="unit-system"]', unitSystemsOptions: { - IMPERIAL: '[data-test-id="imperial"]', - METRIC: '[data-test-id="metric"]' + IMPERIAL: '[data-test-id="select-field-option-imperial"]', + METRIC: '[data-test-id="select-field-option-metric"]' }, unitOfSelect: '[data-test-id="unit-of"]', unitsOfOptions: { - VOLUME: '[data-test-id="volume"]', - DISTANCE: '[data-test-id="distance"]' + VOLUME: '[data-test-id="select-field-option-volume"]', + DISTANCE: '[data-test-id="select-field-option-distance"]' }, unitSelect: '[data-test-id="unit"]', unitsOptions: { - CUBIC_CENTIMETER: '[data-test-id="CUBIC_CENTIMETER"]', - FT: '[data-test-id="FT"]' + CUBIC_CENTIMETER: '[data-test-id="select-field-option-CUBIC_CENTIMETER"]', + FT: '[data-test-id="select-field-option-FT"]' }, imageCheckbox: '[value= "image"]', - uploadFileButton: '[data-test="button-upload-file"]', + uploadFileButton: '[data-test-id="button-upload-file"]', pageTypeAttributeCheckbox: '[value="PAGE_TYPE"]', swatchValueImage: '[data-test-id="swatch-image"]' }; diff --git a/cypress/elements/attribute/attributes_list.js b/cypress/elements/attribute/attributes_list.js index c6c0e559a..8c905b611 100644 --- a/cypress/elements/attribute/attributes_list.js +++ b/cypress/elements/attribute/attributes_list.js @@ -1,3 +1,3 @@ export const ATTRIBUTES_LIST = { - createAttributeButton: '[data-test-id="createAttributeButton"]' + createAttributeButton: '[data-test-id="create-attribute-button"]' }; diff --git a/cypress/elements/catalog/categories/categories-list.js b/cypress/elements/catalog/categories/categories-list.js index d67101909..d455b3e73 100644 --- a/cypress/elements/catalog/categories/categories-list.js +++ b/cypress/elements/catalog/categories/categories-list.js @@ -1,5 +1,5 @@ export const CATEGORIES_LIST = { - addCategoryButton: '[data-test-id="createCategory"]' + addCategoryButton: '[data-test-id="create-category"]' }; export const categoryRow = categoryId => `[data-test-id="${categoryId}"]`; diff --git a/cypress/elements/catalog/categories/category-details.js b/cypress/elements/catalog/categories/category-details.js index 035ff5f04..b571eef02 100644 --- a/cypress/elements/catalog/categories/category-details.js +++ b/cypress/elements/catalog/categories/category-details.js @@ -1,9 +1,9 @@ export const CATEGORY_DETAILS = { nameInput: '[name="name"]', - descriptionInput: '[data-test-id="description"]', - createSubcategoryButton: '[data-test-id="createSubcategory"]', - categoryChildrenRow: '[data-test="id"]', - productsTab: '[data-test-id="productsTab"]', - addProducts: '[data-test-id="addProducts"]', - productRow: '[data-test-id="productRow"]' + descriptionInput: '[data-test-id="rich-text-editor-description"]', + createSubcategoryButton: '[data-test-id="create-subcategory"]', + categoryChildrenRow: '[data-test-id*="id"]', + productsTab: '[data-test-id="products-tab"]', + addProducts: '[data-test-id="add-products"]', + productRow: '[data-test-id="product-row"]' }; diff --git a/cypress/elements/catalog/collection-selectors.js b/cypress/elements/catalog/collection-selectors.js index 8fea92099..e6bf3ec38 100644 --- a/cypress/elements/catalog/collection-selectors.js +++ b/cypress/elements/catalog/collection-selectors.js @@ -3,5 +3,5 @@ export const COLLECTION_SELECTORS = { nameInput: "[name='name']", saveButton: "[data-test='button-bar-confirm']", addProductButton: "[data-test-id='add-product']", - descriptionInput: '[data-test-id="description"]' + descriptionInput: '[data-test-id="rich-text-editor-description"]' }; diff --git a/cypress/elements/catalog/giftCard/giftCardDialog.js b/cypress/elements/catalog/giftCard/giftCardDialog.js index 620bda951..d7fc90cfe 100644 --- a/cypress/elements/catalog/giftCard/giftCardDialog.js +++ b/cypress/elements/catalog/giftCard/giftCardDialog.js @@ -1,7 +1,7 @@ export const GIFT_CARD_DIALOG = { amountInput: '[name="balanceAmount"]', currencySelectButton: '[id="mui-component-select-balanceCurrency"]', - currenciesOptions: '[data-test="selectFieldOption"]', + currenciesOptions: '[data-test-id*="select-field-option"]', expirationOptions: { setExpiryDateCheckbox: '[name="expirySelected"]', neverExpireRadioButton: '[value="NEVER_EXPIRE"]', @@ -9,10 +9,10 @@ export const GIFT_CARD_DIALOG = { expiryDateRadioButton: '[value="EXPIRY_DATE"]', expiryPeriodAmount: '[name="expiryPeriodAmount"]', expiryPeriodTypeButton: '[id*="select-expiryPeriodType"]', - expiryPeriodMonthType: '[data-test-id="MONTH"]', + expiryPeriodMonthType: '[data-test-id="select-field-option-MONTH"]', expiryDateInput: '[name="expiryDate"]' }, noteInput: '[name="note"]', - cardCodeText: '[data-test-id="cardCode"]', + cardCodeText: '[data-test-id="card-code"]', tagInput: '[data-test-id="gift-card-tag-select-field"]' }; diff --git a/cypress/elements/catalog/products/product-details.js b/cypress/elements/catalog/products/product-details.js index 22fce64f3..cbe0ff7e9 100644 --- a/cypress/elements/catalog/products/product-details.js +++ b/cypress/elements/catalog/products/product-details.js @@ -1,33 +1,33 @@ export const PRODUCT_DETAILS = { productNameInput: "[name='name']", - productTypeInput: "[data-test='product-type']", - categoryInput: "[data-test='category']", - categoryItem: "[data-test-id='singleautocomplete-select-option']", - collectionInput: "[data-test='collections']", - autocompleteDropdown: "[data-test='autocomplete-dropdown']", + productTypeInput: "[data-test-id='product-type']", + categoryInput: "[data-test-id='category']", + categoryItem: "[data-test-id='single-autocomplete-select-option']", + collectionInput: "[data-test-id='collections']", + autocompleteDropdown: "[data-test-id='autocomplete-dropdown']", firstCategoryItem: "#downshift-0-item-0", visibleRadioBtn: "[name='isPublished']", - channelAvailabilityItem: "[data-test='channel-availability-item']", - addVariantsButton: "[data-test*='button-add-variant']", + channelAvailabilityItem: "[data-test-id*='channel-availability-item']", + addVariantsButton: "[data-test-id*='button-add-variant']", addVariantsOptionDialog: { optionMultiple: '[data-test-id="variant-create-option-multiple"]', optionSingle: '[data-test-id="variant-create-option-single"]' }, - descriptionInput: "[data-test-id='description']", + descriptionInput: "[data-test-id='rich-text-editor-description']", ratingInput: "[name='rating']", skuInput: "[name='sku']", variantRow: "[data-test-id='product-variant-row']", - variantPrice: '[data-test="price"]', - collectionRemoveButtons: '[data-test-id="collectionRemove"]', - productImage: '[data-test="product-image"]', - uploadImageButton: '[data-test="button-upload-image"]', - uploadSavedImagesButton: '[data-test="uploadImages"]', - uploadMediaUrlButton: '[data-test="uploadMediaUrl"]', - saveUploadUrlButton: '[data-test-id="upload-url-button"]', + variantPrice: '[data-test-id="price"]', + collectionRemoveButtons: '[data-test-id="collection-remove"]', addWarehouseButton: '[data-test-id="add-warehouse"]', warehouseOption: "[role='menuitem']", stockInput: '[data-test-id="stock-input"]', costPriceInput: '[name*="costPrice"]', sellingPriceInput: '[name*="channel-price"]', - createSingleVariantCheckbox: '[value="single"]' + createSingleVariantCheckbox: '[value="single"]', + productImage: '[data-test-id="product-image"]', + uploadImageButton: '[data-test-id="button-upload-image"]', + uploadSavedImagesButton: '[data-test-id="upload-images"]', + uploadMediaUrlButton: '[data-test-id="upload-media-url"]', + saveUploadUrlButton: '[data-test-id="upload-url-button"]' }; diff --git a/cypress/elements/catalog/products/products-list.js b/cypress/elements/catalog/products/products-list.js index adb071ba3..cface40d4 100644 --- a/cypress/elements/catalog/products/products-list.js +++ b/cypress/elements/catalog/products/products-list.js @@ -1,44 +1,43 @@ export const PRODUCTS_LIST = { - productsList: "[data-test-id][data-test='id']", - productsNames: "[data-test='name']", - createProductBtn: "[data-test='add-product']", + productsList: "[data-test-id*='id']", + productsNames: "[data-test-id='name']", + createProductBtn: "[data-test-id='add-product']", searchProducts: "[placeholder='Search Products...']", emptyProductRow: "[data-test-id='skeleton']", productImage: "[class='MuiAvatar-img']", - tableCellAvatar: "[data-test-id='tableCellAvatar']", + tableCellAvatar: "[data-test-id='table-cell-avatar']", productRowElements: { - name: '[data-test="name"]', - type: '[data-test="product-type"]', - availability: '[data-test="availability"]', - price: '[data-test="price"]' + name: '[data-test-id="name"]', + type: '[data-test-id="product-type"]', + availability: '[data-test-id="availability"]', + price: '[data-test-id="price"]' }, tableHeaders: { - name: "[data-test-id='colNameHeader']", - type: "[data-test-id='colTypeHeader']", - availability: "[data-test-id='colAvailabilityHeader']", - price: "[data-test-id='colPriceHeader']" + name: "[data-test-id='col-name-header']", + type: "[data-test-id='col-type-header']", + availability: "[data-test-id='col-availability-header']", + price: "[data-test-id='col-price-header']" }, showFiltersButton: '[data-test-id="show-filters-button"]', filters: { - filterOption: '[data-test-id="filterOption"]', - productsOutOfStockOption: '[data-test-id="OUT_OF_STOCK"]', + filterOption: '[data-test-id="filter-option"]', + productsOutOfStockOption: '[data-test-id="filter-option-OUT_OF_STOCK"]', filterBy: { - category: '[data-test="filterGroupActive"][data-test-id="categories"]', - collection: '[data-test="filterGroupActive"][data-test-id="collections"]', - productType: - '[data-test="filterGroupActive"][data-test-id="productType"]', - stock: '[data-test="filterGroupActive"][data-test-id="stock"]', - channel: '[data-test="filterGroupActive"][data-test-id="channel"]' + category: '[data-test-id="filter-group-active-categories"]', + collection: '[data-test-id="filter-group-active-collections"]', + productType: '[data-test-id="filter-group-active-productType"]', + stock: '[data-test-id="filter-group-active-stock"]', + channel: '[data-test-id="filter-group-active-channel"]' }, filterField: { - filterField: '[data-test="filter-field"]', - category: '[data-test="filter-field"][data-test-id="categories"]', - collection: '[data-test="filter-field"][data-test-id="collections"]', - productType: '[data-test="filter-field"][data-test-id="productType"]', - stock: '[data-test="filter-field"][data-test-id="stock"]', - channel: '[data-test="filter-field"][data-test-id="channel"]' + filterField: '[data-test-id*="filter-field"]', + category: '[data-test-id="filter-field-categories"]', + collection: '[data-test-id="filter-field-collections"]', + productType: '[data-test-id="filter-field-productType"]', + stock: '[data-test-id="filter-field-stock"]', + channel: '[data-test-id="filter-field-channel"]' }, - filterBySearchInput: '[data-test*="filterField"][data-test*="Input"]' + filterBySearchInput: '[data-test-id="filter-field-autocomplete-input"]' }, nextPageButton: "[data-test='button-pagination-next']", previousPagePagination: "[data-test='button-pagination-back']", diff --git a/cypress/elements/catalog/products/variants-selectors.js b/cypress/elements/catalog/products/variants-selectors.js index 498051164..e490fd803 100644 --- a/cypress/elements/catalog/products/variants-selectors.js +++ b/cypress/elements/catalog/products/variants-selectors.js @@ -4,9 +4,9 @@ export const VARIANTS_SELECTORS = { nextButton: "[class*='MuiButton-containedPrimary']", warehouseCheckboxes: "[name*='warehouse:']", skuInput: "[ name='sku']", - attributeSelector: "[data-test='attribute-value']", attributeOption: - "[data-test-type='option'], [data-test='multiautocomplete-select-option']", + "[data-test-type='option'], [data-test-id='multi-autocomplete-select-option']", + attributeSelector: "[data-test-id='attribute-value']", addWarehouseButton: "[data-test-id='add-warehouse']", warehouseOption: "[role='menuitem']", saveButton: "[data-test='button-bar-confirm']", diff --git a/cypress/elements/channels/add-channel-form-selectors.js b/cypress/elements/channels/add-channel-form-selectors.js index 8fd6bbb8a..a37ce37c1 100644 --- a/cypress/elements/channels/add-channel-form-selectors.js +++ b/cypress/elements/channels/add-channel-form-selectors.js @@ -2,14 +2,14 @@ export const ADD_CHANNEL_FORM_SELECTORS = { channelName: "[name='name']", slug: "[name='slug']", currency: "[data-test-id='channel-currency-select-input']", - currencyOptions: "[data-test-id='singleautocomplete-select-option']", + currencyOptions: "[data-test-id='single-autocomplete-select-option']", saveButton: "[data-test='button-bar-confirm']", backToChannelsList: "[data-test-id='app-header-back-button']", - currencyValidationMessage: "[data-testid='currency-text-input-helper-text']", - slugValidationMessage: "[data-testid='slug-text-input-helper-text']", + currencyValidationMessage: "[data-test-id='currency-text-input-helper-text']", + slugValidationMessage: "[data-test-id='slug-text-input-helper-text']", currencyAutocompleteDropdown: - "[data-test-id='singleautocomplete-select-option'][data-test-type='custom']", + "[data-test-id='single-autocomplete-select-option'][data-test-type='custom']", addShippingZoneButton: '[data-test-id="add-shipping-zone-button"]', - shippingAutocompleteSelect: "[data-test-id='shippingAutoCompleteSelect']", + shippingAutocompleteSelect: "[data-test-id='shipping-auto-complete-select']", countryAutocompleteInput: '[data-test-id="country-select-input"]' }; diff --git a/cypress/elements/channels/available-channels-form.js b/cypress/elements/channels/available-channels-form.js index 7a14ed705..f6a2798aa 100644 --- a/cypress/elements/channels/available-channels-form.js +++ b/cypress/elements/channels/available-channels-form.js @@ -1,10 +1,10 @@ export const AVAILABLE_CHANNELS_FORM = { - menageChannelsButton: "[data-test-id='channels-availiability-manage-button']", + menageChannelsButton: "[data-test-id='channels-availability-manage-button']", assignedChannels: "[data-test-id='expand-icon']", publishedRadioButtons: "[name*='isPublished']", availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']", radioButtonsValueTrue: "[value='true']", radioButtonsValueFalse: "[value='false']", visibleInListingsButton: "[name*='visibleInListings']", - availableChannel: "[data-test='channel-availability-item']" + availableChannel: "[data-test-id*='channel-availability-item']" }; diff --git a/cypress/elements/channels/channel-form-selectors.js b/cypress/elements/channels/channel-form-selectors.js index 0eb04fc0c..8e61be37d 100644 --- a/cypress/elements/channels/channel-form-selectors.js +++ b/cypress/elements/channels/channel-form-selectors.js @@ -1,5 +1,5 @@ export const CHANNEL_FORM_SELECTORS = { channelSelect: "[id='mui-component-select-channels']", - channelOption: "[data-test='selectFieldOption']", - confirmButton: "[data-test='submit']" + channelOption: "[data-test-id*='select-field-option']", + confirmButton: "[data-test-id='submit']" }; diff --git a/cypress/elements/channels/channels-selectors.js b/cypress/elements/channels/channels-selectors.js index 0f2509d1e..a055a125d 100644 --- a/cypress/elements/channels/channels-selectors.js +++ b/cypress/elements/channels/channels-selectors.js @@ -1,5 +1,5 @@ export const CHANNELS_SELECTORS = { - createChannelButton: "[data-test='add-channel']", + createChannelButton: "[data-test-id='add-channel']", channelsTable: "[class='MuiTableBody-root']", - channelName: "[data-test='name']" + channelName: "[data-test-id='name']" }; diff --git a/cypress/elements/configuration/configuration-selectors.js b/cypress/elements/configuration/configuration-selectors.js index 8cb5ddbca..f3e9adbcd 100644 --- a/cypress/elements/configuration/configuration-selectors.js +++ b/cypress/elements/configuration/configuration-selectors.js @@ -1,15 +1,14 @@ export const CONFIGURATION_SELECTORS = { - channels: "[data-testid='channels']", - shipping: '[data-testid="shipping methods"]', - taxes: '[data-test-id="configurationMenuTaxes"]', - settings: '[data-test-id="configurationMenuSiteSettings"]', - pageTypes: '[data-test-id="configurationMenuPageTypes"]', - pages: '[data-test-id="configurationMenuPages"]', - navigation: '[data-test-id="configurationMenuNavigation"]', - staffMembers: '[data-test-id="configurationMenuStaff"]', - permissionGroups: '[data-test-id="configurationMenuPermissionGroups"]', - attributes: '[data-test-id="configurationMenuAttributes"]', - productTypes: '[data-test-id="configurationMenuProductTypes"]', - plugin: '[data-test-id="configurationPluginsPages"]', - warehouse: '[data-test-id="configurationMenuWarehouses"]' + channels: "[data-test-id*='channels']", + shipping: '[data-test-id*="shipping methods"]', + taxes: '[data-test-id*="configuration-menu-taxes"]', + settings: '[data-test-id*="configuration-menu-site-settings"]', + pageTypes: '[data-test-id*="configuration-menu-page-types"]', + navigation: '[data-test-id*="configuration-menu-navigation"]', + staffMembers: '[data-test-id*="configuration-menu-staff"]', + permissionGroups: '[data-test-id*="configuration-menu-permission-groups"]', + attributes: '[data-test-id*="configuration-menu-attributes"]', + productTypes: '[data-test-id*="configuration-menu-product-types"]', + plugin: '[data-test-id*="configuration-plugins-pages"]', + warehouse: '[data-test-id*="configuration-menu-warehouses"]' }; diff --git a/cypress/elements/customer/customer-details.js b/cypress/elements/customer/customer-details.js index 418cb0f8e..0c46ef9d9 100644 --- a/cypress/elements/customer/customer-details.js +++ b/cypress/elements/customer/customer-details.js @@ -6,7 +6,7 @@ export const CUSTOMER_DETAILS = { emailInput: '[name="email"]', noteInput: '[name="note"]', activeCheckbox: '[name="isActive"]', - menageAddressesButton: '[data-test-id="manageAddresses"]', + menageAddressesButton: '[data-test-id="manage-addresses"]', addAddressButton: '[data-test-id="add-address"]', deleteAddressMenuItem: '[data-test-id="delete-address"]', setAddressAsDefaultShipping: '[data-test-id="set-default-shipping-address"]', diff --git a/cypress/elements/customer/customers-list.js b/cypress/elements/customer/customers-list.js index cab9dd3bd..f75e2f661 100644 --- a/cypress/elements/customer/customers-list.js +++ b/cypress/elements/customer/customers-list.js @@ -1,3 +1,3 @@ export const CUSTOMERS_LIST = { - createCustomerButton: '[data-test-id="createCustomer"]' + createCustomerButton: '[data-test-id="create-customer"]' }; diff --git a/cypress/elements/homePage/homePage-selectors.js b/cypress/elements/homePage/homePage-selectors.js index 79afbfe93..c58526b03 100644 --- a/cypress/elements/homePage/homePage-selectors.js +++ b/cypress/elements/homePage/homePage-selectors.js @@ -6,5 +6,5 @@ export const HOMEPAGE_SELECTORS = { ordersReadyToFulfill: "[data-test-id='orders-to-fulfill']", paymentsWaitingForCapture: "[data-test-id='orders-to-capture']", productsOutOfStock: "[data-test-id='products-out-of-stock']", - welcomeMessage: "[data-test='welcomeHeader']" + welcomeMessage: "[data-test-id='welcome-header']" }; diff --git a/cypress/elements/navigation/menu-details.js b/cypress/elements/navigation/menu-details.js index 4213d002a..13f2748d6 100644 --- a/cypress/elements/navigation/menu-details.js +++ b/cypress/elements/navigation/menu-details.js @@ -1,8 +1,9 @@ export const MENU_DETAILS = { - createNewMenuItemButton: '[data-test-id="createNewMenuItem"]', + createNewMenuItemButton: '[data-test-id="create-new-menu-item"]', newMenuItemForm: { nameInput: '[name="name"]', - autocompleteSelectReference: '[data-test-id="containerAutocompleteSelect"]', + autocompleteSelectReference: + '[data-test-id="container-autocomplete-select"]', categoryItem: '[data-test-id="category"]', collectionItem: '[data-test-id="collection"]', pageItem: '[data-test-id="page"]', diff --git a/cypress/elements/navigation/menu-list.js b/cypress/elements/navigation/menu-list.js index 003ffae4f..aec6d1520 100644 --- a/cypress/elements/navigation/menu-list.js +++ b/cypress/elements/navigation/menu-list.js @@ -1,5 +1,5 @@ export const MENU_LIST = { - addMenuButton: '[data-test-id="addMenu"]', + addMenuButton: '[data-test-id="add-menu"]', createMenuForm: { nameInput: '[name="name"]' } diff --git a/cypress/elements/orders/order-refund.js b/cypress/elements/orders/order-refund.js index 266799b2c..928a5cdff 100644 --- a/cypress/elements/orders/order-refund.js +++ b/cypress/elements/orders/order-refund.js @@ -1,3 +1,3 @@ export const ORDER_REFUND = { - productsQuantityInput: '[data-test="quantityInput"]' + productsQuantityInput: '[data-test-id*="quantity-input"]' }; diff --git a/cypress/elements/orders/orders-selectors.js b/cypress/elements/orders/orders-selectors.js index c35489ec7..fe5d6f207 100644 --- a/cypress/elements/orders/orders-selectors.js +++ b/cypress/elements/orders/orders-selectors.js @@ -1,10 +1,12 @@ export const ORDERS_SELECTORS = { - orders: "[data-test='submenu-item-label'][data-test-id='orders']", + orders: "[data-test-id='submenu-item-label'][data-test-id='orders']", createOrder: "[data-test-id='create-order-button']", orderRow: "[data-test-id='order-table-row']", salesChannel: "[data-test-id='order-sales-channel']", - cancelFulfillment: "[data-test-id='cancelFulfillmentButton']", - cancelFulfillmentSelectField: "[data-test-id='cancelFulfillmentSelectField']", - orderFulfillmentFrame: "[data-test-id='orderFulfillment']", - refundButton: '[data-test-id="refund-button"]' + cancelFulfillment: "[data-test-id='cancel-fulfillment-button']", + cancelFulfillmentSelectField: + "[data-test-id='cancel-fulfillment-select-field']", + orderFulfillmentFrame: "[data-test-id='order-fulfillment']", + refundButton: '[data-test-id="refund-button"]', + fulfillMenuButton: '[data-test-id="fulfill-menu"]' }; diff --git a/cypress/elements/pageTypes/pageTypeDetails.js b/cypress/elements/pageTypes/pageTypeDetails.js index 713892866..ddc197d50 100644 --- a/cypress/elements/pageTypes/pageTypeDetails.js +++ b/cypress/elements/pageTypes/pageTypeDetails.js @@ -1,4 +1,4 @@ export const PAGE_TYPE_DETAILS = { nameInput: '[name="name"]', - assignAttributesButton: '[data-test-id="assignAttributes"]' + assignAttributesButton: '[data-test-id="assign-attributes"]' }; diff --git a/cypress/elements/pageTypes/pageTypesList.js b/cypress/elements/pageTypes/pageTypesList.js index 54f0231dd..911621802 100644 --- a/cypress/elements/pageTypes/pageTypesList.js +++ b/cypress/elements/pageTypes/pageTypesList.js @@ -1,3 +1,3 @@ export const PAGE_TYPES_LIST = { - createPageTypeButton: '[data-test-id="createPageType"]' + createPageTypeButton: '[data-test-id="create-page-type"]' }; diff --git a/cypress/elements/pages/page-details.js b/cypress/elements/pages/page-details.js index 4252ef65b..123562916 100644 --- a/cypress/elements/pages/page-details.js +++ b/cypress/elements/pages/page-details.js @@ -1,9 +1,10 @@ export const PAGE_DETAILS = { nameInput: '[name="title"]', - pageTypesAutocompleteSelect: '[data-test-id="pageTypesAutocompleteSelect"]', - attributeValues: '[data-test="attribute-value"]', + pageTypesAutocompleteSelect: + '[data-test-id="page-types-autocomplete-select"]', + attributeValues: '[data-test-id="attribute-value"]', isPublishedCheckbox: '[name="isPublished"][value=true]', - uploadFileButton: '[data-test="button-upload-file"]', + uploadFileButton: '[data-test-id="button-upload-file"]', richTextEditorAttributeValue: '[class*="ce-paragraph"]', booleanAttributeValueCheckbox: '[name*="attribute:"][type="checkbox"]', numericAttributeValueInput: '[name*="attribute:"]' diff --git a/cypress/elements/pages/pages-list.js b/cypress/elements/pages/pages-list.js index e42145d77..2fcfd7cd9 100644 --- a/cypress/elements/pages/pages-list.js +++ b/cypress/elements/pages/pages-list.js @@ -1,3 +1,3 @@ export const PAGES_LIST = { - createPageButton: '[data-test-id="createPage"]' + createPageButton: '[data-test-id="create-page"]' }; diff --git a/cypress/elements/permissionGroup/permissionGroupDetails.js b/cypress/elements/permissionGroup/permissionGroupDetails.js index 41acd5e13..90cb3fa04 100644 --- a/cypress/elements/permissionGroup/permissionGroupDetails.js +++ b/cypress/elements/permissionGroup/permissionGroupDetails.js @@ -5,6 +5,6 @@ export const PERMISSION_GROUP_DETAILS = { '[id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"]', assignMemberButton: '[data-test-id="assign-members"]', searchField: '[name="query"]', - removeUserButton: '[data-test-id="removeUser"]', - userRow: '[data-test-id="userRow"]' + removeUserButton: '[data-test-id="remove-user"]', + userRow: '[data-test-id="user-row"]' }; diff --git a/cypress/elements/permissionGroup/permissionGroupsList.js b/cypress/elements/permissionGroup/permissionGroupsList.js index d66cc17bf..a576d61bf 100644 --- a/cypress/elements/permissionGroup/permissionGroupsList.js +++ b/cypress/elements/permissionGroup/permissionGroupsList.js @@ -1,4 +1,4 @@ export const PERMISSION_GROUP_LIST = { - createPermissionButton: '[data-test-id="createPermissionGroup"]', - permissionGroupRow: '[data-test="id"]' + createPermissionButton: '[data-test-id="create-permission-group"]', + permissionGroupRow: '[data-test-id*="id-"]' }; diff --git a/cypress/elements/productTypes/productTypeDetails.js b/cypress/elements/productTypes/productTypeDetails.js index e1568e3e4..303e57e5e 100644 --- a/cypress/elements/productTypes/productTypeDetails.js +++ b/cypress/elements/productTypes/productTypeDetails.js @@ -1,8 +1,8 @@ export const PRODUCT_TYPE_DETAILS = { nameInput: '[name="name"]', isShippingRequired: '[name="isShippingRequired"]', - assignProductAttributeButton: '[data-test-id="assignProductsAttributes"]', - assignVariantAttributeButton: '[data-test-id="assignVariantsAttributes"]', + assignProductAttributeButton: '[data-test-id="assign-products-attributes"]', + assignVariantAttributeButton: '[data-test-id="assign-variants-attributes"]', hasVariantsButton: '[name="hasVariants"]', shippingWeightInput: '[name="weight"]', giftCardKindCheckbox: '[data-test-id="product-type-kind-option-GIFT_CARD"]', diff --git a/cypress/elements/productTypes/productTypesList.js b/cypress/elements/productTypes/productTypesList.js index b7e8a75c1..81649d4fb 100644 --- a/cypress/elements/productTypes/productTypesList.js +++ b/cypress/elements/productTypes/productTypesList.js @@ -1,3 +1,3 @@ export const PRODUCT_TYPES_LIST = { - addProductTypeButton: '[data-test-id="addProductType"]' + addProductTypeButton: '[data-test-id="add-product-type"]' }; diff --git a/cypress/elements/shared/assign-elements-selectors.js b/cypress/elements/shared/assign-elements-selectors.js index 31995395e..7d2e31d7d 100644 --- a/cypress/elements/shared/assign-elements-selectors.js +++ b/cypress/elements/shared/assign-elements-selectors.js @@ -5,5 +5,5 @@ export const ASSIGN_ELEMENTS_SELECTORS = { variantTableRow: "[data-test-id='assign-variant-table-row']", checkbox: "[type='checkbox']", submitButton: "[type='submit']", - dialogContent: '[data-test-id="searchQuery"]' + dialogContent: '[data-test-id="search-query"]' }; diff --git a/cypress/elements/shared/button-selectors.js b/cypress/elements/shared/button-selectors.js index d896fc499..4f944fbae 100644 --- a/cypress/elements/shared/button-selectors.js +++ b/cypress/elements/shared/button-selectors.js @@ -1,6 +1,6 @@ export const BUTTON_SELECTORS = { back: '[data-test-id="app-header-back-button"]', - submit: '[data-test="submit"], [data-test-id="submit"]', + submit: '[data-test-id="submit"]', confirm: '[data-test="button-bar-confirm"]', goBackButton: "[data-test-id='app-header-back-button']", checkbox: "[type='checkbox']", @@ -11,7 +11,7 @@ export const BUTTON_SELECTORS = { expandIcon: '[data-test-id="expand-icon"]', nextPaginationButton: '[data-test="button-pagination-next"]', deleteIcon: '[data-test-id="delete-icon"]', - showMoreButton: '[data-test-id="showMoreButton"]', + showMoreButton: '[data-test-id="show-more-button"]', button: "button", deleteAssignedItemsConsentCheckbox: '[name="delete-assigned-items-consent"]' }; diff --git a/cypress/elements/shared/metadata/metadata-form.js b/cypress/elements/shared/metadata/metadata-form.js index 84d5798aa..dcae71559 100644 --- a/cypress/elements/shared/metadata/metadata-form.js +++ b/cypress/elements/shared/metadata/metadata-form.js @@ -1,8 +1,9 @@ export const METADATA_FORM = { - metadataForm: "[data-test='metadataEditor'][data-test-is-private='false']", + metadataForm: + "[data-test-id='metadata-editor'][data-test-is-private='false']", privateMetadataForm: - "[data-test='metadataEditor'][data-test-is-private='true']", - addFieldButton: "[data-test='addField']", + "[data-test-id='metadata-editor'][data-test-is-private='true']", + addFieldButton: "[data-test-id='add-field']", nameInput: "[name*='name']", valueField: "[name*='value']" }; diff --git a/cypress/elements/shared/sharedElements.js b/cypress/elements/shared/sharedElements.js index dfde657cb..b7c79ada0 100644 --- a/cypress/elements/shared/sharedElements.js +++ b/cypress/elements/shared/sharedElements.js @@ -5,11 +5,11 @@ export const SHARED_ELEMENTS = { autocompleteCircle: '[class*="arrowInnerContainer"]', skeleton: '[data-test-id="skeleton"]', table: 'table[class*="Table"]', - tableRow: '[data-test="id"], [class*="MuiTableRow"]', + tableRow: '[data-test-id*="id"], [class*="MuiTableRow"]', notificationSuccess: '[data-test="notification"][data-test-type="success"]', dialog: '[role="dialog"]', - searchInput: '[data-test-id="searchInput"]', - selectOption: '[data-test="selectFieldOption"]', + searchInput: '[data-test-id="search-input"]', + selectOption: '[data-test-id*="select-field-option"]', svgImage: "svg", fileInput: 'input[type="file"]', urlInput: 'input[type="url"]', @@ -19,8 +19,8 @@ export const SHARED_ELEMENTS = { }, contentEditable: '[contenteditable="true"]', filters: { - filterGroupActivateCheckbox: '[data-test="filterGroupActive"]', - filterRow: '[data-test="channel-availability-item"]' + filterGroupActivateCheckbox: '[data-test-id*="filter-group-active"]', + filterRow: '[data-test-id*="channel-availability-item"]' }, warningDialog: '[data-test-id="warning-dialog"]' }; @@ -28,4 +28,4 @@ export const SHARED_ELEMENTS = { export const selectorWithDataValue = value => `[data-value="${value}"]`; export const getElementByDataTestId = dataTestId => - `[data-test-id=${dataTestId}]`; + `[data-test-id*=${dataTestId}]`; diff --git a/cypress/elements/shipping/select-shipping-method-form.js b/cypress/elements/shipping/select-shipping-method-form.js index 4aa93f777..ba97146a4 100644 --- a/cypress/elements/shipping/select-shipping-method-form.js +++ b/cypress/elements/shipping/select-shipping-method-form.js @@ -1,5 +1,5 @@ export const SELECT_SHIPPING_METHOD_FORM = { selectShippingMethod: "[id='mui-component-select-shippingMethod']", - shippingMethodOption: "[data-test='selectFieldOption']", + shippingMethodOption: "[data-test-id*='select-field-option']", submitButton: "[type='submit']" }; diff --git a/cypress/elements/shipping/shipping-rate-details.js b/cypress/elements/shipping/shipping-rate-details.js index 4738dcfec..59da1e618 100644 --- a/cypress/elements/shipping/shipping-rate-details.js +++ b/cypress/elements/shipping/shipping-rate-details.js @@ -3,7 +3,7 @@ export const SHIPPING_RATE_DETAILS = { priceInput: "[name='price']", includePostalCodesCheckbox: '[value="INCLUDE"]', excludePostalCodesCheckbox: '[value="EXCLUDE"]', - addPostalCodesButton: '[data-test="add-postal-code-range"]', + addPostalCodesButton: '[data-test-id="add-postal-code-range"]', postalCodesForm: { min: '[name="min"]', max: '[name="max"]' diff --git a/cypress/elements/shipping/shipping-zone-details.js b/cypress/elements/shipping/shipping-zone-details.js index e7a54d534..329f9d78e 100644 --- a/cypress/elements/shipping/shipping-zone-details.js +++ b/cypress/elements/shipping/shipping-zone-details.js @@ -13,5 +13,5 @@ export const SHIPPING_ZONE_DETAILS = { option: "[data-test-id='multi-autocomplete-select-option']", warehouseSelector: "[placeholder*='Warehouse']", channelSelector: "[placeholder*='Channel']", - removeWarehouseButton: "[data-test-id='warehousesRemove']" + removeWarehouseButton: "[data-test-id='warehouses-remove']" }; diff --git a/cypress/elements/shipping/shipping-zones-list.js b/cypress/elements/shipping/shipping-zones-list.js index a95c278fa..69c24a374 100644 --- a/cypress/elements/shipping/shipping-zones-list.js +++ b/cypress/elements/shipping/shipping-zones-list.js @@ -1,5 +1,5 @@ export const SHIPPING_ZONES_LIST = { addShippingZone: "[data-test-id='add-shipping-zone']", unitSelect: "[id='mui-component-select-unit']", - saveUnit: '[data-test-id="saveUnit"]' + saveUnit: '[data-test-id="save-unit"]' }; diff --git a/cypress/elements/staffMembers/staffMemberDetails.js b/cypress/elements/staffMembers/staffMemberDetails.js index e6206526f..f7440e3ac 100644 --- a/cypress/elements/staffMembers/staffMemberDetails.js +++ b/cypress/elements/staffMembers/staffMemberDetails.js @@ -1,5 +1,5 @@ export const STAFF_MEMBER_DETAILS = { - permissionsSelect: '[data-test="permissionGroups"]', + permissionsSelect: '[data-test-id="permission-groups"]', isActiveCheckBox: '[name="isActive"]', removePermissionButton: '[data-test-id="remove"]' }; diff --git a/cypress/elements/staffMembers/staffMembersList.js b/cypress/elements/staffMembers/staffMembersList.js index d2cf59b7b..2a2b29098 100644 --- a/cypress/elements/staffMembers/staffMembersList.js +++ b/cypress/elements/staffMembers/staffMembersList.js @@ -1,3 +1,3 @@ export const STAFF_MEMBERS_LIST = { - inviteStaffMemberButton: '[data-test-id="inviteStaffMember"]' + inviteStaffMemberButton: '[data-test-id="invite-staff-member"]' }; diff --git a/cypress/elements/translations/element-translation.js b/cypress/elements/translations/element-translation.js index c5b77a3f7..e71a956f2 100644 --- a/cypress/elements/translations/element-translation.js +++ b/cypress/elements/translations/element-translation.js @@ -3,5 +3,5 @@ export const ELEMENT_TRANSLATION = { editDescriptionButton: '[data-test-id="edit-description"]', editSeoTitleButton: '[data-test-id="edit-seoTitle"]', editSeoDescriptionButton: '[data-test-id="edit-seoDescription"]', - translationInputField: '[data-test-id="translation"]' + translationInputField: 'div[data-test-id*="translation"]' }; diff --git a/cypress/elements/warehouses/warehouses-list.js b/cypress/elements/warehouses/warehouses-list.js index 6fa7ba3cc..fba26ed86 100644 --- a/cypress/elements/warehouses/warehouses-list.js +++ b/cypress/elements/warehouses/warehouses-list.js @@ -1,3 +1,3 @@ export const WAREHOUSES_LIST = { - createNewButton: '[data-test-id="createWarehouse"]' + createNewButton: '[data-test-id="create-warehouse"]' }; diff --git a/cypress/fixtures/permissions.js b/cypress/fixtures/permissions.js index bdf2051cb..478433887 100644 --- a/cypress/fixtures/permissions.js +++ b/cypress/fixtures/permissions.js @@ -24,7 +24,7 @@ export const PERMISSIONS = { }, permissionSelectors: [ menuSelectors.DISCOUNTS_MENU_SELECTORS.sales, - menuSelectors.DISCOUNTS_MENU_SELECTORS.sales + menuSelectors.DISCOUNTS_MENU_SELECTORS.vouchers ] }, order: { @@ -41,7 +41,7 @@ export const PERMISSIONS = { parent: configurationAsParent, permissionSelectors: [ CONFIGURATION_SELECTORS.pageTypes, - CONFIGURATION_SELECTORS.pages + menuSelectors.LEFT_MENU_SELECTORS.pages ] }, plugin: { diff --git a/cypress/integration/login.js b/cypress/integration/login.js index d0c26bd99..524ff02a8 100644 --- a/cypress/integration/login.js +++ b/cypress/integration/login.js @@ -2,6 +2,7 @@ /// import { LOGIN_SELECTORS } from "../elements/account/login-selectors"; +import { HOMEPAGE_SELECTORS } from "../elements/homePage/homePage-selectors"; import { urlList } from "../fixtures/urlList"; import filterTests from "../support/filterTests"; diff --git a/cypress/integration/preorders/createAndEditVariantsInPreorder.js b/cypress/integration/preorders/createAndEditVariantsInPreorder.js index 426ac9870..15366e7ba 100644 --- a/cypress/integration/preorders/createAndEditVariantsInPreorder.js +++ b/cypress/integration/preorders/createAndEditVariantsInPreorder.js @@ -3,6 +3,7 @@ import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details"; import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; +import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; import { productDetailsUrl, variantDetailsUrl } from "../../fixtures/urlList"; import { activatePreorderOnVariant, @@ -71,7 +72,11 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { saveVariant() .then(({ response }) => { variant = response.body.data.productVariantCreate.productVariant; - cy.get(BUTTON_SELECTORS.back).click(); + cy.get(SHARED_ELEMENTS.progressBar) + .should("be.visible") + .waitForProgressBarToNotBeVisible() + .get(BUTTON_SELECTORS.back) + .click(); selectChannelForVariantAndFillUpPrices({ channelName: defaultChannel.name, attributeName: attributeValues[1], diff --git a/cypress/integration/products/productsList/pagination.js b/cypress/integration/products/productsList/pagination.js index ec9b69057..7626d24dd 100644 --- a/cypress/integration/products/productsList/pagination.js +++ b/cypress/integration/products/productsList/pagination.js @@ -16,10 +16,9 @@ filterTests({ definedTags: ["all"] }, () => { cy.clearSessionData().loginUserViaRequest(); cy.visit(urlList.products); }); + it("Should go to the next page", () => { - cy.softExpectSkeletonIsVisible(); - cy.get(PRODUCTS_LIST.productsList) - .should("be.visible") + cy.softExpectSkeletonIsVisible() .get(PRODUCTS_LIST.emptyProductRow) .should("not.exist") .get(PRODUCTS_LIST.previousPagePagination) diff --git a/cypress/support/pages/shippingMethodPage.js b/cypress/support/pages/shippingMethodPage.js index 12bb91174..89fe13cc0 100644 --- a/cypress/support/pages/shippingMethodPage.js +++ b/cypress/support/pages/shippingMethodPage.js @@ -29,6 +29,9 @@ export function fillUpShippingZoneData({ .clearAndType(shippingName) .get(SHIPPING_ZONE_DETAILS.descriptionInput) .clearAndType(shippingName) + .get(BUTTON_SELECTORS.confirm) + .click() + .confirmationMessageShouldDisappear() .get(SHIPPING_ZONE_DETAILS.assignCountryButton) .click() .get(SHIPPING_ZONE_DETAILS.searchInput) diff --git a/src/apps/components/CustomAppTokens/CustomAppTokens.tsx b/src/apps/components/CustomAppTokens/CustomAppTokens.tsx index 726c0f496..7671eefef 100644 --- a/src/apps/components/CustomAppTokens/CustomAppTokens.tsx +++ b/src/apps/components/CustomAppTokens/CustomAppTokens.tsx @@ -40,7 +40,7 @@ const CustomAppTokens: React.FC = props => { @@ -151,7 +152,7 @@ const LoginCard: React.FC = props => { onClick={() => onExternalAuthentication(externalAuthentication.id) } - data-test="external-authentication" + data-test-id="external-authentication" disabled={disabled} > {externalAuthentication.name} diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx index d8d25d67b..717918ce1 100644 --- a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx +++ b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx @@ -67,7 +67,7 @@ const NewPasswordPage: React.FC = props => { type="password" value={data.password} inputProps={{ - "data-test": "password" + "data-test-id": "password" }} /> @@ -90,7 +90,7 @@ const NewPasswordPage: React.FC = props => { }) } inputProps={{ - "data-test": "confirm-password" + "data-test-id": "confirm-password" }} /> diff --git a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx index 89fbba0c9..c3fafc100 100644 --- a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx +++ b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx @@ -53,12 +53,12 @@ const ResetPasswordPage: React.FC = props => { onChange={handleChange} value={data.email} inputProps={{ - "data-test": "email" + "data-test-id": "email" }} /> -
{children}
+
{children}
); }; diff --git a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx index 9cab93c2e..0f43a1915 100644 --- a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx +++ b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx @@ -117,7 +117,7 @@ const AutocompleteSelectMenu: React.FC = props => { {({ getItemProps, isOpen, openMenu, closeMenu, selectItem }) => (
= props => ( - ); diff --git a/src/components/CardMenu/CardMenu.tsx b/src/components/CardMenu/CardMenu.tsx index 386099524..628f14598 100644 --- a/src/components/CardMenu/CardMenu.tsx +++ b/src/components/CardMenu/CardMenu.tsx @@ -122,7 +122,7 @@ const CardMenu: React.FC = props => { return (
= props => { disabled={menuItem.loading || menuItem.disabled} onClick={() => handleMenuClick(menuItemIndex)} key={menuItem.label} - data-test={menuItem.testId} >
= ({ const { name } = data; return ( - + } classes={summaryClasses} diff --git a/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCardWrapper.tsx b/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCardWrapper.tsx index 7b976a627..6e9875999 100644 --- a/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCardWrapper.tsx +++ b/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCardWrapper.tsx @@ -57,7 +57,7 @@ export const ChannelsAvailabilityWrapper: React.FC @@ -133,7 +133,7 @@ const FileUploadField: React.FC = props => { id="fileUpload" onChange={event => onFileUpload(event.target.files[0])} type="file" - data-test="upload-file-input" + data-test-id="upload-file-input" ref={fileInputAnchor} {...inputProps} /> diff --git a/src/components/Filter/FilterAutocompleteField.tsx b/src/components/Filter/FilterAutocompleteField.tsx index c69c73e95..3b181b3fe 100644 --- a/src/components/Filter/FilterAutocompleteField.tsx +++ b/src/components/Filter/FilterAutocompleteField.tsx @@ -118,7 +118,7 @@ const FilterAutocompleteField: React.FC = ({
{filterField?.onSearchChange && ( = ({ } @@ -149,7 +150,7 @@ const FilterAutocompleteField: React.FC = ({ {displayHr &&
} {displayNoResults && ( @@ -160,13 +161,14 @@ const FilterAutocompleteField: React.FC = ({
} @@ -178,7 +180,7 @@ const FilterAutocompleteField: React.FC = ({ ))} {filterField.hasMore && ( = ({ { children?: React.ReactNode; @@ -77,8 +77,7 @@ const FilterContentBody: React.FC = ({ {children} {filter.type === FieldType.text && ( = ({ {filter.type === FieldType.options && ( @@ -139,7 +137,7 @@ const FilterContentBody: React.FC = ({ = ({ ))} {filter.type === FieldType.autocomplete && ( = ({ } diff --git a/src/components/Filter/FilterContent/FilterContentHeader.tsx b/src/components/Filter/FilterContent/FilterContentHeader.tsx index 555e5ba89..b3fc91628 100644 --- a/src/components/Filter/FilterContent/FilterContentHeader.tsx +++ b/src/components/Filter/FilterContent/FilterContentHeader.tsx @@ -38,14 +38,14 @@ const FilterContentHeader: React.FC = ({
-
diff --git a/src/components/Filter/FilterContent/FilterDateTimeField.tsx b/src/components/Filter/FilterContent/FilterDateTimeField.tsx index 3fdd78eac..468a24c76 100644 --- a/src/components/Filter/FilterContent/FilterDateTimeField.tsx +++ b/src/components/Filter/FilterContent/FilterDateTimeField.tsx @@ -42,8 +42,7 @@ export const FilterDateTimeField: React.FC = ({
= ({ /> {isDateTime && ( = ({
= ({ /> {isDateTime && ( = ({ } diff --git a/src/components/Filter/FilterContent/FilterNumericField.tsx b/src/components/Filter/FilterContent/FilterNumericField.tsx index 17013f87a..395a25593 100644 --- a/src/components/Filter/FilterContent/FilterNumericField.tsx +++ b/src/components/Filter/FilterContent/FilterNumericField.tsx @@ -41,8 +41,7 @@ export const FilterNumericField: React.FC = ({
= ({
= ({ return ( <> = ({ /> = ( return ( <> = ({ return ( { filter: IFilterElement; diff --git a/src/components/Filter/FilterOptionField.tsx b/src/components/Filter/FilterOptionField.tsx index 71dda7e28..dedf67638 100644 --- a/src/components/Filter/FilterOptionField.tsx +++ b/src/components/Filter/FilterOptionField.tsx @@ -54,14 +54,12 @@ const FilterOptionField: React.FC = ({ control={ filterField.multiple ? ( ) : ( diff --git a/src/components/Form/ExitFormDialog.tsx b/src/components/Form/ExitFormDialog.tsx index 37aa57672..94f87232a 100644 --- a/src/components/Form/ExitFormDialog.tsx +++ b/src/components/Form/ExitFormDialog.tsx @@ -52,7 +52,12 @@ const ExitFormDialog: React.FC = ({ {intl.formatMessage(messages.cancelButton)} -
diff --git a/src/components/LinkChoice/LinkChoice.tsx b/src/components/LinkChoice/LinkChoice.tsx index 115eafe3d..9459f5231 100644 --- a/src/components/LinkChoice/LinkChoice.tsx +++ b/src/components/LinkChoice/LinkChoice.tsx @@ -141,7 +141,7 @@ const LinkChoice: React.FC = ({ selected={choice.value === value} key={choice.value} onClick={() => handleChange(choice.value)} - data-test="select-option" + data-test-id="select-option" > {choice.label} diff --git a/src/components/MediaTile/MediaTile.tsx b/src/components/MediaTile/MediaTile.tsx index 24b10683a..90ca30228 100644 --- a/src/components/MediaTile/MediaTile.tsx +++ b/src/components/MediaTile/MediaTile.tsx @@ -73,7 +73,7 @@ const MediaTile: React.FC = props => { const mediaUrl = parsedMediaOembedData?.thumbnail_url || media.url; return ( -
+
{ const { change, data } = useForm(props.data, jest.fn()); @@ -111,8 +111,8 @@ describe("Metadata editor", () => { it("can delete field", () => { const wrapper = mount(); - const fieldSelector = 'tr[data-test="field"]'; - const deleteButtonSelector = '[data-test="deleteField"]'; + const fieldSelector = 'tr[data-test-id="field"]'; + const deleteButtonSelector = '[data-test-id*="delete-field"]'; // Expand to reveal fields wrapper @@ -137,8 +137,8 @@ describe("Metadata editor", () => { it("can add field", () => { const wrapper = mount(); - const fieldSelector = 'tr[data-test="field"]'; - const addButtonSelector = '[data-test="addField"]'; + const fieldSelector = 'tr[data-test-id="field"]'; + const addButtonSelector = '[data-test-id="add-field"]'; // Expand to reveal fields wrapper diff --git a/src/components/Metadata/MetadataCard.tsx b/src/components/Metadata/MetadataCard.tsx index 075134900..f8163665e 100644 --- a/src/components/Metadata/MetadataCard.tsx +++ b/src/components/Metadata/MetadataCard.tsx @@ -54,7 +54,7 @@ const MetadataCard: React.FC = ({ return ( @@ -77,7 +77,7 @@ const MetadataCard: React.FC = ({ })} hoverOutline={false} variant="secondary" - data-test="expand" + data-test-id="expand" onClick={() => setExpanded(!expanded)} > @@ -141,7 +141,7 @@ const MetadataCard: React.FC = ({ {data.map((field, fieldIndex) => ( - + = ({ onChange({ target: { @@ -194,7 +193,7 @@ const MetadataCard: React.FC = ({
@@ -333,7 +333,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = ` >