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 => { = ({ = props => { - + {token} = props => { <> diff --git a/src/attributes/components/AttributeDetails/NumericUnits.tsx b/src/attributes/components/AttributeDetails/NumericUnits.tsx index 5d08561f0..da2b1647d 100644 --- a/src/attributes/components/AttributeDetails/NumericUnits.tsx +++ b/src/attributes/components/AttributeDetails/NumericUnits.tsx @@ -128,7 +128,7 @@ export const NumericUnits: React.FC = ({ = ({ key={attribute ? attribute.id : "skeleton"} onClick={attribute && onRowClick(attribute.id)} className={classes.link} - data-test="id" - data-test-id={maybe(() => attribute.id)} + data-test-id={"id-" + maybe(() => attribute.id)} > = ({ onChange={() => toggle(attribute.id)} /> - + {attribute ? attribute.slug : } - + {attribute ? attribute.name : } attribute.visibleInStorefront)} > {attribute ? ( @@ -220,7 +219,7 @@ const AttributeList: React.FC = ({ attribute.filterableInDashboard )} @@ -233,7 +232,7 @@ const AttributeList: React.FC = ({ attribute.filterableInStorefront )} diff --git a/src/attributes/components/AttributeListPage/AttributeListPage.tsx b/src/attributes/components/AttributeListPage/AttributeListPage.tsx index 88fc6c779..83d2dbfd6 100644 --- a/src/attributes/components/AttributeListPage/AttributeListPage.tsx +++ b/src/attributes/components/AttributeListPage/AttributeListPage.tsx @@ -61,7 +61,7 @@ const AttributeListPage: React.FC = ({ setType(event.target.value)} - data-test="swatch-radio" + data-test-id="swatch-radio" /> {type === "image" ? ( <> diff --git a/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx b/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx index c2a3fd65b..9967a4819 100644 --- a/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx +++ b/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx @@ -78,7 +78,7 @@ const AttributeValueEditDialog: React.FC = ({ <> = ({ diff --git a/src/attributes/components/AttributeValues/AttributeValues.tsx b/src/attributes/components/AttributeValues/AttributeValues.tsx index 6f3840d98..a752f3596 100644 --- a/src/attributes/components/AttributeValues/AttributeValues.tsx +++ b/src/attributes/components/AttributeValues/AttributeValues.tsx @@ -98,7 +98,7 @@ const AttributeValues: React.FC = ({ disabled={disabled} variant="tertiary" onClick={onValueAdd} - data-test-id="assignValueButton" + data-test-id="assign-value-button" > = props => { /> {error && ( - + {getErrorMessage(error, intl)} )} @@ -74,7 +74,7 @@ const LoginCard: React.FC = props => { onChange={handleChange} value={data.email} inputProps={{ - "data-test": "email" + "data-test-id": "email" }} disabled={disabled} /> @@ -91,7 +91,7 @@ const LoginCard: React.FC = props => { type={showPassword ? "text" : "password"} value={data.password} inputProps={{ - "data-test": "password" + "data-test-id": "password" }} disabled={disabled} /> @@ -111,6 +111,7 @@ const LoginCard: React.FC = props => { className={classes.link} onClick={onPasswordRecovery} variant="body2" + data-test-id="reset-password-link" > = props => { variant="primary" onClick={submit} type="submit" - data-test="submit" + data-test-id="submit" > @@ -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" }} /> = props => { onClick={category ? onRowClick(category.id) : undefined} key={category ? category.id : "skeleton"} selected={isSelected} - data-test="id" - data-test-id={maybe(() => category.id)} + data-test-id={"id-" + maybe(() => category.id)} > = props => { onChange={() => toggle(category.id)} /> - + {category && category.name ? category.name : } diff --git a/src/categories/components/CategoryListPage/CategoryListPage.tsx b/src/categories/components/CategoryListPage/CategoryListPage.tsx index 832d1ca1d..04f5fe5bb 100644 --- a/src/categories/components/CategoryListPage/CategoryListPage.tsx +++ b/src/categories/components/CategoryListPage/CategoryListPage.tsx @@ -57,7 +57,11 @@ export const CategoryListPage: React.FC = ({ return ( - + = props => return ( = ({ categories: [categoryId] })} > - + = ({ = ({ /> @@ -169,7 +169,7 @@ export const CategoryUpdatePage: React.FC = ({ = ({ fullWidth FormHelperTextProps={ { - "data-testid": "slug-text-input-helper-text" + "data-test-id": "slug-text-input-helper-text" } as ExtendedFormHelperTextProps } label={intl.formatMessage({ @@ -146,7 +146,7 @@ export const ChannelForm: React.FC = ({ error={!!formErrors.currencyCode} FormHelperTextProps={ { - "data-testid": "currency-text-input-helper-text" + "data-test-id": "currency-text-input-helper-text" } as ExtendedFormHelperTextProps } helperText={getChannelsErrorMessage( @@ -181,7 +181,7 @@ export const ChannelForm: React.FC = ({ error={!!formErrors.defaultCountry} FormHelperTextProps={ { - "data-testid": "country-text-input-helper-text" + "data-test-id": "country-text-input-helper-text" } as ExtendedFormHelperTextProps } helperText={getChannelsErrorMessage( diff --git a/src/channels/components/ChannelForm/types.ts b/src/channels/components/ChannelForm/types.ts index fffa9d986..70a80c5eb 100644 --- a/src/channels/components/ChannelForm/types.ts +++ b/src/channels/components/ChannelForm/types.ts @@ -1,5 +1,5 @@ import { FormHelperTextProps } from "@material-ui/core/FormHelperText"; export type ExtendedFormHelperTextProps = FormHelperTextProps & { - "data-testid": string; + "data-test-id": string; }; diff --git a/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx b/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx index 4affd5b0b..08da04554 100644 --- a/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx +++ b/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx @@ -54,7 +54,7 @@ const ShippingZonesCardListFooter: React.FC = = ({ disabled={limitReached} onClick={navigateToChannelCreate} variant="primary" - data-test="add-channel" + data-test-id="add-channel" > = ({ onClick={!!channel ? onRowClick(channel.id) : undefined} > - + {channel?.name || } diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index a1992d79c..761f6a36e 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -169,8 +169,7 @@ const CollectionList: React.FC = props => { onClick={collection ? onRowClick(collection.id) : undefined} key={collection ? collection.id : "skeleton"} selected={isSelected} - data-test="id" - data-test-id={maybe(() => collection.id)} + data-test-id={"id-" + maybe(() => collection.id)} > = props => { onChange={() => toggle(collection.id)} /> - + {maybe(() => collection.name, )} @@ -191,7 +190,7 @@ const CollectionList: React.FC = props => { {(!collection && ) || diff --git a/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx b/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx index 269915e01..51e424b38 100644 --- a/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx +++ b/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx @@ -59,7 +59,7 @@ const AccountPermissionGroups: React.FC = props => value={formData?.permissionGroups} onChange={onChange} fetchChoices={onSearchChange} - data-test="permissionGroups" + data-test-id="permission-groups" onFetchMore={onFetchMore} hasMore={hasMore} loading={loading} diff --git a/src/components/AccountPermissions/AccountPermissions.tsx b/src/components/AccountPermissions/AccountPermissions.tsx index 75978fc21..ff878c6e3 100644 --- a/src/components/AccountPermissions/AccountPermissions.tsx +++ b/src/components/AccountPermissions/AccountPermissions.tsx @@ -136,7 +136,7 @@ const AccountPermissions: React.FC = props => { > = props => { onClick={onConfirm} error={variant === "delete"} data-test-id="submit" - data-test="submit" > {confirmButtonLabel || (variant === "delete" diff --git a/src/components/AppLayout/menuStructure.ts b/src/components/AppLayout/menuStructure.ts index 9dc5f5e7b..a042107a4 100644 --- a/src/components/AppLayout/menuStructure.ts +++ b/src/components/AppLayout/menuStructure.ts @@ -124,7 +124,7 @@ function useMenuStructure( ariaLabel: "order drafts", label: intl.formatMessage(commonMessages.drafts), permissions: [PermissionEnum.MANAGE_ORDERS], - id: "order drafts", + id: "order-drafts", url: orderDraftListUrl() }, ...mapToExtensionsItems( diff --git a/src/components/AssignProductDialog/AssignProductDialog.tsx b/src/components/AssignProductDialog/AssignProductDialog.tsx index 52811292b..dd967f4aa 100644 --- a/src/components/AssignProductDialog/AssignProductDialog.tsx +++ b/src/components/AssignProductDialog/AssignProductDialog.tsx @@ -165,7 +165,7 @@ const AssignProductDialog: React.FC = props => { = props => { = ({ variant="secondary" className={classes.expansionBarButton} onClick={toggleExpansion} - data-test="attributes-expand" + data-test-id="attributes-expand" > = ({ {label} = props => { {label} - + {selectLabel} - {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 {intl.formatMessage({ defaultMessage: "Manage", diff --git a/src/components/DeleteButton/DeleteButton.tsx b/src/components/DeleteButton/DeleteButton.tsx index f46b3b09f..374eb89b3 100644 --- a/src/components/DeleteButton/DeleteButton.tsx +++ b/src/components/DeleteButton/DeleteButton.tsx @@ -35,7 +35,7 @@ const DeleteButton: React.FC = ({ variant="primary" onClick={onClick} className={classes.button} - data-test="button-bar-delete" + data-test-id="button-bar-delete" disabled={disabled} > {label || intl.formatMessage(buttonMessages.delete)} diff --git a/src/components/FileUploadField/FileUploadField.tsx b/src/components/FileUploadField/FileUploadField.tsx index 016bbffe9..0d07d2923 100644 --- a/src/components/FileUploadField/FileUploadField.tsx +++ b/src/components/FileUploadField/FileUploadField.tsx @@ -105,7 +105,7 @@ const FileUploadField: React.FC = props => { color="primary" onClick={handleFileDelete} disabled={disabled || loading} - data-test="button-delete-file" + data-test-id="button-delete-file" > @@ -116,7 +116,7 @@ const FileUploadField: React.FC = props => { onClick={clickFileInput} disabled={disabled || loading} variant="secondary" - data-test="button-upload-file" + data-test-id="button-upload-file" > {intl.formatMessage(commonMessages.chooseFile)} @@ -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)} - + {intl.formatMessage(messages.confirmButton)} 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 = ({ onChange({ target: { diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx index 12372da15..765896463 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx @@ -261,7 +261,7 @@ const MultiAutocompleteSelectFieldComponent: React.FC handleSelect(value.value)} diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx index 7c75eb6b9..f432de3d2 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx @@ -309,7 +309,7 @@ const MultiAutocompleteSelectFieldContent: React.FC diff --git a/src/components/NavigatorButton/NavigatorButton.tsx b/src/components/NavigatorButton/NavigatorButton.tsx index 023f521b8..21118dc53 100644 --- a/src/components/NavigatorButton/NavigatorButton.tsx +++ b/src/components/NavigatorButton/NavigatorButton.tsx @@ -99,7 +99,7 @@ const NavigatorButton: React.FC = ({ <> = ({ return ( = ({ onChange(event.target.value as number)} @@ -60,7 +60,7 @@ const RowNumberSelect: React.FC = ({ {choice} diff --git a/src/components/SearchBar/SearchInput.tsx b/src/components/SearchBar/SearchInput.tsx index a5584c7db..8778aefd9 100644 --- a/src/components/SearchBar/SearchInput.tsx +++ b/src/components/SearchBar/SearchInput.tsx @@ -41,7 +41,7 @@ const SearchInput: React.FC = props => { return ( {choices.length > 0 || displayCustomValue ? ( <> @@ -213,7 +213,7 @@ const SingleAutocompleteSelectFieldContent: React.FC @@ -229,7 +229,7 @@ const SingleAutocompleteSelectFieldContent: React.FC @@ -246,7 +246,7 @@ const SingleAutocompleteSelectFieldContent: React.FC @@ -305,7 +305,7 @@ const SingleAutocompleteSelectFieldContent: React.FC diff --git a/src/components/SingleSelectField/SingleSelectField.tsx b/src/components/SingleSelectField/SingleSelectField.tsx index fe0133044..7b3082b00 100644 --- a/src/components/SingleSelectField/SingleSelectField.tsx +++ b/src/components/SingleSelectField/SingleSelectField.tsx @@ -127,8 +127,7 @@ export const SingleSelectField: React.FC = props => { choices.map(choice => ( @@ -137,7 +136,7 @@ export const SingleSelectField: React.FC = props => { )) ) : ( diff --git a/src/components/SortableChip/SortableChip.tsx b/src/components/SortableChip/SortableChip.tsx index 46406b543..8c71295a5 100644 --- a/src/components/SortableChip/SortableChip.tsx +++ b/src/components/SortableChip/SortableChip.tsx @@ -49,14 +49,14 @@ const SortableChip = SortableElement(props => { - {label} + {label} {onClose && ( )} diff --git a/src/components/TableCellAvatar/TableCellAvatar.tsx b/src/components/TableCellAvatar/TableCellAvatar.tsx index 1d5db6130..cdb5dd86f 100644 --- a/src/components/TableCellAvatar/TableCellAvatar.tsx +++ b/src/components/TableCellAvatar/TableCellAvatar.tsx @@ -31,7 +31,7 @@ const TableCellAvatar: React.FC = props => { return ( diff --git a/src/components/TablePagination/TablePaginationActions.tsx b/src/components/TablePagination/TablePaginationActions.tsx index 402bffb32..5e3b4d83b 100644 --- a/src/components/TablePagination/TablePaginationActions.tsx +++ b/src/components/TablePagination/TablePaginationActions.tsx @@ -88,7 +88,7 @@ export const TablePaginationActions: React.FC = pro })} onClick={onPreviousPage} disabled={!hasPreviousPage} - data-test="button-pagination-back" + data-test-id="button-pagination-back" {...backIconButtonProps} > {direction === "rtl" ? : } @@ -100,7 +100,7 @@ export const TablePaginationActions: React.FC = pro })} onClick={onNextPage} disabled={!hasNextPage} - data-test="button-pagination-next" + data-test-id="button-pagination-next" {...nextIconButtonProps} > {direction === "rtl" ? : } diff --git a/src/components/UserChip/UserChip.tsx b/src/components/UserChip/UserChip.tsx index ea456c145..2d2cf53e9 100644 --- a/src/components/UserChip/UserChip.tsx +++ b/src/components/UserChip/UserChip.tsx @@ -44,19 +44,19 @@ const UserChip: React.FC = ({ > - + = props => { icon={item.icon} title={item.title} description={item.description} - data-test="settingsSubsection" - data-testid={item.title.toLowerCase()} - data-test-id={item.testId} + data-test-id={ + item.testId + + "-settings-subsection-" + + item.title.toLowerCase() + } /> ))} diff --git a/src/configuration/index.tsx b/src/configuration/index.tsx index e0253f326..5303379ea 100644 --- a/src/configuration/index.tsx +++ b/src/configuration/index.tsx @@ -53,7 +53,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { ], title: intl.formatMessage(sectionNames.attributes), url: attributeListUrl(), - testId: "configurationMenuAttributes" + testId: "configuration-menu-attributes" }, { description: intl.formatMessage({ @@ -64,7 +64,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES], title: intl.formatMessage(sectionNames.productTypes), url: productTypeListUrl(), - testId: "configurationMenuProductTypes" + testId: "configuration-menu-product-types" } ] }, @@ -82,7 +82,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_SETTINGS], title: intl.formatMessage(sectionNames.taxes), url: taxSection, - testId: "configurationMenuTaxes" + testId: "configuration-menu-taxes" } ] }, @@ -100,7 +100,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_STAFF], title: intl.formatMessage(sectionNames.staff), url: staffListUrl(), - testId: "configurationMenuStaff" + testId: "configuration-menu-staff" }, { description: intl.formatMessage({ @@ -112,7 +112,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_STAFF], title: intl.formatMessage(sectionNames.permissionGroups), url: permissionGroupListUrl(), - testId: "configurationMenuPermissionGroups" + testId: "configuration-menu-permission-groups" } ] }, @@ -141,7 +141,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_PRODUCTS], title: intl.formatMessage(sectionNames.warehouses), url: warehouseSection, - testId: "configurationMenuWarehouses" + testId: "configuration-menu-warehouses" } ] }, @@ -159,7 +159,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_CHANNELS], title: intl.formatMessage(sectionNames.channels), url: channelsListUrl(), - testId: "configurationMenuChannels" + testId: "configuration-menu-channels" } ] }, @@ -180,7 +180,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { ], title: intl.formatMessage(sectionNames.pageTypes), url: pageTypeListUrl(), - testId: "configurationMenuPageTypes" + testId: "configuration-menu-page-types" } ] }, @@ -198,7 +198,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_MENUS], title: intl.formatMessage(sectionNames.navigation), url: menuListUrl(), - testId: "configurationMenuNavigation" + testId: "configuration-menu-navigation" }, { description: intl.formatMessage({ @@ -209,7 +209,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_SETTINGS], title: intl.formatMessage(sectionNames.siteSettings), url: siteSettingsUrl(), - testId: "configurationMenuSiteSettings" + testId: "configuration-menu-site-settings" }, { description: intl.formatMessage({ @@ -226,7 +226,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { permissions: [PermissionEnum.MANAGE_PLUGINS], title: intl.formatMessage(sectionNames.plugins), url: pluginListUrl(), - testId: "configurationPluginsPages" + testId: "configuration-plugins-pages" } ] } diff --git a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx index 167530d02..1ca9d850e 100644 --- a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx +++ b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx @@ -41,7 +41,7 @@ const CustomerAddresses: React.FC = props => { })} toolbar={ = ({ return ( - + = ({ const intl = useIntl(); return ( - + { <> } + cardMenu={} > checked={expiryPeriodActive} onChange={change} disabled={disabled} - data-test="expiryPeriodActive" + data-test-id="expiry-period-active" /> {expiryPeriodActive && ( diff --git a/src/home/components/HomeHeader/HomeHeader.tsx b/src/home/components/HomeHeader/HomeHeader.tsx index 5e3ca02eb..72cfe6b2e 100644 --- a/src/home/components/HomeHeader/HomeHeader.tsx +++ b/src/home/components/HomeHeader/HomeHeader.tsx @@ -32,12 +32,12 @@ const HomeOrdersCard: React.FC = props => { const classes = useStyles(props); return ( - + {userName ? ( = ({ diff --git a/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx b/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx index d3cea385a..dc5f755e3 100644 --- a/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx +++ b/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx @@ -293,7 +293,7 @@ const MenuItemDialog: React.FC = ({ diff --git a/src/navigation/components/MenuItems/MenuItems.tsx b/src/navigation/components/MenuItems/MenuItems.tsx index decd195d0..b6030411d 100644 --- a/src/navigation/components/MenuItems/MenuItems.tsx +++ b/src/navigation/components/MenuItems/MenuItems.tsx @@ -268,7 +268,7 @@ const MenuItems: React.FC = props => { )} - + = ({ {intl.formatMessage(sectionNames.configuration)} - + = props control={ } label={intl.formatMessage(addressEditMessages.customerAddress)} @@ -111,8 +112,9 @@ const OrderCustomerAddressEdit: React.FC = props control={ } label={intl.formatMessage(addressEditMessages.newAddress)} diff --git a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx index 06fe4ecdf..239be6764 100644 --- a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx +++ b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx @@ -338,7 +338,7 @@ const OrderCustomerAddressesEditDialog: React.FC } label={intl.formatMessage( @@ -391,7 +391,7 @@ const OrderCustomerAddressesEditDialog: React.FC } label={intl.formatMessage( @@ -426,7 +426,7 @@ const OrderCustomerAddressesEditDialog: React.FC } label={intl.formatMessage( @@ -443,7 +443,7 @@ const OrderCustomerAddressesEditDialog: React.FC = props => { )} - + {!isOrderUnconfirmed ? ( = ({ {existingDiscount && ( = pr variant="secondary" className={classes.deleteIcon} onClick={onOrderFulfillmentCancel} - data-test-id="cancelFulfillmentButton" + data-test-id="cancel-fulfillment-button" > diff --git a/src/orders/components/OrderFulfillmentApproveDialog/OrderFulfillmentApproveDialog.tsx b/src/orders/components/OrderFulfillmentApproveDialog/OrderFulfillmentApproveDialog.tsx index 84e5457e2..36fca7516 100644 --- a/src/orders/components/OrderFulfillmentApproveDialog/OrderFulfillmentApproveDialog.tsx +++ b/src/orders/components/OrderFulfillmentApproveDialog/OrderFulfillmentApproveDialog.tsx @@ -48,7 +48,7 @@ const OrderFulfillmentAcceptDialog: React.FC = ({ const intl = useIntl(); return ( - + = ({ checked={data.fulfillmentAutoApprove} onChange={onChange} disabled={disabled} - data-test="fulfillmentAutoApproveCheckbox" + data-test-id="fulfillment-auto-approve-checkbox" /> = ({ checked={data.fulfillmentAllowUnpaid} onChange={onChange} disabled={disabled} - data-test="fulfillmentAllowUnpaidCheckbox" + data-test-id="fulfillment-allow-unpaid-checkbox" /> diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index 37c9629c7..48383611a 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -255,7 +255,7 @@ const OrderProductAddDialog: React.FC = props => { description="dialog header" /> - + type="number" inputProps={{ className: classes.quantityInnerInput, - "data-test": "quantityInput", - "data-test-id": line?.id, + "data-test-id": "quantityInput" + line?.id, max: (line?.quantity).toString(), min: 0, style: { textAlign: "right" } diff --git a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx index 575825b09..db9b3923a 100644 --- a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx +++ b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx @@ -302,7 +302,7 @@ const OrderRefundAmount: React.FC = props => { onClick={onRefund} className={classes.refundButton} disabled={disableRefundButton} - data-test="submit" + data-test-id="submit" > {!disableRefundButton && !isReturn ? ( = props => { className={classes.priceField} InputProps={{ inputProps: { max: maxRefund?.amount } }} inputProps={{ - "data-test": "amountInput", + "data-test-id": "amountInput", max: maxRefund?.amount }} error={isError} diff --git a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx index 757213dbe..4eb1564e0 100644 --- a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx +++ b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx @@ -102,7 +102,7 @@ const OrderRefundUnfulfilledProducts: React.FC = ({ onClick }) => { = ({ const intl = useIntl(); return ( - + = ({ checked={data.automaticallyConfirmAllNewOrders} onChange={onChange} disabled={disabled} - data-test="automaticallyConfirmAllNewOrdersCheckbox" + data-test-id="automatically-confirm-all-new-orders-checkbox" /> = ({ checked={data.automaticallyFulfillNonShippableGiftCard} onChange={onChange} disabled={disabled} - data-test="automaticallyFulfillNonShippableGiftCardsCheckbox" + data-test-id="automatically-fulfill-non-shippable-gift-cards-checkbox" /> diff --git a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx index 7bb81d4d6..6e7450de4 100644 --- a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx +++ b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx @@ -73,7 +73,7 @@ const PageTypeAttributes: React.FC = props => { const intl = useIntl(); return ( - + = props => { onAttributeAssign(AttributeTypeEnum[type])} - data-test-id="assignAttributes" + data-test-id="assign-attributes" > = props => { } key={attribute?.id} index={attributeIndex || 0} - data-test="id" - data-test-id={attribute?.id} + data-test-id={"id-" + attribute?.id} > = props => { onChange={() => toggle(attribute.id)} /> - + {attribute?.name || } - + {attribute?.slug || } diff --git a/src/pageTypes/components/PageTypeList/PageTypeList.tsx b/src/pageTypes/components/PageTypeList/PageTypeList.tsx index 1f1df7477..179caa921 100644 --- a/src/pageTypes/components/PageTypeList/PageTypeList.tsx +++ b/src/pageTypes/components/PageTypeList/PageTypeList.tsx @@ -104,8 +104,7 @@ const PageTypeList: React.FC = props => { key={pageType ? pageType.id : "skeleton"} onClick={pageType ? onRowClick(pageType.id) : undefined} selected={isSelected} - data-test="id" - data-test-id={pageType?.id} + data-test-id={"id-" + pageType?.id} > = props => { {pageType ? ( - {pageType.name} + {pageType.name} ) : ( )} diff --git a/src/pageTypes/components/PageTypeListPage/PageTypeListPage.tsx b/src/pageTypes/components/PageTypeListPage/PageTypeListPage.tsx index b79d61be4..636fe9949 100644 --- a/src/pageTypes/components/PageTypeListPage/PageTypeListPage.tsx +++ b/src/pageTypes/components/PageTypeListPage/PageTypeListPage.tsx @@ -48,7 +48,11 @@ const PageTypeListPage: React.FC = ({ {intl.formatMessage(sectionNames.configuration)} - + = ({ onAdd, ...listProps }) => { return ( - + diff --git a/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx b/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx index 350a53a63..44323b508 100644 --- a/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx +++ b/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx @@ -67,7 +67,7 @@ const PageOrganizeContent: React.FC = props => { {canChangeType ? ( = ({ ); return ( - + = ({ > { diff --git a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx index dbb8e229f..78b641f93 100644 --- a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx +++ b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx @@ -124,19 +124,18 @@ const PermissionGroupList: React.FC = props => { onClick={ permissionGroup ? onRowClick(permissionGroup.id) : undefined } - data-test="id" - data-test-id={maybe(() => permissionGroup.id)} + data-test-id={"id-" + maybe(() => permissionGroup.id)} > {permissionGroup ? ( - {permissionGroup.name} + {permissionGroup.name} ) : ( )} {permissionGroup ? ( - + {permissionGroup.users.length} ) : ( diff --git a/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.tsx b/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.tsx index b0232ff4c..4ac528d6e 100644 --- a/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.tsx +++ b/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.tsx @@ -36,7 +36,7 @@ const PermissionGroupListPage: React.FC = ({ = props => { <> diff --git a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx index 8829b581b..fa468b13b 100644 --- a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx +++ b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx @@ -82,7 +82,7 @@ const ProductTypeAttributes: React.FC = props => { const intl = useIntl(); return ( - + = props => { } key={maybe(() => attribute.id)} index={attributeIndex || 0} - data-test="id" - data-test-id={maybe(() => attribute.id)} + data-test-id={"id" + maybe(() => attribute.id)} > = props => { onChange={() => toggle(attribute.id)} /> - + {maybe(() => attribute.name) ? ( attribute.name ) : ( )} - + {maybe(() => attribute.slug) ? ( attribute.slug ) : ( diff --git a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx index 52a3861e6..a17bb9568 100644 --- a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx +++ b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx @@ -196,7 +196,7 @@ const ProductTypeDetailsPage: React.FC = ({ /> productType.productAttributes)} disabled={disabled} type={ProductAttributeType.PRODUCT} @@ -223,7 +223,7 @@ const ProductTypeDetailsPage: React.FC = ({ <> = props => { key={productType ? productType.id : "skeleton"} onClick={productType ? onRowClick(productType.id) : undefined} selected={isSelected} - data-test="id" - data-test-id={maybe(() => productType.id)} + data-test-id={"id-" + maybe(() => productType.id)} > = props => { {productType ? ( <> - {productType.name} + {productType.name} {maybe(() => productType.hasVariants) ? intl.formatMessage({ diff --git a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx index 07767ef9d..07902b79d 100644 --- a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx +++ b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx @@ -58,7 +58,11 @@ const ProductTypeListPage: React.FC = ({ {intl.formatMessage(sectionNames.configuration)} - + }, []); return ( - + } key={maybe(() => attribute.id)} index={attributeIndex || 0} - data-test="id" - data-test-id={maybe(() => attribute.id)} + data-test-id={"id-" + +maybe(() => attribute.id)} > onChange={() => toggle(attribute.id)} /> - + {attribute.name ?? } - + {maybe(() => attribute.slug) ? ( attribute.slug ) : ( diff --git a/src/products/components/ProductExportDialog/ProductExportDialog.tsx b/src/products/components/ProductExportDialog/ProductExportDialog.tsx index e81f279ab..d3a5b2b6f 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialog.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialog.tsx @@ -289,7 +289,7 @@ const ProductExportDialog: React.FC = ({ variant="secondary" color="text" onClick={onClose} - data-test="cancel" + data-test-id="cancel" > @@ -299,13 +299,13 @@ const ProductExportDialog: React.FC = ({ variant="secondary" color="text" onClick={prev} - data-test="back" + data-test-id="back" > )} {step === ProductExportStep.INFO && ( - + )} @@ -313,7 +313,7 @@ const ProductExportDialog: React.FC = ({ diff --git a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx index dc72ec296..3fca5025f 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx @@ -342,7 +342,7 @@ const ProductExportDialogInfo: React.FC = ({ ) } - data-test="channels" + data-test-id="channels" > = ({ ]} onChange={handleFieldChange} onToggleAll={handleToggleAllFields} - data-test="organization" + data-test-id="organization" /> = ({ ) } - data-test="attributes" + data-test-id="attributes" > = ({ fields={[ProductFieldEnum.CHARGE_TAXES]} onChange={handleFieldChange} onToggleAll={handleToggleAllFields} - data-test="financial" + data-test-id="financial" /> = ({ ) } - data-test="inventory" + data-test-id="inventory" > = ({ ]} onChange={handleFieldChange} onToggleAll={handleToggleAllFields} - data-test="seo" + data-test-id="seo" /> > diff --git a/src/products/components/ProductList/ProductList.tsx b/src/products/components/ProductList/ProductList.tsx index 70cd163d2..6892f1758 100644 --- a/src/products/components/ProductList/ProductList.tsx +++ b/src/products/components/ProductList/ProductList.tsx @@ -185,7 +185,7 @@ export const ProductList: React.FC = props => { toolbar={toolbar} > 4 @@ -203,7 +203,7 @@ export const ProductList: React.FC = props => { = props => { displayColumns={settings.columns} > = props => { })} = props => { = props => { key={product ? product.id : "skeleton"} onClick={product && onRowClick(product.id)} className={classes.link} - data-test="id" - data-test-id={product ? product?.id : "skeleton"} + data-test-id={"id-" + (product ? product?.id : "skeleton")} > = props => { > {product?.productType ? ( - {product.name} + {product.name} {product?.productType && ( {product.productType.hasVariants ? ( @@ -382,7 +381,7 @@ export const ProductList: React.FC = props => { > {product?.productType?.name || } @@ -393,7 +392,7 @@ export const ProductList: React.FC = props => { > = props => { = props => { column="date" displayColumns={settings.columns} > - + {product?.updatedAt ? ( ) : ( @@ -454,7 +453,10 @@ export const ProductList: React.FC = props => { column="price" displayColumns={settings.columns} > - + {product?.channelListings ? ( = props => { }, ...extensionMenuItems ]} - data-test="menu" + data-test-id="menu" /> } title={intl.formatMessage(sectionNames.products)} @@ -198,7 +198,7 @@ export const ProductListPage: React.FC = props => { /> diff --git a/src/products/components/ProductMedia/ProductMedia.tsx b/src/products/components/ProductMedia/ProductMedia.tsx index 16cf80a28..221e0c04f 100644 --- a/src/products/components/ProductMedia/ProductMedia.tsx +++ b/src/products/components/ProductMedia/ProductMedia.tsx @@ -228,7 +228,7 @@ const ProductMedia: React.FC = props => { setPopperOpenStatus(true)} variant="tertiary" - data-test="button-upload-image" + data-test-id="button-upload-image" ref={anchor} > {intl.formatMessage(messages.upload)} diff --git a/src/products/components/ProductMediaPopper/ProductMediaPopper.tsx b/src/products/components/ProductMediaPopper/ProductMediaPopper.tsx index 6c3f8cf97..b56ad70e3 100644 --- a/src/products/components/ProductMediaPopper/ProductMediaPopper.tsx +++ b/src/products/components/ProductMediaPopper/ProductMediaPopper.tsx @@ -54,14 +54,14 @@ export const ProductMediaPopper = ({ imagesUploadRef.click()} - data-test="uploadImages" + data-test-id="upload-images" key="upload-images" > {intl.formatMessage(messages.uploadImages)} {intl.formatMessage(messages.uploadUrl)} diff --git a/src/products/components/ProductOrganization/ProductOrganization.tsx b/src/products/components/ProductOrganization/ProductOrganization.tsx index 033edc05a..812053929 100644 --- a/src/products/components/ProductOrganization/ProductOrganization.tsx +++ b/src/products/components/ProductOrganization/ProductOrganization.tsx @@ -124,7 +124,7 @@ const ProductOrganization: React.FC = props => { value={data.productType?.id} onChange={onProductTypeChange} fetchChoices={fetchProductTypes} - data-test="product-type" + data-test-id="product-type" {...fetchMoreProductTypes} /> ) : ( @@ -175,7 +175,7 @@ const ProductOrganization: React.FC = props => { value={data.category} onChange={onCategoryChange} fetchChoices={fetchCategories} - data-test="category" + data-test-id="category" {...fetchMoreCategories} /> @@ -200,7 +200,7 @@ const ProductOrganization: React.FC = props => { } onChange={onCollectionChange} fetchChoices={fetchCollections} - data-test="collections" + data-test-id="collections" testId="collection" {...fetchMoreCollections} /> diff --git a/src/products/components/ProductTaxes/ProductTaxes.tsx b/src/products/components/ProductTaxes/ProductTaxes.tsx index d6eb29499..50dda7310 100644 --- a/src/products/components/ProductTaxes/ProductTaxes.tsx +++ b/src/products/components/ProductTaxes/ProductTaxes.tsx @@ -58,7 +58,7 @@ const ProductTaxes: React.FC = ({ = ({ = ({ className={classes.select} disabled={disabled} displayValue={selectedTaxTypeDisplayName} - data-test="select-tax-type" + data-test-id="select-tax-type" label={intl.formatMessage({ defaultMessage: "Tax Rate", description: "select tax ratte" diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx index 195526f49..63affdb77 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx @@ -90,9 +90,9 @@ const props: ProductUpdatePageProps = { }; const selectors = { - dropdown: `[data-test="autocomplete-dropdown"]`, + dropdown: `[data-test-id="autocomplete-dropdown"]`, empty: `[data-test-type="empty"]`, - input: `[data-test="attribute-value"] input` + input: `[data-test-id="attribute-value"] input` }; describe("Product details page", () => { diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx index e7713ef20..76ef9155f 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx @@ -300,7 +300,7 @@ export const ProductUpdatePage: React.FC = ({ {extensionMenuItems.length > 0 && ( - + )} diff --git a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx index 40d5705ea..7fc82659b 100644 --- a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx +++ b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx @@ -113,7 +113,7 @@ const ProductVariantAttributes: React.FC = ({ value={getAttributeValue(attribute.id, attributes)} choices={getAttributeValueChoices(attribute.id, attributes)} allowCustomValues - data-test="variant-attribute-input" + data-test-id="variant-attribute-input" /> ); }) diff --git a/src/products/components/ProductVariantCreateDialog/ProductVariantCreateDialog.tsx b/src/products/components/ProductVariantCreateDialog/ProductVariantCreateDialog.tsx index d1822c352..fa0cf2d08 100644 --- a/src/products/components/ProductVariantCreateDialog/ProductVariantCreateDialog.tsx +++ b/src/products/components/ProductVariantCreateDialog/ProductVariantCreateDialog.tsx @@ -104,7 +104,6 @@ const ProductVariantCreateDialog: React.FC = pr transitionState="default" type="submit" data-test-id="submit" - data-test="submit" > diff --git a/src/products/components/ProductVariantSetDefault/ProductVariantSetDefault.tsx b/src/products/components/ProductVariantSetDefault/ProductVariantSetDefault.tsx index 3cd48ee09..5f2e929d4 100644 --- a/src/products/components/ProductVariantSetDefault/ProductVariantSetDefault.tsx +++ b/src/products/components/ProductVariantSetDefault/ProductVariantSetDefault.tsx @@ -23,7 +23,7 @@ const ProductVariantSetDefault: React.FC = ({ testId: "setDefault" } ]} - data-test="menu" + data-test-id="menu" /> ); }; diff --git a/src/products/components/ProductVariants/ProductVariants.tsx b/src/products/components/ProductVariants/ProductVariants.tsx index 5d840d9c2..3dd98fef4 100644 --- a/src/products/components/ProductVariants/ProductVariants.tsx +++ b/src/products/components/ProductVariants/ProductVariants.tsx @@ -256,7 +256,7 @@ export const ProductVariants: React.FC = props => { disabled={limitReached} onClick={onVariantAdd} variant="tertiary" - data-test="button-add-variant" + data-test-id="button-add-variant" > = props => { disabled={limitReached} onClick={onVariantsAdd} variant="tertiary" - data-test="button-add-variants" + data-test-id="button-add-variants" > = props => { onChange={() => toggle(variant.id)} /> - + {variant ? variant.name || variant.sku : } {isDefault && ( @@ -404,11 +404,14 @@ export const ProductVariants: React.FC = props => { )} - + {variant ? variant.sku : } - + {variant ? ( ) : ( @@ -418,7 +421,7 @@ export const ProductVariants: React.FC = props => { {numAvailable === null ? ( @@ -433,7 +436,7 @@ export const ProductVariants: React.FC = props => { e.stopPropagation()} > {variant?.id !== product?.defaultVariant?.id && ( diff --git a/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx b/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx index 14fb30db1..27fb08b76 100644 --- a/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx +++ b/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx @@ -58,7 +58,7 @@ const ShippingWeightUnitForm: React.FC = ({ /> - + diff --git a/src/shipping/components/ShippingZoneInfo/ShippingZoneInfo.tsx b/src/shipping/components/ShippingZoneInfo/ShippingZoneInfo.tsx index db614861f..90f80acb2 100644 --- a/src/shipping/components/ShippingZoneInfo/ShippingZoneInfo.tsx +++ b/src/shipping/components/ShippingZoneInfo/ShippingZoneInfo.tsx @@ -72,7 +72,7 @@ const ShippingZoneInfo: React.FC = ({ helperText={getShippingErrorMessage(formErrors.name, intl)} label={intl.formatMessage(messages.name)} inputProps={{ - "data-test": "name" + "data-test-id": "name" }} name="name" value={data.name} diff --git a/src/shipping/components/ShippingZonePostalCodeRangeDialog/ShippingZonePostalCodeRangeDialog.tsx b/src/shipping/components/ShippingZonePostalCodeRangeDialog/ShippingZonePostalCodeRangeDialog.tsx index a448b1c77..580136b0c 100644 --- a/src/shipping/components/ShippingZonePostalCodeRangeDialog/ShippingZonePostalCodeRangeDialog.tsx +++ b/src/shipping/components/ShippingZonePostalCodeRangeDialog/ShippingZonePostalCodeRangeDialog.tsx @@ -89,7 +89,7 @@ const ShippingZonePostalCodeRangeDialog: React.FC = ({ toolbar={ = ({ disabled={disabled} color="primary" onClick={() => onPostalCodeDelete(postalCodeRange)} - data-test="delete-postal-code" - data-test-id={postalCodeRange?.id} + data-test-id={"delete-postal-code-" + postalCodeRange?.id} > diff --git a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx index c151717c8..b76c9a738 100644 --- a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx +++ b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx @@ -136,7 +136,7 @@ const StaffAddMemberDialog: React.FC = props => { = ({ } > @@ -85,7 +85,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = ` > @@ -280,7 +280,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = ` @@ -321,7 +321,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = ` @@ -333,7 +333,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = ` > @@ -779,7 +778,7 @@ exports[`Storyshots Attributes / Attributes disabled 1`] = ` > @@ -1031,7 +1030,7 @@ exports[`Storyshots Attributes / Attributes disabled 1`] = ` >