Update data test ids for 3.1 (#1814)
* add update data test ids * fix not changed test ids * fix data-test-id for gift cards * remove comment * fix base url
This commit is contained in:
parent
948fd39389
commit
f5a8db9f2e
185 changed files with 3293 additions and 3623 deletions
|
@ -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']",
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const APPS_LIST = {
|
||||
createLocalAppButton: '[data-test-id="createApp"]'
|
||||
createLocalAppButton: '[data-test-id="create-app"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const ATTRIBUTES_LIST = {
|
||||
createAttributeButton: '[data-test-id="createAttributeButton"]'
|
||||
createAttributeButton: '[data-test-id="create-attribute-button"]'
|
||||
};
|
||||
|
|
|
@ -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}"]`;
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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']",
|
||||
|
|
|
@ -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']",
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]',
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const CUSTOMERS_LIST = {
|
||||
createCustomerButton: '[data-test-id="createCustomer"]'
|
||||
createCustomerButton: '[data-test-id="create-customer"]'
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export const MENU_LIST = {
|
||||
addMenuButton: '[data-test-id="addMenu"]',
|
||||
addMenuButton: '[data-test-id="add-menu"]',
|
||||
createMenuForm: {
|
||||
nameInput: '[name="name"]'
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const ORDER_REFUND = {
|
||||
productsQuantityInput: '[data-test="quantityInput"]'
|
||||
productsQuantityInput: '[data-test-id*="quantity-input"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const PAGE_TYPE_DETAILS = {
|
||||
nameInput: '[name="name"]',
|
||||
assignAttributesButton: '[data-test-id="assignAttributes"]'
|
||||
assignAttributesButton: '[data-test-id="assign-attributes"]'
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const PAGE_TYPES_LIST = {
|
||||
createPageTypeButton: '[data-test-id="createPageType"]'
|
||||
createPageTypeButton: '[data-test-id="create-page-type"]'
|
||||
};
|
||||
|
|
|
@ -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:"]'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const PAGES_LIST = {
|
||||
createPageButton: '[data-test-id="createPage"]'
|
||||
createPageButton: '[data-test-id="create-page"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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-"]'
|
||||
};
|
||||
|
|
|
@ -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"]',
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const PRODUCT_TYPES_LIST = {
|
||||
addProductTypeButton: '[data-test-id="addProductType"]'
|
||||
addProductTypeButton: '[data-test-id="add-product-type"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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}]`;
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const STAFF_MEMBERS_LIST = {
|
||||
inviteStaffMemberButton: '[data-test-id="inviteStaffMember"]'
|
||||
inviteStaffMemberButton: '[data-test-id="invite-staff-member"]'
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export const WAREHOUSES_LIST = {
|
||||
createNewButton: '[data-test-id="createWarehouse"]'
|
||||
createNewButton: '[data-test-id="create-warehouse"]'
|
||||
};
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
/// <reference types="../support"/>
|
||||
|
||||
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";
|
||||
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -40,7 +40,7 @@ const CustomAppTokens: React.FC<CustomAppTokensProps> = props => {
|
|||
<Button
|
||||
variant="secondary"
|
||||
onClick={onCreate}
|
||||
data-test-id="createToken"
|
||||
data-test-id="create-token"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create Token"
|
||||
|
|
|
@ -43,7 +43,7 @@ const CustomApps: React.FC<CustomAppsProps> = ({
|
|||
<Button
|
||||
variant="secondary"
|
||||
onClick={navigateToCustomAppCreate}
|
||||
data-test-id="createApp"
|
||||
data-test-id="create-app"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create App"
|
||||
|
|
|
@ -89,7 +89,7 @@ const TokenCreateDialog: React.FC<TokenCreateDialogProps> = props => {
|
|||
<Typography variant="caption">
|
||||
<FormattedMessage defaultMessage="Generated Token" />
|
||||
</Typography>
|
||||
<Typography data-test-id="generatedToken">
|
||||
<Typography data-test-id="generated-token">
|
||||
{token}
|
||||
</Typography>
|
||||
<Button
|
||||
|
@ -110,7 +110,7 @@ const TokenCreateDialog: React.FC<TokenCreateDialogProps> = props => {
|
|||
<>
|
||||
<BackButton className={classes.cancel} onClick={onClose} />
|
||||
<ConfirmButton
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
transitionState={confirmButtonState}
|
||||
onClick={submit}
|
||||
>
|
||||
|
|
|
@ -128,7 +128,7 @@ export const NumericUnits: React.FC<NumericUnitsProps> = ({
|
|||
<div>
|
||||
<div className={classes.hr} />
|
||||
<ControlledCheckbox
|
||||
data-test="numeric-with-unit"
|
||||
data-test-id="numeric-with-unit"
|
||||
name="selectUnit"
|
||||
label={formatMessage(M.messages.selectUnit)}
|
||||
checked={data.unit !== null}
|
||||
|
|
|
@ -190,8 +190,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
|||
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)}
|
||||
>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
|
@ -201,15 +200,15 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
|||
onChange={() => toggle(attribute.id)}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className={classes.colSlug} data-test="slug">
|
||||
<TableCell className={classes.colSlug} data-test-id="slug">
|
||||
{attribute ? attribute.slug : <Skeleton />}
|
||||
</TableCell>
|
||||
<TableCell className={classes.colName} data-test="name">
|
||||
<TableCell className={classes.colName} data-test-id="name">
|
||||
{attribute ? attribute.name : <Skeleton />}
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className={classes.colVisible}
|
||||
data-test="visible"
|
||||
data-test-id="visible"
|
||||
data-test-visible={maybe(() => attribute.visibleInStorefront)}
|
||||
>
|
||||
{attribute ? (
|
||||
|
@ -220,7 +219,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
|||
</TableCell>
|
||||
<TableCell
|
||||
className={classes.colSearchable}
|
||||
data-test="searchable"
|
||||
data-test-id="searchable"
|
||||
data-test-searchable={maybe(
|
||||
() => attribute.filterableInDashboard
|
||||
)}
|
||||
|
@ -233,7 +232,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
|||
</TableCell>
|
||||
<TableCell
|
||||
className={classes.colFaceted}
|
||||
data-test="use-in-faceted-search"
|
||||
data-test-id="use-in-faceted-search"
|
||||
data-test-use-in-faceted-search={maybe(
|
||||
() => attribute.filterableInStorefront
|
||||
)}
|
||||
|
|
|
@ -61,7 +61,7 @@ const AttributeListPage: React.FC<AttributeListPageProps> = ({
|
|||
<Button
|
||||
onClick={onAdd}
|
||||
variant="primary"
|
||||
data-test-id="createAttributeButton"
|
||||
data-test-id="create-attribute-button"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create attribute"
|
||||
|
|
|
@ -88,7 +88,7 @@ const AttributeSwatchField: React.FC<AttributeSwatchFieldProps<
|
|||
name="swatch"
|
||||
value={type}
|
||||
onChange={event => setType(event.target.value)}
|
||||
data-test="swatch-radio"
|
||||
data-test-id="swatch-radio"
|
||||
/>
|
||||
{type === "image" ? (
|
||||
<>
|
||||
|
|
|
@ -78,7 +78,7 @@ const AttributeValueEditDialog: React.FC<AttributeValueEditDialogProps> = ({
|
|||
<>
|
||||
<DialogContent>
|
||||
<TextField
|
||||
data-test-id="valueName"
|
||||
data-test-id="value-name"
|
||||
autoFocus
|
||||
disabled={disabled}
|
||||
error={!!formErrors.name}
|
||||
|
@ -108,7 +108,7 @@ const AttributeValueEditDialog: React.FC<AttributeValueEditDialogProps> = ({
|
|||
<DialogActions>
|
||||
<BackButton onClick={onClose} />
|
||||
<ConfirmButton
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
transitionState={confirmButtonState}
|
||||
onClick={submit}
|
||||
>
|
||||
|
|
|
@ -98,7 +98,7 @@ const AttributeValues: React.FC<AttributeValuesProps> = ({
|
|||
disabled={disabled}
|
||||
variant="tertiary"
|
||||
onClick={onValueAdd}
|
||||
data-test-id="assignValueButton"
|
||||
data-test-id="assign-value-button"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Assign value"
|
||||
|
|
|
@ -61,7 +61,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
|||
/>
|
||||
</Typography>
|
||||
{error && (
|
||||
<div className={classes.panel} data-test="loginErrorMessage">
|
||||
<div className={classes.panel} data-test-id="login-error-message">
|
||||
{getErrorMessage(error, intl)}
|
||||
</div>
|
||||
)}
|
||||
|
@ -74,7 +74,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
|||
onChange={handleChange}
|
||||
value={data.email}
|
||||
inputProps={{
|
||||
"data-test": "email"
|
||||
"data-test-id": "email"
|
||||
}}
|
||||
disabled={disabled}
|
||||
/>
|
||||
|
@ -91,7 +91,7 @@ const LoginCard: React.FC<LoginCardProps> = 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<LoginCardProps> = props => {
|
|||
className={classes.link}
|
||||
onClick={onPasswordRecovery}
|
||||
variant="body2"
|
||||
data-test-id="reset-password-link"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Forgot password?"
|
||||
|
@ -124,7 +125,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
|||
variant="primary"
|
||||
onClick={submit}
|
||||
type="submit"
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
>
|
||||
<FormattedMessage defaultMessage="Sign in" description="button" />
|
||||
</Button>
|
||||
|
@ -151,7 +152,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
|||
onClick={() =>
|
||||
onExternalAuthentication(externalAuthentication.id)
|
||||
}
|
||||
data-test="external-authentication"
|
||||
data-test-id="external-authentication"
|
||||
disabled={disabled}
|
||||
>
|
||||
{externalAuthentication.name}
|
||||
|
|
|
@ -67,7 +67,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
|
|||
type="password"
|
||||
value={data.password}
|
||||
inputProps={{
|
||||
"data-test": "password"
|
||||
"data-test-id": "password"
|
||||
}}
|
||||
/>
|
||||
<FormSpacer />
|
||||
|
@ -90,7 +90,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
|
|||
})
|
||||
}
|
||||
inputProps={{
|
||||
"data-test": "confirm-password"
|
||||
"data-test-id": "confirm-password"
|
||||
}}
|
||||
/>
|
||||
<FormSpacer />
|
||||
|
|
|
@ -53,12 +53,12 @@ const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
|
|||
onChange={handleChange}
|
||||
value={data.email}
|
||||
inputProps={{
|
||||
"data-test": "email"
|
||||
"data-test-id": "email"
|
||||
}}
|
||||
/>
|
||||
<FormSpacer />
|
||||
<Button
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
className={classes.submit}
|
||||
disabled={disabled}
|
||||
variant="primary"
|
||||
|
|
|
@ -161,8 +161,7 @@ const CategoryList: React.FC<CategoryListProps> = 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)}
|
||||
>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
|
@ -172,7 +171,7 @@ const CategoryList: React.FC<CategoryListProps> = props => {
|
|||
onChange={() => toggle(category.id)}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className={classes.colName} data-test="name">
|
||||
<TableCell className={classes.colName} data-test-id="name">
|
||||
{category && category.name ? category.name : <Skeleton />}
|
||||
</TableCell>
|
||||
<TableCell className={classes.colSubcategories}>
|
||||
|
|
|
@ -57,7 +57,11 @@ export const CategoryListPage: React.FC<CategoryTableProps> = ({
|
|||
return (
|
||||
<Container>
|
||||
<PageHeader title={intl.formatMessage(sectionNames.categories)}>
|
||||
<Button variant="primary" onClick={onAdd} data-test-id="createCategory">
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={onAdd}
|
||||
data-test-id="create-category"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create category"
|
||||
description="button"
|
||||
|
|
|
@ -115,7 +115,7 @@ export const CategoryProductList: React.FC<CategoryProductListProps> = props =>
|
|||
|
||||
return (
|
||||
<TableRow
|
||||
data-test-id="productRow"
|
||||
data-test-id="product-row"
|
||||
selected={isSelected}
|
||||
hover={!!product}
|
||||
key={product ? product.id : "skeleton"}
|
||||
|
|
|
@ -54,7 +54,7 @@ export const CategoryProducts: React.FC<CategoryProductsProps> = ({
|
|||
categories: [categoryId]
|
||||
})}
|
||||
>
|
||||
<Button variant="tertiary" data-test-id="viewProducts">
|
||||
<Button variant="tertiary" data-test-id="view-products">
|
||||
<FormattedMessage
|
||||
defaultMessage="View products"
|
||||
description="button"
|
||||
|
@ -65,7 +65,7 @@ export const CategoryProducts: React.FC<CategoryProductsProps> = ({
|
|||
<Button
|
||||
variant="tertiary"
|
||||
onClick={onAdd}
|
||||
data-test-id="addProducts"
|
||||
data-test-id="add-products"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Add product"
|
||||
|
|
|
@ -147,7 +147,7 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
|||
/>
|
||||
</CategoriesTab>
|
||||
<ProductsTab
|
||||
testId="productsTab"
|
||||
testId="products-tab"
|
||||
isActive={currentTab === CategoryPageTab.products}
|
||||
changeTab={changeTab}
|
||||
>
|
||||
|
@ -169,7 +169,7 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
|||
<Button
|
||||
variant="tertiary"
|
||||
onClick={onAddCategory}
|
||||
data-test-id="createSubcategory"
|
||||
data-test-id="create-subcategory"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create subcategory"
|
||||
|
|
|
@ -94,7 +94,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
|||
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<ChannelFormProps> = ({
|
|||
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<ChannelFormProps> = ({
|
|||
error={!!formErrors.defaultCountry}
|
||||
FormHelperTextProps={
|
||||
{
|
||||
"data-testid": "country-text-input-helper-text"
|
||||
"data-test-id": "country-text-input-helper-text"
|
||||
} as ExtendedFormHelperTextProps
|
||||
}
|
||||
helperText={getChannelsErrorMessage(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FormHelperTextProps } from "@material-ui/core/FormHelperText";
|
||||
|
||||
export type ExtendedFormHelperTextProps = FormHelperTextProps & {
|
||||
"data-testid": string;
|
||||
"data-test-id": string;
|
||||
};
|
||||
|
|
|
@ -54,7 +54,7 @@ const ShippingZonesCardListFooter: React.FC<ShippingZonesCardListFooterProps> =
|
|||
<ClickAwayListener onClickAway={handleFooterClickAway}>
|
||||
<div className={classes.root}>
|
||||
<SingleAutocompleteSelectField
|
||||
data-test-id="shippingAutoCompleteSelect"
|
||||
data-test-id="shipping-auto-complete-select"
|
||||
value=""
|
||||
displayValue=""
|
||||
nakedInput
|
||||
|
|
|
@ -71,7 +71,7 @@ export const ChannelsListPage: React.FC<ChannelsListPageProps> = ({
|
|||
disabled={limitReached}
|
||||
onClick={navigateToChannelCreate}
|
||||
variant="primary"
|
||||
data-test="add-channel"
|
||||
data-test-id="add-channel"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create Channel"
|
||||
|
@ -118,7 +118,7 @@ export const ChannelsListPage: React.FC<ChannelsListPageProps> = ({
|
|||
onClick={!!channel ? onRowClick(channel.id) : undefined}
|
||||
>
|
||||
<TableCell className={classes.colName}>
|
||||
<span data-test="name">
|
||||
<span data-test-id="name">
|
||||
{channel?.name || <Skeleton />}
|
||||
</span>
|
||||
</TableCell>
|
||||
|
|
|
@ -169,8 +169,7 @@ const CollectionList: React.FC<CollectionListProps> = 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)}
|
||||
>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
|
@ -180,7 +179,7 @@ const CollectionList: React.FC<CollectionListProps> = props => {
|
|||
onChange={() => toggle(collection.id)}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className={classes.colName} data-test="name">
|
||||
<TableCell className={classes.colName} data-test-id="name">
|
||||
{maybe<React.ReactNode>(() => collection.name, <Skeleton />)}
|
||||
</TableCell>
|
||||
<TableCell className={classes.colProducts}>
|
||||
|
@ -191,7 +190,7 @@ const CollectionList: React.FC<CollectionListProps> = props => {
|
|||
</TableCell>
|
||||
<TableCell
|
||||
className={classes.colAvailability}
|
||||
data-test="availability"
|
||||
data-test-id="availability"
|
||||
data-test-availability={!!collection?.channelListings?.length}
|
||||
>
|
||||
{(!collection && <Skeleton />) ||
|
||||
|
|
|
@ -59,7 +59,7 @@ const AccountPermissionGroups: React.FC<AccountPermissionGroupsProps> = props =>
|
|||
value={formData?.permissionGroups}
|
||||
onChange={onChange}
|
||||
fetchChoices={onSearchChange}
|
||||
data-test="permissionGroups"
|
||||
data-test-id="permission-groups"
|
||||
onFetchMore={onFetchMore}
|
||||
hasMore={hasMore}
|
||||
loading={loading}
|
||||
|
|
|
@ -136,7 +136,7 @@ const AccountPermissions: React.FC<AccountPermissionsProps> = props => {
|
|||
>
|
||||
<ListItemIcon>
|
||||
<Checkbox
|
||||
data-test-id="fullAccess"
|
||||
data-test-id="full-access"
|
||||
color="primary"
|
||||
edge="start"
|
||||
checked={data.hasFullAccess}
|
||||
|
|
|
@ -44,7 +44,6 @@ const DialogButtons: React.FC<DialogButtonsProps> = props => {
|
|||
onClick={onConfirm}
|
||||
error={variant === "delete"}
|
||||
data-test-id="submit"
|
||||
data-test="submit"
|
||||
>
|
||||
{confirmButtonLabel ||
|
||||
(variant === "delete"
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -165,7 +165,7 @@ const AssignProductDialog: React.FC<AssignProductDialogProps> = props => {
|
|||
<DialogActions>
|
||||
<BackButton onClick={onClose} />
|
||||
<ConfirmButton
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
transitionState={confirmButtonState}
|
||||
type="submit"
|
||||
onClick={handleSubmit}
|
||||
|
|
|
@ -280,7 +280,7 @@ const AssignVariantDialog: React.FC<AssignVariantDialogProps> = props => {
|
|||
<DialogActions>
|
||||
<BackButton onClick={onClose} />
|
||||
<ConfirmButton
|
||||
data-test="submit"
|
||||
data-test-id="submit"
|
||||
transitionState={confirmButtonState}
|
||||
type="submit"
|
||||
onClick={handleSubmit}
|
||||
|
|
|
@ -146,7 +146,7 @@ const Attributes: React.FC<AttributesProps> = ({
|
|||
variant="secondary"
|
||||
className={classes.expansionBarButton}
|
||||
onClick={toggleExpansion}
|
||||
data-test="attributes-expand"
|
||||
data-test-id="attributes-expand"
|
||||
>
|
||||
<ArrowDropDownIcon
|
||||
className={classNames(classes.expansionBarButtonIcon, {
|
||||
|
|
|
@ -51,12 +51,12 @@ const BasicAttributeRow: React.FC<BasicAttributeRowProps> = ({
|
|||
<Grid className={classes.attributeSection} variant="uniform">
|
||||
<div
|
||||
className={classes.attributeSectionLabel}
|
||||
data-test="attribute-label"
|
||||
data-test-id="attribute-label"
|
||||
>
|
||||
<Typography>{label}</Typography>
|
||||
</div>
|
||||
<div
|
||||
data-test="attribute-value"
|
||||
data-test-id="attribute-value"
|
||||
className={classNames(classes.value, {
|
||||
[classes.flex]: flexValueContainer
|
||||
})}
|
||||
|
|
|
@ -38,23 +38,23 @@ const ExtendedAttributeRow: React.FC<ExtendedAttributeRowProps> = props => {
|
|||
<Grid className={classes.attributeSection} variant="uniform">
|
||||
<div
|
||||
className={classes.attributeSectionLabel}
|
||||
data-test="attribute-label"
|
||||
data-test-id="attribute-label"
|
||||
>
|
||||
<Typography>{label}</Typography>
|
||||
</div>
|
||||
<div data-test="attribute-selector">
|
||||
<div data-test-id="attribute-selector">
|
||||
<Button
|
||||
className={classes.attributeSectionButton}
|
||||
disabled={disabled}
|
||||
variant="tertiary"
|
||||
data-test="button-attribute-selector"
|
||||
data-test-id="button-attribute-selector"
|
||||
onClick={onSelect}
|
||||
>
|
||||
{selectLabel}
|
||||
</Button>
|
||||
</div>
|
||||
</Grid>
|
||||
<div data-test="attribute-value">{children}</div>
|
||||
<div data-test-id="attribute-value">{children}</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ const AutocompleteSelectMenu: React.FC<AutocompleteSelectMenuProps> = props => {
|
|||
{({ getItemProps, isOpen, openMenu, closeMenu, selectItem }) => (
|
||||
<div
|
||||
className={classes.container}
|
||||
data-test-id="containerAutocompleteSelect"
|
||||
data-test-id="container-autocomplete-select"
|
||||
>
|
||||
<TextField
|
||||
InputProps={{
|
||||
|
|
|
@ -4,7 +4,7 @@ import React from "react";
|
|||
import { FormattedMessage } from "react-intl";
|
||||
|
||||
const BackButton: React.FC<ButtonProps> = props => (
|
||||
<Button data-test="back" variant="secondary" color="text" {...props}>
|
||||
<Button data-test-id="back" variant="secondary" color="text" {...props}>
|
||||
<FormattedMessage {...buttonMessages.back} />
|
||||
</Button>
|
||||
);
|
||||
|
|
|
@ -122,7 +122,7 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
|||
return (
|
||||
<div className={className} {...rest}>
|
||||
<IconButton
|
||||
data-test-id="showMoreButton"
|
||||
data-test-id="show-more-button"
|
||||
aria-label="More"
|
||||
aria-owns={open ? "long-menu" : null}
|
||||
aria-haspopup="true"
|
||||
|
@ -163,7 +163,6 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
|||
disabled={menuItem.loading || menuItem.disabled}
|
||||
onClick={() => handleMenuClick(menuItemIndex)}
|
||||
key={menuItem.label}
|
||||
data-test={menuItem.testId}
|
||||
>
|
||||
<div
|
||||
className={classNames(className, {
|
||||
|
|
|
@ -72,7 +72,10 @@ const ChannelContentWrapper: React.FC<ChannelContentWrapperProps> = ({
|
|||
const { name } = data;
|
||||
|
||||
return (
|
||||
<Accordion classes={expanderClasses} data-test="channel-availability-item">
|
||||
<Accordion
|
||||
classes={expanderClasses}
|
||||
data-test-id="channel-availability-item"
|
||||
>
|
||||
<AccordionSummary
|
||||
expandIcon={<IconChevronDown />}
|
||||
classes={summaryClasses}
|
||||
|
|
|
@ -57,7 +57,7 @@ export const ChannelsAvailabilityWrapper: React.FC<ChannelsAvailabilityWrapperPr
|
|||
>
|
||||
<Button
|
||||
onClick={openModal}
|
||||
data-test-id="channels-availiability-manage-button"
|
||||
data-test-id="channels-availability-manage-button"
|
||||
>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Manage",
|
||||
|
|
|
@ -35,7 +35,7 @@ const DeleteButton: React.FC<DeleteButtonProps> = ({
|
|||
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)}
|
||||
|
|
|
@ -105,7 +105,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = props => {
|
|||
color="primary"
|
||||
onClick={handleFileDelete}
|
||||
disabled={disabled || loading}
|
||||
data-test="button-delete-file"
|
||||
data-test-id="button-delete-file"
|
||||
>
|
||||
<DeleteIcon />
|
||||
</IconButton>
|
||||
|
@ -116,7 +116,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = props => {
|
|||
onClick={clickFileInput}
|
||||
disabled={disabled || loading}
|
||||
variant="secondary"
|
||||
data-test="button-upload-file"
|
||||
data-test-id="button-upload-file"
|
||||
>
|
||||
{intl.formatMessage(commonMessages.chooseFile)}
|
||||
</Button>
|
||||
|
@ -133,7 +133,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = 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}
|
||||
/>
|
||||
|
|
|
@ -118,7 +118,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
<div {...rest}>
|
||||
{filterField?.onSearchChange && (
|
||||
<TextField
|
||||
data-test="filterFieldAutocompleteInput"
|
||||
data-test-id="filter-field-autocomplete-input"
|
||||
className={classes.inputContainer}
|
||||
fullWidth
|
||||
name={filterField.name + "_autocomplete"}
|
||||
|
@ -135,8 +135,9 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
data-test="filterFieldAutocompleteSelected"
|
||||
data-test-id={filterField.value}
|
||||
data-test-id={
|
||||
"filter-field-autocomplete-selected-" + filterField.value
|
||||
}
|
||||
checked={filterField.value.includes(displayValue.value)}
|
||||
/>
|
||||
}
|
||||
|
@ -149,7 +150,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
{displayHr && <Hr className={classes.hr} />}
|
||||
{displayNoResults && (
|
||||
<Typography
|
||||
data-test="filterFieldAutocompleteNoResults"
|
||||
data-test-id="filter-field-autocomplete-no-results"
|
||||
className={classes.noResults}
|
||||
color="textSecondary"
|
||||
>
|
||||
|
@ -160,13 +161,14 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
<div
|
||||
className={classes.option}
|
||||
key={option.value}
|
||||
data-test-id="filterOption"
|
||||
data-test-id="filter-option"
|
||||
>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
data-test="filterFieldAutocompleteOption"
|
||||
data-test-id={filterField.value}
|
||||
data-test-id={
|
||||
"filter-field-autocomplete-option-" + filterField.value
|
||||
}
|
||||
checked={filterField.value.includes(option.value)}
|
||||
/>
|
||||
}
|
||||
|
@ -178,7 +180,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
))}
|
||||
{filterField.hasMore && (
|
||||
<Link
|
||||
data-test="filterFieldAutocompleteHasMore"
|
||||
data-test-id="filter-field-autocomplete-has-more"
|
||||
className={classes.showMore}
|
||||
underline
|
||||
onClick={filterField.onFetchMore}
|
||||
|
|
|
@ -216,8 +216,7 @@ const FilterContent: React.FC<FilterContentProps> = ({
|
|||
<Accordion
|
||||
key={filter.name}
|
||||
classes={expanderClasses}
|
||||
data-test="channel-availability-item"
|
||||
data-test-id={filter.name}
|
||||
data-test-id={"channel-availability-item-" + filter.name}
|
||||
expanded={filter.name === openedFilter?.name}
|
||||
>
|
||||
<AccordionSummary
|
||||
|
|
|
@ -35,7 +35,7 @@ const useStyles = makeStyles(
|
|||
{ name: "FilterContentBody" }
|
||||
);
|
||||
|
||||
const filterTestingContext = "filter-field";
|
||||
const filterTestingContext = "filter-field-";
|
||||
|
||||
export interface FilterContentBodyProps<T extends string = string> {
|
||||
children?: React.ReactNode;
|
||||
|
@ -77,8 +77,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
|||
{children}
|
||||
{filter.type === FieldType.text && (
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
fullWidth
|
||||
name={filter.name}
|
||||
InputProps={{ classes: { input: commonClasses.input } }}
|
||||
|
@ -124,8 +123,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
|||
|
||||
{filter.type === FieldType.options && (
|
||||
<FilterOptionField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
filterField={filter}
|
||||
onFilterPropertyChange={onFilterPropertyChange}
|
||||
/>
|
||||
|
@ -139,7 +137,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
|||
<FormControlLabel
|
||||
control={
|
||||
<Radio
|
||||
data-test="filterBoolean"
|
||||
data-test-id="filter-boolean"
|
||||
data-test-is-checked={filter.value[0] === option.value}
|
||||
checked={filter.value[0] === option.value}
|
||||
color="primary"
|
||||
|
@ -163,8 +161,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
|||
))}
|
||||
{filter.type === FieldType.autocomplete && (
|
||||
<FilterAutocompleteField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
displayValues={autocompleteDisplayValues}
|
||||
filterField={filter}
|
||||
setDisplayValues={setAutocompleteDisplayValues}
|
||||
|
|
|
@ -33,8 +33,7 @@ const FilterContentBodyNameField: React.FC<FilterContentBodyNameFieldProps> = ({
|
|||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
data-test="filterGroupActive"
|
||||
data-test-id={filter.name}
|
||||
data-test-id={"filter-group-active-" + filter.name}
|
||||
checked={filter.active}
|
||||
/>
|
||||
}
|
||||
|
|
|
@ -38,14 +38,14 @@ const FilterContentHeader: React.FC<FilterContentHeaderProps> = ({
|
|||
</Typography>
|
||||
<div>
|
||||
<Button
|
||||
data-test="clear"
|
||||
data-test-id="clear"
|
||||
variant="secondary"
|
||||
className={classes.clear}
|
||||
onClick={onClear}
|
||||
>
|
||||
<FormattedMessage {...buttonMessages.clear} />
|
||||
</Button>
|
||||
<Button data-test="submit" variant="primary" type="submit">
|
||||
<Button data-test-id="submit" variant="primary" type="submit">
|
||||
<FormattedMessage {...buttonMessages.done} />
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -42,8 +42,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
|||
</div>
|
||||
<TextField
|
||||
{...(isMultiple && { "data-test-range-type": "min" })}
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
fullWidth
|
||||
name={filter.name + (isMultiple ? "_min" : "")}
|
||||
InputProps={{
|
||||
|
@ -64,8 +63,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
|||
/>
|
||||
{isDateTime && (
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
data-test-range-type="time_min"
|
||||
className={classes.inputTime}
|
||||
name={filter.name + (isMultiple ? "_time_min" : "")}
|
||||
|
@ -98,8 +96,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
|||
<div className={classes.inputRange}>
|
||||
<div className={classes.spacer} />
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
data-test-range-type="max"
|
||||
fullWidth
|
||||
name={filter.name + "_max"}
|
||||
|
@ -123,8 +120,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
|||
/>
|
||||
{isDateTime && (
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
className={classes.inputTime}
|
||||
data-test-range-type="time_max"
|
||||
name={filter.name + "_time_max"}
|
||||
|
|
|
@ -37,8 +37,7 @@ const FilterGroupLabel: React.FC<FilterGroupLabelProps> = ({
|
|||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
data-test="filterGroupActive"
|
||||
data-test-id={filter.name}
|
||||
data-test-id={"filter-group-active-" + filter.name}
|
||||
checked={filter.active}
|
||||
/>
|
||||
}
|
||||
|
|
|
@ -41,8 +41,7 @@ export const FilterNumericField: React.FC<FilterNumericFieldProps> = ({
|
|||
</div>
|
||||
<TextField
|
||||
{...(isMultiple && { "data-test-range-type": "min" })}
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
fullWidth
|
||||
name={filter.name + (isMultiple ? "_min" : "")}
|
||||
InputProps={{
|
||||
|
@ -72,8 +71,7 @@ export const FilterNumericField: React.FC<FilterNumericFieldProps> = ({
|
|||
<div className={classes.inputRange}>
|
||||
<div className={classes.spacer} />
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
data-test-range-type="max"
|
||||
fullWidth
|
||||
name={filter.name + "_max"}
|
||||
|
|
|
@ -23,8 +23,7 @@ const FilterRangeField: React.FC<FilterRangeFieldProps> = ({
|
|||
return (
|
||||
<>
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
data-test-range-type="min"
|
||||
fullWidth
|
||||
name={filter.name + "_min"}
|
||||
|
@ -55,8 +54,7 @@ const FilterRangeField: React.FC<FilterRangeFieldProps> = ({
|
|||
/>
|
||||
</span>
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
data-test-range-type="max"
|
||||
fullWidth
|
||||
name={filter.name + "_max"}
|
||||
|
|
|
@ -22,7 +22,7 @@ export const FilterSingleSelectField: React.FC<FilterSingleSelectFieldProps> = (
|
|||
return (
|
||||
<>
|
||||
<SingleSelectField
|
||||
data-test="filterRangeTypeChoice"
|
||||
data-test-id="filter-range-type-choice"
|
||||
choices={getIsFilterMultipleChoices(intl)}
|
||||
value={filter.multiple ? FilterType.MULTIPLE : FilterType.SINGULAR}
|
||||
InputProps={{
|
||||
|
|
|
@ -21,8 +21,7 @@ const FilterTextField: React.FC<FilterTextFieldProps> = ({
|
|||
|
||||
return (
|
||||
<TextField
|
||||
data-test={filterTestingContext}
|
||||
data-test-id={filter.name}
|
||||
data-test-id={filterTestingContext + filter.name}
|
||||
fullWidth
|
||||
name={filter.name}
|
||||
InputProps={{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue