saleor-dashboard/cypress/elements/shared/sharedElements.js
Paweł Chyła b4f11eff66
Category listing datagrid (#3760)
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-07-04 09:23:27 +02:00

43 lines
1.6 KiB
JavaScript

export const SHARED_ELEMENTS = {
body: "body",
header: "[data-test-id='page-header']",
progressBar: '[role="progressbar"]',
circularProgress: '[class*="CircularProgress-circle"]',
autocompleteCircle: '[class*="arrowInnerContainer"]',
dataGridTable: "[data-testid='data-grid-canvas']",
skeleton: '[data-test-id="skeleton"]',
table: 'table[class*="Table"]',
firstRowDataGrid: "[data-testid='glide-cell-1-0']",
secondRowDataGrid: "[id='glide-cell-1-1']",
tableRow: '[data-test-id*="id"], [class*="MuiTableRow"]',
notificationSuccess:
'[data-test-id="notification"][data-test-type="success"]',
notificationFailure: '[data-test-id="notification"][data-test-type="error"]',
notificationMessage: '[data-test-id="notification-message"]',
dialog: '[role="dialog"]',
searchInput: '[data-test-id="search-input"]',
selectOption: '[data-test-id*="select-field-option"]',
svgImage: "svg",
fileInput: 'input[type="file"]',
pageHeader: '[data-test-id="page-header"]',
urlInput: 'input[type="url"]',
richTextEditor: {
loader: '[class*="codex-editor__loader"]',
empty: '[class*="codex-editor--empty"]',
},
contentEditable: '[contenteditable="true"]',
filters: {
filterGroupActivateCheckbox: '[data-test-id*="filter-group-active"]',
filterRow: '[data-test-id*="channel-availability-item"]',
},
warningDialog: '[data-test-id="warning-dialog"]',
pageHeader: "[data-test-id='page-header']",
multiAutocomplete: {
selectedOptions: '[id*="selected-option-"]',
},
};
export const selectorWithDataValue = value => `[data-value="${value}"]`;
export const getElementByDataTestId = dataTestId =>
`[data-test-id*=${dataTestId}]`;