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 = {
|
export const ORDERS = {
|
||||||
orders: "[data-test='submenu-item-label'][data-test-id='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 = {
|
export const CATALOG = {
|
||||||
products: "[data-test='submenu-item-label'][data-test-id='products']",
|
products: "[data-test='submenu-item-label'][data-test-id='products']",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
export const LOGIN_SELECTORS = {
|
export const LOGIN_SELECTORS = {
|
||||||
accountSettings: "[data-test=accountSettingsButton]",
|
accountSettings: "[data-test-id=account-settings-button]",
|
||||||
emailAddressInput: "input[name='email']",
|
emailAddressInput: "input[name='email']",
|
||||||
emailPasswordInput: "input[name='password']",
|
emailPasswordInput: "input[name='password']",
|
||||||
signInButton: "[data-test=submit]",
|
signInButton: "[data-test-id=submit]",
|
||||||
userMenu: "[data-test=userMenu]",
|
userMenu: "[data-test=userMenu]",
|
||||||
warningCredentialMessage: "[data-test=loginErrorMessage]",
|
warningCredentialMessage: "[data-test-id=login-error-message]",
|
||||||
welcomePage: "[data-test=welcomeHeader]",
|
welcomePage: "[data-test-id=welcome-header]",
|
||||||
logOutButton: "[data-test='logOutButton']",
|
logOutButton: "[data-test-id='log-out-button']",
|
||||||
resetPasswordLink: "[data-test-id='reset-password-link']",
|
resetPasswordLink: "[data-test-id='reset-password-link']",
|
||||||
confirmPassword: "[name='confirmPassword']"
|
confirmPassword: "[name='confirmPassword']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const SET_PASSWORD = {
|
export const SET_PASSWORD = {
|
||||||
passwordInput: '[data-test="password"]',
|
passwordInput: '[data-test-id="password"]',
|
||||||
confirmPasswordInput: '[data-test="confirm-password"]'
|
confirmPasswordInput: '[data-test-id="confirm-password"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
export const APP_DETAILS = {
|
export const APP_DETAILS = {
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
manageAppsPermissionCheckbox: '[id="MANAGE_APPS"]',
|
manageAppsPermissionCheckbox: '[id="MANAGE_APPS"]',
|
||||||
createWebhookButton: '[data-test-id = "createWebhook"]',
|
createWebhookButton: '[data-test-id = "create-webhook"]',
|
||||||
createTokenButton: '[data-test-id="createToken"]',
|
createTokenButton: '[data-test-id="create-token"]',
|
||||||
createTokenForm: {
|
createTokenForm: {
|
||||||
tokenDialog: '[role="dialog"]',
|
tokenDialog: '[role="dialog"]',
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
tokenToCopy: '[data-test-id="generatedToken"]',
|
tokenToCopy: '[data-test-id="generated-token"]',
|
||||||
doneButton: '[data-test-id="done"]'
|
doneButton: '[data-test-id="done"]'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const APPS_LIST = {
|
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"]',
|
nameInput: '[name="name"]',
|
||||||
codeInput: '[name="slug"]',
|
codeInput: '[name="slug"]',
|
||||||
inputTypeSelect: '[id="mui-component-select-inputType"]',
|
inputTypeSelect: '[id="mui-component-select-inputType"]',
|
||||||
assignValuesButton: '[data-test-id="assignValueButton"]',
|
assignValuesButton: '[data-test-id="assign-value-button"]',
|
||||||
valueRequired: '[name="valueRequired"]',
|
valueRequired: '[name="valueRequired"]',
|
||||||
valueNameInput: '[data-test-id="valueName"]',
|
valueNameInput: '[data-test-id="value-name"]',
|
||||||
dashboardProperties: {
|
dashboardProperties: {
|
||||||
useInFilteringCheckbox: '[name="filterableInDashboard"]'
|
useInFilteringCheckbox: '[name="filterableInDashboard"]'
|
||||||
},
|
},
|
||||||
attributesInputTypes: {
|
attributesInputTypes: {
|
||||||
DROPDOWN: '[data-test-id="DROPDOWN"]',
|
DROPDOWN: '[data-test-id="select-field-option-DROPDOWN"]',
|
||||||
DATE: '[data-test-id="DATE"]',
|
DATE: '[data-test-id="select-field-option-DATE"]',
|
||||||
DATE_TIME: '[data-test-id="DATE_TIME"]',
|
DATE_TIME: '[data-test-id="select-field-option-DATE_TIME"]',
|
||||||
MULTISELECT: '[data-test-id="MULTISELECT"]',
|
MULTISELECT: '[data-test-id="select-field-option-MULTISELECT"]',
|
||||||
FILE: '[data-test-id="FILE"]',
|
FILE: '[data-test-id="select-field-option-FILE"]',
|
||||||
REFERENCE: '[data-test-id="REFERENCE"]',
|
REFERENCE: '[data-test-id="select-field-option-REFERENCE"]',
|
||||||
RICH_TEXT: '[data-test-id="RICH_TEXT"]',
|
RICH_TEXT: '[data-test-id="select-field-option-RICH_TEXT"]',
|
||||||
NUMERIC: '[data-test-id="NUMERIC"]',
|
NUMERIC: '[data-test-id="select-field-option-NUMERIC"]',
|
||||||
BOOLEAN: '[data-test-id="BOOLEAN"]',
|
BOOLEAN: '[data-test-id="select-field-option-BOOLEAN"]',
|
||||||
SWATCH: '[data-test-id="SWATCH"]'
|
SWATCH: '[data-test-id="select-field-option-SWATCH"]'
|
||||||
},
|
},
|
||||||
entityTypeSelect: '[id="mui-component-select-entityType"]',
|
entityTypeSelect: '[id="mui-component-select-entityType"]',
|
||||||
entityTypeOptions: {
|
entityTypeOptions: {
|
||||||
PRODUCT: '[data-test-id="PRODUCT"]',
|
PRODUCT: '[data-test-id*="PRODUCT"]',
|
||||||
PAGE: '[data-test-id="PAGE"]'
|
PAGE: '[data-test-id*="PAGE"]'
|
||||||
},
|
},
|
||||||
selectUnitCheckbox: '[name="selectUnit"]',
|
selectUnitCheckbox: '[name="selectUnit"]',
|
||||||
unitSystemSelect: '[data-test-id="unit-system"]',
|
unitSystemSelect: '[data-test-id="unit-system"]',
|
||||||
unitSystemsOptions: {
|
unitSystemsOptions: {
|
||||||
IMPERIAL: '[data-test-id="imperial"]',
|
IMPERIAL: '[data-test-id="select-field-option-imperial"]',
|
||||||
METRIC: '[data-test-id="metric"]'
|
METRIC: '[data-test-id="select-field-option-metric"]'
|
||||||
},
|
},
|
||||||
unitOfSelect: '[data-test-id="unit-of"]',
|
unitOfSelect: '[data-test-id="unit-of"]',
|
||||||
unitsOfOptions: {
|
unitsOfOptions: {
|
||||||
VOLUME: '[data-test-id="volume"]',
|
VOLUME: '[data-test-id="select-field-option-volume"]',
|
||||||
DISTANCE: '[data-test-id="distance"]'
|
DISTANCE: '[data-test-id="select-field-option-distance"]'
|
||||||
},
|
},
|
||||||
unitSelect: '[data-test-id="unit"]',
|
unitSelect: '[data-test-id="unit"]',
|
||||||
unitsOptions: {
|
unitsOptions: {
|
||||||
CUBIC_CENTIMETER: '[data-test-id="CUBIC_CENTIMETER"]',
|
CUBIC_CENTIMETER: '[data-test-id="select-field-option-CUBIC_CENTIMETER"]',
|
||||||
FT: '[data-test-id="FT"]'
|
FT: '[data-test-id="select-field-option-FT"]'
|
||||||
},
|
},
|
||||||
imageCheckbox: '[value= "image"]',
|
imageCheckbox: '[value= "image"]',
|
||||||
uploadFileButton: '[data-test="button-upload-file"]',
|
uploadFileButton: '[data-test-id="button-upload-file"]',
|
||||||
pageTypeAttributeCheckbox: '[value="PAGE_TYPE"]',
|
pageTypeAttributeCheckbox: '[value="PAGE_TYPE"]',
|
||||||
swatchValueImage: '[data-test-id="swatch-image"]'
|
swatchValueImage: '[data-test-id="swatch-image"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const ATTRIBUTES_LIST = {
|
export const ATTRIBUTES_LIST = {
|
||||||
createAttributeButton: '[data-test-id="createAttributeButton"]'
|
createAttributeButton: '[data-test-id="create-attribute-button"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const CATEGORIES_LIST = {
|
export const CATEGORIES_LIST = {
|
||||||
addCategoryButton: '[data-test-id="createCategory"]'
|
addCategoryButton: '[data-test-id="create-category"]'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const categoryRow = categoryId => `[data-test-id="${categoryId}"]`;
|
export const categoryRow = categoryId => `[data-test-id="${categoryId}"]`;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
export const CATEGORY_DETAILS = {
|
export const CATEGORY_DETAILS = {
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
descriptionInput: '[data-test-id="description"]',
|
descriptionInput: '[data-test-id="rich-text-editor-description"]',
|
||||||
createSubcategoryButton: '[data-test-id="createSubcategory"]',
|
createSubcategoryButton: '[data-test-id="create-subcategory"]',
|
||||||
categoryChildrenRow: '[data-test="id"]',
|
categoryChildrenRow: '[data-test-id*="id"]',
|
||||||
productsTab: '[data-test-id="productsTab"]',
|
productsTab: '[data-test-id="products-tab"]',
|
||||||
addProducts: '[data-test-id="addProducts"]',
|
addProducts: '[data-test-id="add-products"]',
|
||||||
productRow: '[data-test-id="productRow"]'
|
productRow: '[data-test-id="product-row"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,5 +3,5 @@ export const COLLECTION_SELECTORS = {
|
||||||
nameInput: "[name='name']",
|
nameInput: "[name='name']",
|
||||||
saveButton: "[data-test='button-bar-confirm']",
|
saveButton: "[data-test='button-bar-confirm']",
|
||||||
addProductButton: "[data-test-id='add-product']",
|
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 = {
|
export const GIFT_CARD_DIALOG = {
|
||||||
amountInput: '[name="balanceAmount"]',
|
amountInput: '[name="balanceAmount"]',
|
||||||
currencySelectButton: '[id="mui-component-select-balanceCurrency"]',
|
currencySelectButton: '[id="mui-component-select-balanceCurrency"]',
|
||||||
currenciesOptions: '[data-test="selectFieldOption"]',
|
currenciesOptions: '[data-test-id*="select-field-option"]',
|
||||||
expirationOptions: {
|
expirationOptions: {
|
||||||
setExpiryDateCheckbox: '[name="expirySelected"]',
|
setExpiryDateCheckbox: '[name="expirySelected"]',
|
||||||
neverExpireRadioButton: '[value="NEVER_EXPIRE"]',
|
neverExpireRadioButton: '[value="NEVER_EXPIRE"]',
|
||||||
|
@ -9,10 +9,10 @@ export const GIFT_CARD_DIALOG = {
|
||||||
expiryDateRadioButton: '[value="EXPIRY_DATE"]',
|
expiryDateRadioButton: '[value="EXPIRY_DATE"]',
|
||||||
expiryPeriodAmount: '[name="expiryPeriodAmount"]',
|
expiryPeriodAmount: '[name="expiryPeriodAmount"]',
|
||||||
expiryPeriodTypeButton: '[id*="select-expiryPeriodType"]',
|
expiryPeriodTypeButton: '[id*="select-expiryPeriodType"]',
|
||||||
expiryPeriodMonthType: '[data-test-id="MONTH"]',
|
expiryPeriodMonthType: '[data-test-id="select-field-option-MONTH"]',
|
||||||
expiryDateInput: '[name="expiryDate"]'
|
expiryDateInput: '[name="expiryDate"]'
|
||||||
},
|
},
|
||||||
noteInput: '[name="note"]',
|
noteInput: '[name="note"]',
|
||||||
cardCodeText: '[data-test-id="cardCode"]',
|
cardCodeText: '[data-test-id="card-code"]',
|
||||||
tagInput: '[data-test-id="gift-card-tag-select-field"]'
|
tagInput: '[data-test-id="gift-card-tag-select-field"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
export const PRODUCT_DETAILS = {
|
export const PRODUCT_DETAILS = {
|
||||||
productNameInput: "[name='name']",
|
productNameInput: "[name='name']",
|
||||||
productTypeInput: "[data-test='product-type']",
|
productTypeInput: "[data-test-id='product-type']",
|
||||||
categoryInput: "[data-test='category']",
|
categoryInput: "[data-test-id='category']",
|
||||||
categoryItem: "[data-test-id='singleautocomplete-select-option']",
|
categoryItem: "[data-test-id='single-autocomplete-select-option']",
|
||||||
collectionInput: "[data-test='collections']",
|
collectionInput: "[data-test-id='collections']",
|
||||||
autocompleteDropdown: "[data-test='autocomplete-dropdown']",
|
autocompleteDropdown: "[data-test-id='autocomplete-dropdown']",
|
||||||
firstCategoryItem: "#downshift-0-item-0",
|
firstCategoryItem: "#downshift-0-item-0",
|
||||||
visibleRadioBtn: "[name='isPublished']",
|
visibleRadioBtn: "[name='isPublished']",
|
||||||
channelAvailabilityItem: "[data-test='channel-availability-item']",
|
channelAvailabilityItem: "[data-test-id*='channel-availability-item']",
|
||||||
addVariantsButton: "[data-test*='button-add-variant']",
|
addVariantsButton: "[data-test-id*='button-add-variant']",
|
||||||
addVariantsOptionDialog: {
|
addVariantsOptionDialog: {
|
||||||
optionMultiple: '[data-test-id="variant-create-option-multiple"]',
|
optionMultiple: '[data-test-id="variant-create-option-multiple"]',
|
||||||
optionSingle: '[data-test-id="variant-create-option-single"]'
|
optionSingle: '[data-test-id="variant-create-option-single"]'
|
||||||
},
|
},
|
||||||
descriptionInput: "[data-test-id='description']",
|
descriptionInput: "[data-test-id='rich-text-editor-description']",
|
||||||
ratingInput: "[name='rating']",
|
ratingInput: "[name='rating']",
|
||||||
skuInput: "[name='sku']",
|
skuInput: "[name='sku']",
|
||||||
variantRow: "[data-test-id='product-variant-row']",
|
variantRow: "[data-test-id='product-variant-row']",
|
||||||
variantPrice: '[data-test="price"]',
|
variantPrice: '[data-test-id="price"]',
|
||||||
collectionRemoveButtons: '[data-test-id="collectionRemove"]',
|
collectionRemoveButtons: '[data-test-id="collection-remove"]',
|
||||||
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"]',
|
|
||||||
addWarehouseButton: '[data-test-id="add-warehouse"]',
|
addWarehouseButton: '[data-test-id="add-warehouse"]',
|
||||||
warehouseOption: "[role='menuitem']",
|
warehouseOption: "[role='menuitem']",
|
||||||
stockInput: '[data-test-id="stock-input"]',
|
stockInput: '[data-test-id="stock-input"]',
|
||||||
costPriceInput: '[name*="costPrice"]',
|
costPriceInput: '[name*="costPrice"]',
|
||||||
sellingPriceInput: '[name*="channel-price"]',
|
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 = {
|
export const PRODUCTS_LIST = {
|
||||||
productsList: "[data-test-id][data-test='id']",
|
productsList: "[data-test-id*='id']",
|
||||||
productsNames: "[data-test='name']",
|
productsNames: "[data-test-id='name']",
|
||||||
createProductBtn: "[data-test='add-product']",
|
createProductBtn: "[data-test-id='add-product']",
|
||||||
searchProducts: "[placeholder='Search Products...']",
|
searchProducts: "[placeholder='Search Products...']",
|
||||||
emptyProductRow: "[data-test-id='skeleton']",
|
emptyProductRow: "[data-test-id='skeleton']",
|
||||||
productImage: "[class='MuiAvatar-img']",
|
productImage: "[class='MuiAvatar-img']",
|
||||||
tableCellAvatar: "[data-test-id='tableCellAvatar']",
|
tableCellAvatar: "[data-test-id='table-cell-avatar']",
|
||||||
productRowElements: {
|
productRowElements: {
|
||||||
name: '[data-test="name"]',
|
name: '[data-test-id="name"]',
|
||||||
type: '[data-test="product-type"]',
|
type: '[data-test-id="product-type"]',
|
||||||
availability: '[data-test="availability"]',
|
availability: '[data-test-id="availability"]',
|
||||||
price: '[data-test="price"]'
|
price: '[data-test-id="price"]'
|
||||||
},
|
},
|
||||||
tableHeaders: {
|
tableHeaders: {
|
||||||
name: "[data-test-id='colNameHeader']",
|
name: "[data-test-id='col-name-header']",
|
||||||
type: "[data-test-id='colTypeHeader']",
|
type: "[data-test-id='col-type-header']",
|
||||||
availability: "[data-test-id='colAvailabilityHeader']",
|
availability: "[data-test-id='col-availability-header']",
|
||||||
price: "[data-test-id='colPriceHeader']"
|
price: "[data-test-id='col-price-header']"
|
||||||
},
|
},
|
||||||
showFiltersButton: '[data-test-id="show-filters-button"]',
|
showFiltersButton: '[data-test-id="show-filters-button"]',
|
||||||
filters: {
|
filters: {
|
||||||
filterOption: '[data-test-id="filterOption"]',
|
filterOption: '[data-test-id="filter-option"]',
|
||||||
productsOutOfStockOption: '[data-test-id="OUT_OF_STOCK"]',
|
productsOutOfStockOption: '[data-test-id="filter-option-OUT_OF_STOCK"]',
|
||||||
filterBy: {
|
filterBy: {
|
||||||
category: '[data-test="filterGroupActive"][data-test-id="categories"]',
|
category: '[data-test-id="filter-group-active-categories"]',
|
||||||
collection: '[data-test="filterGroupActive"][data-test-id="collections"]',
|
collection: '[data-test-id="filter-group-active-collections"]',
|
||||||
productType:
|
productType: '[data-test-id="filter-group-active-productType"]',
|
||||||
'[data-test="filterGroupActive"][data-test-id="productType"]',
|
stock: '[data-test-id="filter-group-active-stock"]',
|
||||||
stock: '[data-test="filterGroupActive"][data-test-id="stock"]',
|
channel: '[data-test-id="filter-group-active-channel"]'
|
||||||
channel: '[data-test="filterGroupActive"][data-test-id="channel"]'
|
|
||||||
},
|
},
|
||||||
filterField: {
|
filterField: {
|
||||||
filterField: '[data-test="filter-field"]',
|
filterField: '[data-test-id*="filter-field"]',
|
||||||
category: '[data-test="filter-field"][data-test-id="categories"]',
|
category: '[data-test-id="filter-field-categories"]',
|
||||||
collection: '[data-test="filter-field"][data-test-id="collections"]',
|
collection: '[data-test-id="filter-field-collections"]',
|
||||||
productType: '[data-test="filter-field"][data-test-id="productType"]',
|
productType: '[data-test-id="filter-field-productType"]',
|
||||||
stock: '[data-test="filter-field"][data-test-id="stock"]',
|
stock: '[data-test-id="filter-field-stock"]',
|
||||||
channel: '[data-test="filter-field"][data-test-id="channel"]'
|
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']",
|
nextPageButton: "[data-test='button-pagination-next']",
|
||||||
previousPagePagination: "[data-test='button-pagination-back']",
|
previousPagePagination: "[data-test='button-pagination-back']",
|
||||||
|
|
|
@ -4,9 +4,9 @@ export const VARIANTS_SELECTORS = {
|
||||||
nextButton: "[class*='MuiButton-containedPrimary']",
|
nextButton: "[class*='MuiButton-containedPrimary']",
|
||||||
warehouseCheckboxes: "[name*='warehouse:']",
|
warehouseCheckboxes: "[name*='warehouse:']",
|
||||||
skuInput: "[ name='sku']",
|
skuInput: "[ name='sku']",
|
||||||
attributeSelector: "[data-test='attribute-value']",
|
|
||||||
attributeOption:
|
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']",
|
addWarehouseButton: "[data-test-id='add-warehouse']",
|
||||||
warehouseOption: "[role='menuitem']",
|
warehouseOption: "[role='menuitem']",
|
||||||
saveButton: "[data-test='button-bar-confirm']",
|
saveButton: "[data-test='button-bar-confirm']",
|
||||||
|
|
|
@ -2,14 +2,14 @@ export const ADD_CHANNEL_FORM_SELECTORS = {
|
||||||
channelName: "[name='name']",
|
channelName: "[name='name']",
|
||||||
slug: "[name='slug']",
|
slug: "[name='slug']",
|
||||||
currency: "[data-test-id='channel-currency-select-input']",
|
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']",
|
saveButton: "[data-test='button-bar-confirm']",
|
||||||
backToChannelsList: "[data-test-id='app-header-back-button']",
|
backToChannelsList: "[data-test-id='app-header-back-button']",
|
||||||
currencyValidationMessage: "[data-testid='currency-text-input-helper-text']",
|
currencyValidationMessage: "[data-test-id='currency-text-input-helper-text']",
|
||||||
slugValidationMessage: "[data-testid='slug-text-input-helper-text']",
|
slugValidationMessage: "[data-test-id='slug-text-input-helper-text']",
|
||||||
currencyAutocompleteDropdown:
|
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"]',
|
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"]'
|
countryAutocompleteInput: '[data-test-id="country-select-input"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export const AVAILABLE_CHANNELS_FORM = {
|
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']",
|
assignedChannels: "[data-test-id='expand-icon']",
|
||||||
publishedRadioButtons: "[name*='isPublished']",
|
publishedRadioButtons: "[name*='isPublished']",
|
||||||
availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']",
|
availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']",
|
||||||
radioButtonsValueTrue: "[value='true']",
|
radioButtonsValueTrue: "[value='true']",
|
||||||
radioButtonsValueFalse: "[value='false']",
|
radioButtonsValueFalse: "[value='false']",
|
||||||
visibleInListingsButton: "[name*='visibleInListings']",
|
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 = {
|
export const CHANNEL_FORM_SELECTORS = {
|
||||||
channelSelect: "[id='mui-component-select-channels']",
|
channelSelect: "[id='mui-component-select-channels']",
|
||||||
channelOption: "[data-test='selectFieldOption']",
|
channelOption: "[data-test-id*='select-field-option']",
|
||||||
confirmButton: "[data-test='submit']"
|
confirmButton: "[data-test-id='submit']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const CHANNELS_SELECTORS = {
|
export const CHANNELS_SELECTORS = {
|
||||||
createChannelButton: "[data-test='add-channel']",
|
createChannelButton: "[data-test-id='add-channel']",
|
||||||
channelsTable: "[class='MuiTableBody-root']",
|
channelsTable: "[class='MuiTableBody-root']",
|
||||||
channelName: "[data-test='name']"
|
channelName: "[data-test-id='name']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
export const CONFIGURATION_SELECTORS = {
|
export const CONFIGURATION_SELECTORS = {
|
||||||
channels: "[data-testid='channels']",
|
channels: "[data-test-id*='channels']",
|
||||||
shipping: '[data-testid="shipping methods"]',
|
shipping: '[data-test-id*="shipping methods"]',
|
||||||
taxes: '[data-test-id="configurationMenuTaxes"]',
|
taxes: '[data-test-id*="configuration-menu-taxes"]',
|
||||||
settings: '[data-test-id="configurationMenuSiteSettings"]',
|
settings: '[data-test-id*="configuration-menu-site-settings"]',
|
||||||
pageTypes: '[data-test-id="configurationMenuPageTypes"]',
|
pageTypes: '[data-test-id*="configuration-menu-page-types"]',
|
||||||
pages: '[data-test-id="configurationMenuPages"]',
|
navigation: '[data-test-id*="configuration-menu-navigation"]',
|
||||||
navigation: '[data-test-id="configurationMenuNavigation"]',
|
staffMembers: '[data-test-id*="configuration-menu-staff"]',
|
||||||
staffMembers: '[data-test-id="configurationMenuStaff"]',
|
permissionGroups: '[data-test-id*="configuration-menu-permission-groups"]',
|
||||||
permissionGroups: '[data-test-id="configurationMenuPermissionGroups"]',
|
attributes: '[data-test-id*="configuration-menu-attributes"]',
|
||||||
attributes: '[data-test-id="configurationMenuAttributes"]',
|
productTypes: '[data-test-id*="configuration-menu-product-types"]',
|
||||||
productTypes: '[data-test-id="configurationMenuProductTypes"]',
|
plugin: '[data-test-id*="configuration-plugins-pages"]',
|
||||||
plugin: '[data-test-id="configurationPluginsPages"]',
|
warehouse: '[data-test-id*="configuration-menu-warehouses"]'
|
||||||
warehouse: '[data-test-id="configurationMenuWarehouses"]'
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ export const CUSTOMER_DETAILS = {
|
||||||
emailInput: '[name="email"]',
|
emailInput: '[name="email"]',
|
||||||
noteInput: '[name="note"]',
|
noteInput: '[name="note"]',
|
||||||
activeCheckbox: '[name="isActive"]',
|
activeCheckbox: '[name="isActive"]',
|
||||||
menageAddressesButton: '[data-test-id="manageAddresses"]',
|
menageAddressesButton: '[data-test-id="manage-addresses"]',
|
||||||
addAddressButton: '[data-test-id="add-address"]',
|
addAddressButton: '[data-test-id="add-address"]',
|
||||||
deleteAddressMenuItem: '[data-test-id="delete-address"]',
|
deleteAddressMenuItem: '[data-test-id="delete-address"]',
|
||||||
setAddressAsDefaultShipping: '[data-test-id="set-default-shipping-address"]',
|
setAddressAsDefaultShipping: '[data-test-id="set-default-shipping-address"]',
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const CUSTOMERS_LIST = {
|
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']",
|
ordersReadyToFulfill: "[data-test-id='orders-to-fulfill']",
|
||||||
paymentsWaitingForCapture: "[data-test-id='orders-to-capture']",
|
paymentsWaitingForCapture: "[data-test-id='orders-to-capture']",
|
||||||
productsOutOfStock: "[data-test-id='products-out-of-stock']",
|
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 = {
|
export const MENU_DETAILS = {
|
||||||
createNewMenuItemButton: '[data-test-id="createNewMenuItem"]',
|
createNewMenuItemButton: '[data-test-id="create-new-menu-item"]',
|
||||||
newMenuItemForm: {
|
newMenuItemForm: {
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
autocompleteSelectReference: '[data-test-id="containerAutocompleteSelect"]',
|
autocompleteSelectReference:
|
||||||
|
'[data-test-id="container-autocomplete-select"]',
|
||||||
categoryItem: '[data-test-id="category"]',
|
categoryItem: '[data-test-id="category"]',
|
||||||
collectionItem: '[data-test-id="collection"]',
|
collectionItem: '[data-test-id="collection"]',
|
||||||
pageItem: '[data-test-id="page"]',
|
pageItem: '[data-test-id="page"]',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const MENU_LIST = {
|
export const MENU_LIST = {
|
||||||
addMenuButton: '[data-test-id="addMenu"]',
|
addMenuButton: '[data-test-id="add-menu"]',
|
||||||
createMenuForm: {
|
createMenuForm: {
|
||||||
nameInput: '[name="name"]'
|
nameInput: '[name="name"]'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const ORDER_REFUND = {
|
export const ORDER_REFUND = {
|
||||||
productsQuantityInput: '[data-test="quantityInput"]'
|
productsQuantityInput: '[data-test-id*="quantity-input"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
export const ORDERS_SELECTORS = {
|
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']",
|
createOrder: "[data-test-id='create-order-button']",
|
||||||
orderRow: "[data-test-id='order-table-row']",
|
orderRow: "[data-test-id='order-table-row']",
|
||||||
salesChannel: "[data-test-id='order-sales-channel']",
|
salesChannel: "[data-test-id='order-sales-channel']",
|
||||||
cancelFulfillment: "[data-test-id='cancelFulfillmentButton']",
|
cancelFulfillment: "[data-test-id='cancel-fulfillment-button']",
|
||||||
cancelFulfillmentSelectField: "[data-test-id='cancelFulfillmentSelectField']",
|
cancelFulfillmentSelectField:
|
||||||
orderFulfillmentFrame: "[data-test-id='orderFulfillment']",
|
"[data-test-id='cancel-fulfillment-select-field']",
|
||||||
refundButton: '[data-test-id="refund-button"]'
|
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 = {
|
export const PAGE_TYPE_DETAILS = {
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
assignAttributesButton: '[data-test-id="assignAttributes"]'
|
assignAttributesButton: '[data-test-id="assign-attributes"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const PAGE_TYPES_LIST = {
|
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 = {
|
export const PAGE_DETAILS = {
|
||||||
nameInput: '[name="title"]',
|
nameInput: '[name="title"]',
|
||||||
pageTypesAutocompleteSelect: '[data-test-id="pageTypesAutocompleteSelect"]',
|
pageTypesAutocompleteSelect:
|
||||||
attributeValues: '[data-test="attribute-value"]',
|
'[data-test-id="page-types-autocomplete-select"]',
|
||||||
|
attributeValues: '[data-test-id="attribute-value"]',
|
||||||
isPublishedCheckbox: '[name="isPublished"][value=true]',
|
isPublishedCheckbox: '[name="isPublished"][value=true]',
|
||||||
uploadFileButton: '[data-test="button-upload-file"]',
|
uploadFileButton: '[data-test-id="button-upload-file"]',
|
||||||
richTextEditorAttributeValue: '[class*="ce-paragraph"]',
|
richTextEditorAttributeValue: '[class*="ce-paragraph"]',
|
||||||
booleanAttributeValueCheckbox: '[name*="attribute:"][type="checkbox"]',
|
booleanAttributeValueCheckbox: '[name*="attribute:"][type="checkbox"]',
|
||||||
numericAttributeValueInput: '[name*="attribute:"]'
|
numericAttributeValueInput: '[name*="attribute:"]'
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const PAGES_LIST = {
|
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"]',
|
'[id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"]',
|
||||||
assignMemberButton: '[data-test-id="assign-members"]',
|
assignMemberButton: '[data-test-id="assign-members"]',
|
||||||
searchField: '[name="query"]',
|
searchField: '[name="query"]',
|
||||||
removeUserButton: '[data-test-id="removeUser"]',
|
removeUserButton: '[data-test-id="remove-user"]',
|
||||||
userRow: '[data-test-id="userRow"]'
|
userRow: '[data-test-id="user-row"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const PERMISSION_GROUP_LIST = {
|
export const PERMISSION_GROUP_LIST = {
|
||||||
createPermissionButton: '[data-test-id="createPermissionGroup"]',
|
createPermissionButton: '[data-test-id="create-permission-group"]',
|
||||||
permissionGroupRow: '[data-test="id"]'
|
permissionGroupRow: '[data-test-id*="id-"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
export const PRODUCT_TYPE_DETAILS = {
|
export const PRODUCT_TYPE_DETAILS = {
|
||||||
nameInput: '[name="name"]',
|
nameInput: '[name="name"]',
|
||||||
isShippingRequired: '[name="isShippingRequired"]',
|
isShippingRequired: '[name="isShippingRequired"]',
|
||||||
assignProductAttributeButton: '[data-test-id="assignProductsAttributes"]',
|
assignProductAttributeButton: '[data-test-id="assign-products-attributes"]',
|
||||||
assignVariantAttributeButton: '[data-test-id="assignVariantsAttributes"]',
|
assignVariantAttributeButton: '[data-test-id="assign-variants-attributes"]',
|
||||||
hasVariantsButton: '[name="hasVariants"]',
|
hasVariantsButton: '[name="hasVariants"]',
|
||||||
shippingWeightInput: '[name="weight"]',
|
shippingWeightInput: '[name="weight"]',
|
||||||
giftCardKindCheckbox: '[data-test-id="product-type-kind-option-GIFT_CARD"]',
|
giftCardKindCheckbox: '[data-test-id="product-type-kind-option-GIFT_CARD"]',
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const PRODUCT_TYPES_LIST = {
|
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']",
|
variantTableRow: "[data-test-id='assign-variant-table-row']",
|
||||||
checkbox: "[type='checkbox']",
|
checkbox: "[type='checkbox']",
|
||||||
submitButton: "[type='submit']",
|
submitButton: "[type='submit']",
|
||||||
dialogContent: '[data-test-id="searchQuery"]'
|
dialogContent: '[data-test-id="search-query"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export const BUTTON_SELECTORS = {
|
export const BUTTON_SELECTORS = {
|
||||||
back: '[data-test-id="app-header-back-button"]',
|
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"]',
|
confirm: '[data-test="button-bar-confirm"]',
|
||||||
goBackButton: "[data-test-id='app-header-back-button']",
|
goBackButton: "[data-test-id='app-header-back-button']",
|
||||||
checkbox: "[type='checkbox']",
|
checkbox: "[type='checkbox']",
|
||||||
|
@ -11,7 +11,7 @@ export const BUTTON_SELECTORS = {
|
||||||
expandIcon: '[data-test-id="expand-icon"]',
|
expandIcon: '[data-test-id="expand-icon"]',
|
||||||
nextPaginationButton: '[data-test="button-pagination-next"]',
|
nextPaginationButton: '[data-test="button-pagination-next"]',
|
||||||
deleteIcon: '[data-test-id="delete-icon"]',
|
deleteIcon: '[data-test-id="delete-icon"]',
|
||||||
showMoreButton: '[data-test-id="showMoreButton"]',
|
showMoreButton: '[data-test-id="show-more-button"]',
|
||||||
button: "button",
|
button: "button",
|
||||||
deleteAssignedItemsConsentCheckbox: '[name="delete-assigned-items-consent"]'
|
deleteAssignedItemsConsentCheckbox: '[name="delete-assigned-items-consent"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
export const METADATA_FORM = {
|
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:
|
privateMetadataForm:
|
||||||
"[data-test='metadataEditor'][data-test-is-private='true']",
|
"[data-test-id='metadata-editor'][data-test-is-private='true']",
|
||||||
addFieldButton: "[data-test='addField']",
|
addFieldButton: "[data-test-id='add-field']",
|
||||||
nameInput: "[name*='name']",
|
nameInput: "[name*='name']",
|
||||||
valueField: "[name*='value']"
|
valueField: "[name*='value']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,11 +5,11 @@ export const SHARED_ELEMENTS = {
|
||||||
autocompleteCircle: '[class*="arrowInnerContainer"]',
|
autocompleteCircle: '[class*="arrowInnerContainer"]',
|
||||||
skeleton: '[data-test-id="skeleton"]',
|
skeleton: '[data-test-id="skeleton"]',
|
||||||
table: 'table[class*="Table"]',
|
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"]',
|
notificationSuccess: '[data-test="notification"][data-test-type="success"]',
|
||||||
dialog: '[role="dialog"]',
|
dialog: '[role="dialog"]',
|
||||||
searchInput: '[data-test-id="searchInput"]',
|
searchInput: '[data-test-id="search-input"]',
|
||||||
selectOption: '[data-test="selectFieldOption"]',
|
selectOption: '[data-test-id*="select-field-option"]',
|
||||||
svgImage: "svg",
|
svgImage: "svg",
|
||||||
fileInput: 'input[type="file"]',
|
fileInput: 'input[type="file"]',
|
||||||
urlInput: 'input[type="url"]',
|
urlInput: 'input[type="url"]',
|
||||||
|
@ -19,8 +19,8 @@ export const SHARED_ELEMENTS = {
|
||||||
},
|
},
|
||||||
contentEditable: '[contenteditable="true"]',
|
contentEditable: '[contenteditable="true"]',
|
||||||
filters: {
|
filters: {
|
||||||
filterGroupActivateCheckbox: '[data-test="filterGroupActive"]',
|
filterGroupActivateCheckbox: '[data-test-id*="filter-group-active"]',
|
||||||
filterRow: '[data-test="channel-availability-item"]'
|
filterRow: '[data-test-id*="channel-availability-item"]'
|
||||||
},
|
},
|
||||||
warningDialog: '[data-test-id="warning-dialog"]'
|
warningDialog: '[data-test-id="warning-dialog"]'
|
||||||
};
|
};
|
||||||
|
@ -28,4 +28,4 @@ export const SHARED_ELEMENTS = {
|
||||||
export const selectorWithDataValue = value => `[data-value="${value}"]`;
|
export const selectorWithDataValue = value => `[data-value="${value}"]`;
|
||||||
|
|
||||||
export const getElementByDataTestId = dataTestId =>
|
export const getElementByDataTestId = dataTestId =>
|
||||||
`[data-test-id=${dataTestId}]`;
|
`[data-test-id*=${dataTestId}]`;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const SELECT_SHIPPING_METHOD_FORM = {
|
export const SELECT_SHIPPING_METHOD_FORM = {
|
||||||
selectShippingMethod: "[id='mui-component-select-shippingMethod']",
|
selectShippingMethod: "[id='mui-component-select-shippingMethod']",
|
||||||
shippingMethodOption: "[data-test='selectFieldOption']",
|
shippingMethodOption: "[data-test-id*='select-field-option']",
|
||||||
submitButton: "[type='submit']"
|
submitButton: "[type='submit']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ export const SHIPPING_RATE_DETAILS = {
|
||||||
priceInput: "[name='price']",
|
priceInput: "[name='price']",
|
||||||
includePostalCodesCheckbox: '[value="INCLUDE"]',
|
includePostalCodesCheckbox: '[value="INCLUDE"]',
|
||||||
excludePostalCodesCheckbox: '[value="EXCLUDE"]',
|
excludePostalCodesCheckbox: '[value="EXCLUDE"]',
|
||||||
addPostalCodesButton: '[data-test="add-postal-code-range"]',
|
addPostalCodesButton: '[data-test-id="add-postal-code-range"]',
|
||||||
postalCodesForm: {
|
postalCodesForm: {
|
||||||
min: '[name="min"]',
|
min: '[name="min"]',
|
||||||
max: '[name="max"]'
|
max: '[name="max"]'
|
||||||
|
|
|
@ -13,5 +13,5 @@ export const SHIPPING_ZONE_DETAILS = {
|
||||||
option: "[data-test-id='multi-autocomplete-select-option']",
|
option: "[data-test-id='multi-autocomplete-select-option']",
|
||||||
warehouseSelector: "[placeholder*='Warehouse']",
|
warehouseSelector: "[placeholder*='Warehouse']",
|
||||||
channelSelector: "[placeholder*='Channel']",
|
channelSelector: "[placeholder*='Channel']",
|
||||||
removeWarehouseButton: "[data-test-id='warehousesRemove']"
|
removeWarehouseButton: "[data-test-id='warehouses-remove']"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const SHIPPING_ZONES_LIST = {
|
export const SHIPPING_ZONES_LIST = {
|
||||||
addShippingZone: "[data-test-id='add-shipping-zone']",
|
addShippingZone: "[data-test-id='add-shipping-zone']",
|
||||||
unitSelect: "[id='mui-component-select-unit']",
|
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 = {
|
export const STAFF_MEMBER_DETAILS = {
|
||||||
permissionsSelect: '[data-test="permissionGroups"]',
|
permissionsSelect: '[data-test-id="permission-groups"]',
|
||||||
isActiveCheckBox: '[name="isActive"]',
|
isActiveCheckBox: '[name="isActive"]',
|
||||||
removePermissionButton: '[data-test-id="remove"]'
|
removePermissionButton: '[data-test-id="remove"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const STAFF_MEMBERS_LIST = {
|
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"]',
|
editDescriptionButton: '[data-test-id="edit-description"]',
|
||||||
editSeoTitleButton: '[data-test-id="edit-seoTitle"]',
|
editSeoTitleButton: '[data-test-id="edit-seoTitle"]',
|
||||||
editSeoDescriptionButton: '[data-test-id="edit-seoDescription"]',
|
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 = {
|
export const WAREHOUSES_LIST = {
|
||||||
createNewButton: '[data-test-id="createWarehouse"]'
|
createNewButton: '[data-test-id="create-warehouse"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const PERMISSIONS = {
|
||||||
},
|
},
|
||||||
permissionSelectors: [
|
permissionSelectors: [
|
||||||
menuSelectors.DISCOUNTS_MENU_SELECTORS.sales,
|
menuSelectors.DISCOUNTS_MENU_SELECTORS.sales,
|
||||||
menuSelectors.DISCOUNTS_MENU_SELECTORS.sales
|
menuSelectors.DISCOUNTS_MENU_SELECTORS.vouchers
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
@ -41,7 +41,7 @@ export const PERMISSIONS = {
|
||||||
parent: configurationAsParent,
|
parent: configurationAsParent,
|
||||||
permissionSelectors: [
|
permissionSelectors: [
|
||||||
CONFIGURATION_SELECTORS.pageTypes,
|
CONFIGURATION_SELECTORS.pageTypes,
|
||||||
CONFIGURATION_SELECTORS.pages
|
menuSelectors.LEFT_MENU_SELECTORS.pages
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
/// <reference types="../support"/>
|
/// <reference types="../support"/>
|
||||||
|
|
||||||
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
|
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
|
||||||
|
import { HOMEPAGE_SELECTORS } from "../elements/homePage/homePage-selectors";
|
||||||
import { urlList } from "../fixtures/urlList";
|
import { urlList } from "../fixtures/urlList";
|
||||||
import filterTests from "../support/filterTests";
|
import filterTests from "../support/filterTests";
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
|
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
|
||||||
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
|
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
|
||||||
|
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
|
||||||
import { productDetailsUrl, variantDetailsUrl } from "../../fixtures/urlList";
|
import { productDetailsUrl, variantDetailsUrl } from "../../fixtures/urlList";
|
||||||
import {
|
import {
|
||||||
activatePreorderOnVariant,
|
activatePreorderOnVariant,
|
||||||
|
@ -71,7 +72,11 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
|
||||||
saveVariant()
|
saveVariant()
|
||||||
.then(({ response }) => {
|
.then(({ response }) => {
|
||||||
variant = response.body.data.productVariantCreate.productVariant;
|
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({
|
selectChannelForVariantAndFillUpPrices({
|
||||||
channelName: defaultChannel.name,
|
channelName: defaultChannel.name,
|
||||||
attributeName: attributeValues[1],
|
attributeName: attributeValues[1],
|
||||||
|
|
|
@ -16,10 +16,9 @@ filterTests({ definedTags: ["all"] }, () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
cy.visit(urlList.products);
|
cy.visit(urlList.products);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should go to the next page", () => {
|
it("Should go to the next page", () => {
|
||||||
cy.softExpectSkeletonIsVisible();
|
cy.softExpectSkeletonIsVisible()
|
||||||
cy.get(PRODUCTS_LIST.productsList)
|
|
||||||
.should("be.visible")
|
|
||||||
.get(PRODUCTS_LIST.emptyProductRow)
|
.get(PRODUCTS_LIST.emptyProductRow)
|
||||||
.should("not.exist")
|
.should("not.exist")
|
||||||
.get(PRODUCTS_LIST.previousPagePagination)
|
.get(PRODUCTS_LIST.previousPagePagination)
|
||||||
|
|
|
@ -29,6 +29,9 @@ export function fillUpShippingZoneData({
|
||||||
.clearAndType(shippingName)
|
.clearAndType(shippingName)
|
||||||
.get(SHIPPING_ZONE_DETAILS.descriptionInput)
|
.get(SHIPPING_ZONE_DETAILS.descriptionInput)
|
||||||
.clearAndType(shippingName)
|
.clearAndType(shippingName)
|
||||||
|
.get(BUTTON_SELECTORS.confirm)
|
||||||
|
.click()
|
||||||
|
.confirmationMessageShouldDisappear()
|
||||||
.get(SHIPPING_ZONE_DETAILS.assignCountryButton)
|
.get(SHIPPING_ZONE_DETAILS.assignCountryButton)
|
||||||
.click()
|
.click()
|
||||||
.get(SHIPPING_ZONE_DETAILS.searchInput)
|
.get(SHIPPING_ZONE_DETAILS.searchInput)
|
||||||
|
|
|
@ -40,7 +40,7 @@ const CustomAppTokens: React.FC<CustomAppTokensProps> = props => {
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={onCreate}
|
onClick={onCreate}
|
||||||
data-test-id="createToken"
|
data-test-id="create-token"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Create Token"
|
defaultMessage="Create Token"
|
||||||
|
|
|
@ -43,7 +43,7 @@ const CustomApps: React.FC<CustomAppsProps> = ({
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={navigateToCustomAppCreate}
|
onClick={navigateToCustomAppCreate}
|
||||||
data-test-id="createApp"
|
data-test-id="create-app"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Create App"
|
defaultMessage="Create App"
|
||||||
|
|
|
@ -89,7 +89,7 @@ const TokenCreateDialog: React.FC<TokenCreateDialogProps> = props => {
|
||||||
<Typography variant="caption">
|
<Typography variant="caption">
|
||||||
<FormattedMessage defaultMessage="Generated Token" />
|
<FormattedMessage defaultMessage="Generated Token" />
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography data-test-id="generatedToken">
|
<Typography data-test-id="generated-token">
|
||||||
{token}
|
{token}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button
|
<Button
|
||||||
|
@ -110,7 +110,7 @@ const TokenCreateDialog: React.FC<TokenCreateDialogProps> = props => {
|
||||||
<>
|
<>
|
||||||
<BackButton className={classes.cancel} onClick={onClose} />
|
<BackButton className={classes.cancel} onClick={onClose} />
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
>
|
>
|
||||||
|
|
|
@ -128,7 +128,7 @@ export const NumericUnits: React.FC<NumericUnitsProps> = ({
|
||||||
<div>
|
<div>
|
||||||
<div className={classes.hr} />
|
<div className={classes.hr} />
|
||||||
<ControlledCheckbox
|
<ControlledCheckbox
|
||||||
data-test="numeric-with-unit"
|
data-test-id="numeric-with-unit"
|
||||||
name="selectUnit"
|
name="selectUnit"
|
||||||
label={formatMessage(M.messages.selectUnit)}
|
label={formatMessage(M.messages.selectUnit)}
|
||||||
checked={data.unit !== null}
|
checked={data.unit !== null}
|
||||||
|
|
|
@ -190,8 +190,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
||||||
key={attribute ? attribute.id : "skeleton"}
|
key={attribute ? attribute.id : "skeleton"}
|
||||||
onClick={attribute && onRowClick(attribute.id)}
|
onClick={attribute && onRowClick(attribute.id)}
|
||||||
className={classes.link}
|
className={classes.link}
|
||||||
data-test="id"
|
data-test-id={"id-" + maybe(() => attribute.id)}
|
||||||
data-test-id={maybe(() => attribute.id)}
|
|
||||||
>
|
>
|
||||||
<TableCell padding="checkbox">
|
<TableCell padding="checkbox">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -201,15 +200,15 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
||||||
onChange={() => toggle(attribute.id)}
|
onChange={() => toggle(attribute.id)}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colSlug} data-test="slug">
|
<TableCell className={classes.colSlug} data-test-id="slug">
|
||||||
{attribute ? attribute.slug : <Skeleton />}
|
{attribute ? attribute.slug : <Skeleton />}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colName} data-test="name">
|
<TableCell className={classes.colName} data-test-id="name">
|
||||||
{attribute ? attribute.name : <Skeleton />}
|
{attribute ? attribute.name : <Skeleton />}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classes.colVisible}
|
className={classes.colVisible}
|
||||||
data-test="visible"
|
data-test-id="visible"
|
||||||
data-test-visible={maybe(() => attribute.visibleInStorefront)}
|
data-test-visible={maybe(() => attribute.visibleInStorefront)}
|
||||||
>
|
>
|
||||||
{attribute ? (
|
{attribute ? (
|
||||||
|
@ -220,7 +219,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classes.colSearchable}
|
className={classes.colSearchable}
|
||||||
data-test="searchable"
|
data-test-id="searchable"
|
||||||
data-test-searchable={maybe(
|
data-test-searchable={maybe(
|
||||||
() => attribute.filterableInDashboard
|
() => attribute.filterableInDashboard
|
||||||
)}
|
)}
|
||||||
|
@ -233,7 +232,7 @@ const AttributeList: React.FC<AttributeListProps> = ({
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classes.colFaceted}
|
className={classes.colFaceted}
|
||||||
data-test="use-in-faceted-search"
|
data-test-id="use-in-faceted-search"
|
||||||
data-test-use-in-faceted-search={maybe(
|
data-test-use-in-faceted-search={maybe(
|
||||||
() => attribute.filterableInStorefront
|
() => attribute.filterableInStorefront
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -61,7 +61,7 @@ const AttributeListPage: React.FC<AttributeListPageProps> = ({
|
||||||
<Button
|
<Button
|
||||||
onClick={onAdd}
|
onClick={onAdd}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
data-test-id="createAttributeButton"
|
data-test-id="create-attribute-button"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Create attribute"
|
defaultMessage="Create attribute"
|
||||||
|
|
|
@ -88,7 +88,7 @@ const AttributeSwatchField: React.FC<AttributeSwatchFieldProps<
|
||||||
name="swatch"
|
name="swatch"
|
||||||
value={type}
|
value={type}
|
||||||
onChange={event => setType(event.target.value)}
|
onChange={event => setType(event.target.value)}
|
||||||
data-test="swatch-radio"
|
data-test-id="swatch-radio"
|
||||||
/>
|
/>
|
||||||
{type === "image" ? (
|
{type === "image" ? (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -78,7 +78,7 @@ const AttributeValueEditDialog: React.FC<AttributeValueEditDialogProps> = ({
|
||||||
<>
|
<>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextField
|
<TextField
|
||||||
data-test-id="valueName"
|
data-test-id="value-name"
|
||||||
autoFocus
|
autoFocus
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
error={!!formErrors.name}
|
error={!!formErrors.name}
|
||||||
|
@ -108,7 +108,7 @@ const AttributeValueEditDialog: React.FC<AttributeValueEditDialogProps> = ({
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<BackButton onClick={onClose} />
|
<BackButton onClick={onClose} />
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
>
|
>
|
||||||
|
|
|
@ -98,7 +98,7 @@ const AttributeValues: React.FC<AttributeValuesProps> = ({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
onClick={onValueAdd}
|
onClick={onValueAdd}
|
||||||
data-test-id="assignValueButton"
|
data-test-id="assign-value-button"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Assign value"
|
defaultMessage="Assign value"
|
||||||
|
|
|
@ -61,7 +61,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
{error && (
|
{error && (
|
||||||
<div className={classes.panel} data-test="loginErrorMessage">
|
<div className={classes.panel} data-test-id="login-error-message">
|
||||||
{getErrorMessage(error, intl)}
|
{getErrorMessage(error, intl)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -74,7 +74,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
value={data.email}
|
value={data.email}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
"data-test": "email"
|
"data-test-id": "email"
|
||||||
}}
|
}}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
|
@ -91,7 +91,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
type={showPassword ? "text" : "password"}
|
type={showPassword ? "text" : "password"}
|
||||||
value={data.password}
|
value={data.password}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
"data-test": "password"
|
"data-test-id": "password"
|
||||||
}}
|
}}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
|
@ -111,6 +111,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
className={classes.link}
|
className={classes.link}
|
||||||
onClick={onPasswordRecovery}
|
onClick={onPasswordRecovery}
|
||||||
variant="body2"
|
variant="body2"
|
||||||
|
data-test-id="reset-password-link"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Forgot password?"
|
defaultMessage="Forgot password?"
|
||||||
|
@ -124,7 +125,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
variant="primary"
|
variant="primary"
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
type="submit"
|
type="submit"
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
>
|
>
|
||||||
<FormattedMessage defaultMessage="Sign in" description="button" />
|
<FormattedMessage defaultMessage="Sign in" description="button" />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -151,7 +152,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
onExternalAuthentication(externalAuthentication.id)
|
onExternalAuthentication(externalAuthentication.id)
|
||||||
}
|
}
|
||||||
data-test="external-authentication"
|
data-test-id="external-authentication"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{externalAuthentication.name}
|
{externalAuthentication.name}
|
||||||
|
|
|
@ -67,7 +67,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
|
||||||
type="password"
|
type="password"
|
||||||
value={data.password}
|
value={data.password}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
"data-test": "password"
|
"data-test-id": "password"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<FormSpacer />
|
<FormSpacer />
|
||||||
|
@ -90,7 +90,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
"data-test": "confirm-password"
|
"data-test-id": "confirm-password"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<FormSpacer />
|
<FormSpacer />
|
||||||
|
|
|
@ -53,12 +53,12 @@ const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
value={data.email}
|
value={data.email}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
"data-test": "email"
|
"data-test-id": "email"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<FormSpacer />
|
<FormSpacer />
|
||||||
<Button
|
<Button
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
className={classes.submit}
|
className={classes.submit}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
|
|
|
@ -161,8 +161,7 @@ const CategoryList: React.FC<CategoryListProps> = props => {
|
||||||
onClick={category ? onRowClick(category.id) : undefined}
|
onClick={category ? onRowClick(category.id) : undefined}
|
||||||
key={category ? category.id : "skeleton"}
|
key={category ? category.id : "skeleton"}
|
||||||
selected={isSelected}
|
selected={isSelected}
|
||||||
data-test="id"
|
data-test-id={"id-" + maybe(() => category.id)}
|
||||||
data-test-id={maybe(() => category.id)}
|
|
||||||
>
|
>
|
||||||
<TableCell padding="checkbox">
|
<TableCell padding="checkbox">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -172,7 +171,7 @@ const CategoryList: React.FC<CategoryListProps> = props => {
|
||||||
onChange={() => toggle(category.id)}
|
onChange={() => toggle(category.id)}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colName} data-test="name">
|
<TableCell className={classes.colName} data-test-id="name">
|
||||||
{category && category.name ? category.name : <Skeleton />}
|
{category && category.name ? category.name : <Skeleton />}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colSubcategories}>
|
<TableCell className={classes.colSubcategories}>
|
||||||
|
|
|
@ -57,7 +57,11 @@ export const CategoryListPage: React.FC<CategoryTableProps> = ({
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<PageHeader title={intl.formatMessage(sectionNames.categories)}>
|
<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
|
<FormattedMessage
|
||||||
defaultMessage="Create category"
|
defaultMessage="Create category"
|
||||||
description="button"
|
description="button"
|
||||||
|
|
|
@ -115,7 +115,7 @@ export const CategoryProductList: React.FC<CategoryProductListProps> = props =>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow
|
<TableRow
|
||||||
data-test-id="productRow"
|
data-test-id="product-row"
|
||||||
selected={isSelected}
|
selected={isSelected}
|
||||||
hover={!!product}
|
hover={!!product}
|
||||||
key={product ? product.id : "skeleton"}
|
key={product ? product.id : "skeleton"}
|
||||||
|
|
|
@ -54,7 +54,7 @@ export const CategoryProducts: React.FC<CategoryProductsProps> = ({
|
||||||
categories: [categoryId]
|
categories: [categoryId]
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Button variant="tertiary" data-test-id="viewProducts">
|
<Button variant="tertiary" data-test-id="view-products">
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="View products"
|
defaultMessage="View products"
|
||||||
description="button"
|
description="button"
|
||||||
|
@ -65,7 +65,7 @@ export const CategoryProducts: React.FC<CategoryProductsProps> = ({
|
||||||
<Button
|
<Button
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
onClick={onAdd}
|
onClick={onAdd}
|
||||||
data-test-id="addProducts"
|
data-test-id="add-products"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Add product"
|
defaultMessage="Add product"
|
||||||
|
|
|
@ -147,7 +147,7 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||||
/>
|
/>
|
||||||
</CategoriesTab>
|
</CategoriesTab>
|
||||||
<ProductsTab
|
<ProductsTab
|
||||||
testId="productsTab"
|
testId="products-tab"
|
||||||
isActive={currentTab === CategoryPageTab.products}
|
isActive={currentTab === CategoryPageTab.products}
|
||||||
changeTab={changeTab}
|
changeTab={changeTab}
|
||||||
>
|
>
|
||||||
|
@ -169,7 +169,7 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||||
<Button
|
<Button
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
onClick={onAddCategory}
|
onClick={onAddCategory}
|
||||||
data-test-id="createSubcategory"
|
data-test-id="create-subcategory"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Create subcategory"
|
defaultMessage="Create subcategory"
|
||||||
|
|
|
@ -94,7 +94,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
fullWidth
|
fullWidth
|
||||||
FormHelperTextProps={
|
FormHelperTextProps={
|
||||||
{
|
{
|
||||||
"data-testid": "slug-text-input-helper-text"
|
"data-test-id": "slug-text-input-helper-text"
|
||||||
} as ExtendedFormHelperTextProps
|
} as ExtendedFormHelperTextProps
|
||||||
}
|
}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
|
@ -146,7 +146,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
error={!!formErrors.currencyCode}
|
error={!!formErrors.currencyCode}
|
||||||
FormHelperTextProps={
|
FormHelperTextProps={
|
||||||
{
|
{
|
||||||
"data-testid": "currency-text-input-helper-text"
|
"data-test-id": "currency-text-input-helper-text"
|
||||||
} as ExtendedFormHelperTextProps
|
} as ExtendedFormHelperTextProps
|
||||||
}
|
}
|
||||||
helperText={getChannelsErrorMessage(
|
helperText={getChannelsErrorMessage(
|
||||||
|
@ -181,7 +181,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
error={!!formErrors.defaultCountry}
|
error={!!formErrors.defaultCountry}
|
||||||
FormHelperTextProps={
|
FormHelperTextProps={
|
||||||
{
|
{
|
||||||
"data-testid": "country-text-input-helper-text"
|
"data-test-id": "country-text-input-helper-text"
|
||||||
} as ExtendedFormHelperTextProps
|
} as ExtendedFormHelperTextProps
|
||||||
}
|
}
|
||||||
helperText={getChannelsErrorMessage(
|
helperText={getChannelsErrorMessage(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { FormHelperTextProps } from "@material-ui/core/FormHelperText";
|
import { FormHelperTextProps } from "@material-ui/core/FormHelperText";
|
||||||
|
|
||||||
export type ExtendedFormHelperTextProps = FormHelperTextProps & {
|
export type ExtendedFormHelperTextProps = FormHelperTextProps & {
|
||||||
"data-testid": string;
|
"data-test-id": string;
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@ const ShippingZonesCardListFooter: React.FC<ShippingZonesCardListFooterProps> =
|
||||||
<ClickAwayListener onClickAway={handleFooterClickAway}>
|
<ClickAwayListener onClickAway={handleFooterClickAway}>
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<SingleAutocompleteSelectField
|
<SingleAutocompleteSelectField
|
||||||
data-test-id="shippingAutoCompleteSelect"
|
data-test-id="shipping-auto-complete-select"
|
||||||
value=""
|
value=""
|
||||||
displayValue=""
|
displayValue=""
|
||||||
nakedInput
|
nakedInput
|
||||||
|
|
|
@ -71,7 +71,7 @@ export const ChannelsListPage: React.FC<ChannelsListPageProps> = ({
|
||||||
disabled={limitReached}
|
disabled={limitReached}
|
||||||
onClick={navigateToChannelCreate}
|
onClick={navigateToChannelCreate}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
data-test="add-channel"
|
data-test-id="add-channel"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Create Channel"
|
defaultMessage="Create Channel"
|
||||||
|
@ -118,7 +118,7 @@ export const ChannelsListPage: React.FC<ChannelsListPageProps> = ({
|
||||||
onClick={!!channel ? onRowClick(channel.id) : undefined}
|
onClick={!!channel ? onRowClick(channel.id) : undefined}
|
||||||
>
|
>
|
||||||
<TableCell className={classes.colName}>
|
<TableCell className={classes.colName}>
|
||||||
<span data-test="name">
|
<span data-test-id="name">
|
||||||
{channel?.name || <Skeleton />}
|
{channel?.name || <Skeleton />}
|
||||||
</span>
|
</span>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -169,8 +169,7 @@ const CollectionList: React.FC<CollectionListProps> = props => {
|
||||||
onClick={collection ? onRowClick(collection.id) : undefined}
|
onClick={collection ? onRowClick(collection.id) : undefined}
|
||||||
key={collection ? collection.id : "skeleton"}
|
key={collection ? collection.id : "skeleton"}
|
||||||
selected={isSelected}
|
selected={isSelected}
|
||||||
data-test="id"
|
data-test-id={"id-" + maybe(() => collection.id)}
|
||||||
data-test-id={maybe(() => collection.id)}
|
|
||||||
>
|
>
|
||||||
<TableCell padding="checkbox">
|
<TableCell padding="checkbox">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -180,7 +179,7 @@ const CollectionList: React.FC<CollectionListProps> = props => {
|
||||||
onChange={() => toggle(collection.id)}
|
onChange={() => toggle(collection.id)}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colName} data-test="name">
|
<TableCell className={classes.colName} data-test-id="name">
|
||||||
{maybe<React.ReactNode>(() => collection.name, <Skeleton />)}
|
{maybe<React.ReactNode>(() => collection.name, <Skeleton />)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.colProducts}>
|
<TableCell className={classes.colProducts}>
|
||||||
|
@ -191,7 +190,7 @@ const CollectionList: React.FC<CollectionListProps> = props => {
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classes.colAvailability}
|
className={classes.colAvailability}
|
||||||
data-test="availability"
|
data-test-id="availability"
|
||||||
data-test-availability={!!collection?.channelListings?.length}
|
data-test-availability={!!collection?.channelListings?.length}
|
||||||
>
|
>
|
||||||
{(!collection && <Skeleton />) ||
|
{(!collection && <Skeleton />) ||
|
||||||
|
|
|
@ -59,7 +59,7 @@ const AccountPermissionGroups: React.FC<AccountPermissionGroupsProps> = props =>
|
||||||
value={formData?.permissionGroups}
|
value={formData?.permissionGroups}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
fetchChoices={onSearchChange}
|
fetchChoices={onSearchChange}
|
||||||
data-test="permissionGroups"
|
data-test-id="permission-groups"
|
||||||
onFetchMore={onFetchMore}
|
onFetchMore={onFetchMore}
|
||||||
hasMore={hasMore}
|
hasMore={hasMore}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
|
|
@ -136,7 +136,7 @@ const AccountPermissions: React.FC<AccountPermissionsProps> = props => {
|
||||||
>
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test-id="fullAccess"
|
data-test-id="full-access"
|
||||||
color="primary"
|
color="primary"
|
||||||
edge="start"
|
edge="start"
|
||||||
checked={data.hasFullAccess}
|
checked={data.hasFullAccess}
|
||||||
|
|
|
@ -44,7 +44,6 @@ const DialogButtons: React.FC<DialogButtonsProps> = props => {
|
||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
error={variant === "delete"}
|
error={variant === "delete"}
|
||||||
data-test-id="submit"
|
data-test-id="submit"
|
||||||
data-test="submit"
|
|
||||||
>
|
>
|
||||||
{confirmButtonLabel ||
|
{confirmButtonLabel ||
|
||||||
(variant === "delete"
|
(variant === "delete"
|
||||||
|
|
|
@ -124,7 +124,7 @@ function useMenuStructure(
|
||||||
ariaLabel: "order drafts",
|
ariaLabel: "order drafts",
|
||||||
label: intl.formatMessage(commonMessages.drafts),
|
label: intl.formatMessage(commonMessages.drafts),
|
||||||
permissions: [PermissionEnum.MANAGE_ORDERS],
|
permissions: [PermissionEnum.MANAGE_ORDERS],
|
||||||
id: "order drafts",
|
id: "order-drafts",
|
||||||
url: orderDraftListUrl()
|
url: orderDraftListUrl()
|
||||||
},
|
},
|
||||||
...mapToExtensionsItems(
|
...mapToExtensionsItems(
|
||||||
|
|
|
@ -165,7 +165,7 @@ const AssignProductDialog: React.FC<AssignProductDialogProps> = props => {
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<BackButton onClick={onClose} />
|
<BackButton onClick={onClose} />
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
type="submit"
|
type="submit"
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
|
|
|
@ -280,7 +280,7 @@ const AssignVariantDialog: React.FC<AssignVariantDialogProps> = props => {
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<BackButton onClick={onClose} />
|
<BackButton onClick={onClose} />
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
data-test="submit"
|
data-test-id="submit"
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
type="submit"
|
type="submit"
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
|
|
|
@ -146,7 +146,7 @@ const Attributes: React.FC<AttributesProps> = ({
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
className={classes.expansionBarButton}
|
className={classes.expansionBarButton}
|
||||||
onClick={toggleExpansion}
|
onClick={toggleExpansion}
|
||||||
data-test="attributes-expand"
|
data-test-id="attributes-expand"
|
||||||
>
|
>
|
||||||
<ArrowDropDownIcon
|
<ArrowDropDownIcon
|
||||||
className={classNames(classes.expansionBarButtonIcon, {
|
className={classNames(classes.expansionBarButtonIcon, {
|
||||||
|
|
|
@ -51,12 +51,12 @@ const BasicAttributeRow: React.FC<BasicAttributeRowProps> = ({
|
||||||
<Grid className={classes.attributeSection} variant="uniform">
|
<Grid className={classes.attributeSection} variant="uniform">
|
||||||
<div
|
<div
|
||||||
className={classes.attributeSectionLabel}
|
className={classes.attributeSectionLabel}
|
||||||
data-test="attribute-label"
|
data-test-id="attribute-label"
|
||||||
>
|
>
|
||||||
<Typography>{label}</Typography>
|
<Typography>{label}</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
data-test="attribute-value"
|
data-test-id="attribute-value"
|
||||||
className={classNames(classes.value, {
|
className={classNames(classes.value, {
|
||||||
[classes.flex]: flexValueContainer
|
[classes.flex]: flexValueContainer
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -38,23 +38,23 @@ const ExtendedAttributeRow: React.FC<ExtendedAttributeRowProps> = props => {
|
||||||
<Grid className={classes.attributeSection} variant="uniform">
|
<Grid className={classes.attributeSection} variant="uniform">
|
||||||
<div
|
<div
|
||||||
className={classes.attributeSectionLabel}
|
className={classes.attributeSectionLabel}
|
||||||
data-test="attribute-label"
|
data-test-id="attribute-label"
|
||||||
>
|
>
|
||||||
<Typography>{label}</Typography>
|
<Typography>{label}</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div data-test="attribute-selector">
|
<div data-test-id="attribute-selector">
|
||||||
<Button
|
<Button
|
||||||
className={classes.attributeSectionButton}
|
className={classes.attributeSectionButton}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
data-test="button-attribute-selector"
|
data-test-id="button-attribute-selector"
|
||||||
onClick={onSelect}
|
onClick={onSelect}
|
||||||
>
|
>
|
||||||
{selectLabel}
|
{selectLabel}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</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 }) => (
|
{({ getItemProps, isOpen, openMenu, closeMenu, selectItem }) => (
|
||||||
<div
|
<div
|
||||||
className={classes.container}
|
className={classes.container}
|
||||||
data-test-id="containerAutocompleteSelect"
|
data-test-id="container-autocomplete-select"
|
||||||
>
|
>
|
||||||
<TextField
|
<TextField
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
|
|
@ -4,7 +4,7 @@ import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
const BackButton: React.FC<ButtonProps> = props => (
|
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} />
|
<FormattedMessage {...buttonMessages.back} />
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
|
@ -122,7 +122,7 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
||||||
return (
|
return (
|
||||||
<div className={className} {...rest}>
|
<div className={className} {...rest}>
|
||||||
<IconButton
|
<IconButton
|
||||||
data-test-id="showMoreButton"
|
data-test-id="show-more-button"
|
||||||
aria-label="More"
|
aria-label="More"
|
||||||
aria-owns={open ? "long-menu" : null}
|
aria-owns={open ? "long-menu" : null}
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
|
@ -163,7 +163,6 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
||||||
disabled={menuItem.loading || menuItem.disabled}
|
disabled={menuItem.loading || menuItem.disabled}
|
||||||
onClick={() => handleMenuClick(menuItemIndex)}
|
onClick={() => handleMenuClick(menuItemIndex)}
|
||||||
key={menuItem.label}
|
key={menuItem.label}
|
||||||
data-test={menuItem.testId}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classNames(className, {
|
className={classNames(className, {
|
||||||
|
|
|
@ -72,7 +72,10 @@ const ChannelContentWrapper: React.FC<ChannelContentWrapperProps> = ({
|
||||||
const { name } = data;
|
const { name } = data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Accordion classes={expanderClasses} data-test="channel-availability-item">
|
<Accordion
|
||||||
|
classes={expanderClasses}
|
||||||
|
data-test-id="channel-availability-item"
|
||||||
|
>
|
||||||
<AccordionSummary
|
<AccordionSummary
|
||||||
expandIcon={<IconChevronDown />}
|
expandIcon={<IconChevronDown />}
|
||||||
classes={summaryClasses}
|
classes={summaryClasses}
|
||||||
|
|
|
@ -57,7 +57,7 @@ export const ChannelsAvailabilityWrapper: React.FC<ChannelsAvailabilityWrapperPr
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
onClick={openModal}
|
onClick={openModal}
|
||||||
data-test-id="channels-availiability-manage-button"
|
data-test-id="channels-availability-manage-button"
|
||||||
>
|
>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
defaultMessage: "Manage",
|
defaultMessage: "Manage",
|
||||||
|
|
|
@ -35,7 +35,7 @@ const DeleteButton: React.FC<DeleteButtonProps> = ({
|
||||||
variant="primary"
|
variant="primary"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className={classes.button}
|
className={classes.button}
|
||||||
data-test="button-bar-delete"
|
data-test-id="button-bar-delete"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{label || intl.formatMessage(buttonMessages.delete)}
|
{label || intl.formatMessage(buttonMessages.delete)}
|
||||||
|
|
|
@ -105,7 +105,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = props => {
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={handleFileDelete}
|
onClick={handleFileDelete}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
data-test="button-delete-file"
|
data-test-id="button-delete-file"
|
||||||
>
|
>
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
@ -116,7 +116,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = props => {
|
||||||
onClick={clickFileInput}
|
onClick={clickFileInput}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
data-test="button-upload-file"
|
data-test-id="button-upload-file"
|
||||||
>
|
>
|
||||||
{intl.formatMessage(commonMessages.chooseFile)}
|
{intl.formatMessage(commonMessages.chooseFile)}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -133,7 +133,7 @@ const FileUploadField: React.FC<FileUploadFieldProps> = props => {
|
||||||
id="fileUpload"
|
id="fileUpload"
|
||||||
onChange={event => onFileUpload(event.target.files[0])}
|
onChange={event => onFileUpload(event.target.files[0])}
|
||||||
type="file"
|
type="file"
|
||||||
data-test="upload-file-input"
|
data-test-id="upload-file-input"
|
||||||
ref={fileInputAnchor}
|
ref={fileInputAnchor}
|
||||||
{...inputProps}
|
{...inputProps}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -118,7 +118,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
||||||
<div {...rest}>
|
<div {...rest}>
|
||||||
{filterField?.onSearchChange && (
|
{filterField?.onSearchChange && (
|
||||||
<TextField
|
<TextField
|
||||||
data-test="filterFieldAutocompleteInput"
|
data-test-id="filter-field-autocomplete-input"
|
||||||
className={classes.inputContainer}
|
className={classes.inputContainer}
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filterField.name + "_autocomplete"}
|
name={filterField.name + "_autocomplete"}
|
||||||
|
@ -135,8 +135,9 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test="filterFieldAutocompleteSelected"
|
data-test-id={
|
||||||
data-test-id={filterField.value}
|
"filter-field-autocomplete-selected-" + filterField.value
|
||||||
|
}
|
||||||
checked={filterField.value.includes(displayValue.value)}
|
checked={filterField.value.includes(displayValue.value)}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -149,7 +150,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
||||||
{displayHr && <Hr className={classes.hr} />}
|
{displayHr && <Hr className={classes.hr} />}
|
||||||
{displayNoResults && (
|
{displayNoResults && (
|
||||||
<Typography
|
<Typography
|
||||||
data-test="filterFieldAutocompleteNoResults"
|
data-test-id="filter-field-autocomplete-no-results"
|
||||||
className={classes.noResults}
|
className={classes.noResults}
|
||||||
color="textSecondary"
|
color="textSecondary"
|
||||||
>
|
>
|
||||||
|
@ -160,13 +161,14 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
||||||
<div
|
<div
|
||||||
className={classes.option}
|
className={classes.option}
|
||||||
key={option.value}
|
key={option.value}
|
||||||
data-test-id="filterOption"
|
data-test-id="filter-option"
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test="filterFieldAutocompleteOption"
|
data-test-id={
|
||||||
data-test-id={filterField.value}
|
"filter-field-autocomplete-option-" + filterField.value
|
||||||
|
}
|
||||||
checked={filterField.value.includes(option.value)}
|
checked={filterField.value.includes(option.value)}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -178,7 +180,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
||||||
))}
|
))}
|
||||||
{filterField.hasMore && (
|
{filterField.hasMore && (
|
||||||
<Link
|
<Link
|
||||||
data-test="filterFieldAutocompleteHasMore"
|
data-test-id="filter-field-autocomplete-has-more"
|
||||||
className={classes.showMore}
|
className={classes.showMore}
|
||||||
underline
|
underline
|
||||||
onClick={filterField.onFetchMore}
|
onClick={filterField.onFetchMore}
|
||||||
|
|
|
@ -216,8 +216,7 @@ const FilterContent: React.FC<FilterContentProps> = ({
|
||||||
<Accordion
|
<Accordion
|
||||||
key={filter.name}
|
key={filter.name}
|
||||||
classes={expanderClasses}
|
classes={expanderClasses}
|
||||||
data-test="channel-availability-item"
|
data-test-id={"channel-availability-item-" + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
expanded={filter.name === openedFilter?.name}
|
expanded={filter.name === openedFilter?.name}
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<AccordionSummary
|
||||||
|
|
|
@ -35,7 +35,7 @@ const useStyles = makeStyles(
|
||||||
{ name: "FilterContentBody" }
|
{ name: "FilterContentBody" }
|
||||||
);
|
);
|
||||||
|
|
||||||
const filterTestingContext = "filter-field";
|
const filterTestingContext = "filter-field-";
|
||||||
|
|
||||||
export interface FilterContentBodyProps<T extends string = string> {
|
export interface FilterContentBodyProps<T extends string = string> {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
@ -77,8 +77,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
||||||
{children}
|
{children}
|
||||||
{filter.type === FieldType.text && (
|
{filter.type === FieldType.text && (
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name}
|
name={filter.name}
|
||||||
InputProps={{ classes: { input: commonClasses.input } }}
|
InputProps={{ classes: { input: commonClasses.input } }}
|
||||||
|
@ -124,8 +123,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
||||||
|
|
||||||
{filter.type === FieldType.options && (
|
{filter.type === FieldType.options && (
|
||||||
<FilterOptionField
|
<FilterOptionField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
filterField={filter}
|
filterField={filter}
|
||||||
onFilterPropertyChange={onFilterPropertyChange}
|
onFilterPropertyChange={onFilterPropertyChange}
|
||||||
/>
|
/>
|
||||||
|
@ -139,7 +137,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Radio
|
<Radio
|
||||||
data-test="filterBoolean"
|
data-test-id="filter-boolean"
|
||||||
data-test-is-checked={filter.value[0] === option.value}
|
data-test-is-checked={filter.value[0] === option.value}
|
||||||
checked={filter.value[0] === option.value}
|
checked={filter.value[0] === option.value}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -163,8 +161,7 @@ const FilterContentBody: React.FC<FilterContentBodyProps> = ({
|
||||||
))}
|
))}
|
||||||
{filter.type === FieldType.autocomplete && (
|
{filter.type === FieldType.autocomplete && (
|
||||||
<FilterAutocompleteField
|
<FilterAutocompleteField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
displayValues={autocompleteDisplayValues}
|
displayValues={autocompleteDisplayValues}
|
||||||
filterField={filter}
|
filterField={filter}
|
||||||
setDisplayValues={setAutocompleteDisplayValues}
|
setDisplayValues={setAutocompleteDisplayValues}
|
||||||
|
|
|
@ -33,8 +33,7 @@ const FilterContentBodyNameField: React.FC<FilterContentBodyNameFieldProps> = ({
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test="filterGroupActive"
|
data-test-id={"filter-group-active-" + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
checked={filter.active}
|
checked={filter.active}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,14 +38,14 @@ const FilterContentHeader: React.FC<FilterContentHeaderProps> = ({
|
||||||
</Typography>
|
</Typography>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
data-test="clear"
|
data-test-id="clear"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
className={classes.clear}
|
className={classes.clear}
|
||||||
onClick={onClear}
|
onClick={onClear}
|
||||||
>
|
>
|
||||||
<FormattedMessage {...buttonMessages.clear} />
|
<FormattedMessage {...buttonMessages.clear} />
|
||||||
</Button>
|
</Button>
|
||||||
<Button data-test="submit" variant="primary" type="submit">
|
<Button data-test-id="submit" variant="primary" type="submit">
|
||||||
<FormattedMessage {...buttonMessages.done} />
|
<FormattedMessage {...buttonMessages.done} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -42,8 +42,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<TextField
|
<TextField
|
||||||
{...(isMultiple && { "data-test-range-type": "min" })}
|
{...(isMultiple && { "data-test-range-type": "min" })}
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + (isMultiple ? "_min" : "")}
|
name={filter.name + (isMultiple ? "_min" : "")}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
@ -64,8 +63,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
||||||
/>
|
/>
|
||||||
{isDateTime && (
|
{isDateTime && (
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
data-test-range-type="time_min"
|
data-test-range-type="time_min"
|
||||||
className={classes.inputTime}
|
className={classes.inputTime}
|
||||||
name={filter.name + (isMultiple ? "_time_min" : "")}
|
name={filter.name + (isMultiple ? "_time_min" : "")}
|
||||||
|
@ -98,8 +96,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
||||||
<div className={classes.inputRange}>
|
<div className={classes.inputRange}>
|
||||||
<div className={classes.spacer} />
|
<div className={classes.spacer} />
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
data-test-range-type="max"
|
data-test-range-type="max"
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + "_max"}
|
name={filter.name + "_max"}
|
||||||
|
@ -123,8 +120,7 @@ export const FilterDateTimeField: React.FC<FilterDateTimeFieldProps> = ({
|
||||||
/>
|
/>
|
||||||
{isDateTime && (
|
{isDateTime && (
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
className={classes.inputTime}
|
className={classes.inputTime}
|
||||||
data-test-range-type="time_max"
|
data-test-range-type="time_max"
|
||||||
name={filter.name + "_time_max"}
|
name={filter.name + "_time_max"}
|
||||||
|
|
|
@ -37,8 +37,7 @@ const FilterGroupLabel: React.FC<FilterGroupLabelProps> = ({
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test="filterGroupActive"
|
data-test-id={"filter-group-active-" + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
checked={filter.active}
|
checked={filter.active}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,7 @@ export const FilterNumericField: React.FC<FilterNumericFieldProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<TextField
|
<TextField
|
||||||
{...(isMultiple && { "data-test-range-type": "min" })}
|
{...(isMultiple && { "data-test-range-type": "min" })}
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + (isMultiple ? "_min" : "")}
|
name={filter.name + (isMultiple ? "_min" : "")}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
@ -72,8 +71,7 @@ export const FilterNumericField: React.FC<FilterNumericFieldProps> = ({
|
||||||
<div className={classes.inputRange}>
|
<div className={classes.inputRange}>
|
||||||
<div className={classes.spacer} />
|
<div className={classes.spacer} />
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
data-test-range-type="max"
|
data-test-range-type="max"
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + "_max"}
|
name={filter.name + "_max"}
|
||||||
|
|
|
@ -23,8 +23,7 @@ const FilterRangeField: React.FC<FilterRangeFieldProps> = ({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
data-test-range-type="min"
|
data-test-range-type="min"
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + "_min"}
|
name={filter.name + "_min"}
|
||||||
|
@ -55,8 +54,7 @@ const FilterRangeField: React.FC<FilterRangeFieldProps> = ({
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
data-test-range-type="max"
|
data-test-range-type="max"
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name + "_max"}
|
name={filter.name + "_max"}
|
||||||
|
|
|
@ -22,7 +22,7 @@ export const FilterSingleSelectField: React.FC<FilterSingleSelectFieldProps> = (
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SingleSelectField
|
<SingleSelectField
|
||||||
data-test="filterRangeTypeChoice"
|
data-test-id="filter-range-type-choice"
|
||||||
choices={getIsFilterMultipleChoices(intl)}
|
choices={getIsFilterMultipleChoices(intl)}
|
||||||
value={filter.multiple ? FilterType.MULTIPLE : FilterType.SINGULAR}
|
value={filter.multiple ? FilterType.MULTIPLE : FilterType.SINGULAR}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
|
|
@ -21,8 +21,7 @@ const FilterTextField: React.FC<FilterTextFieldProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextField
|
<TextField
|
||||||
data-test={filterTestingContext}
|
data-test-id={filterTestingContext + filter.name}
|
||||||
data-test-id={filter.name}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
name={filter.name}
|
name={filter.name}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue