2024-08-12 10:41:27 -05:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const SAVE_BTN = '[type=submit]';
|
|
|
|
|
export const CANCEL_BTN = '.rose-form-actions [type=button]';
|
|
|
|
|
export const EDIT_BTN = '.rose-form-actions [type=button]';
|
2025-06-02 14:06:06 -04:00
|
|
|
export const DELETE_BTN = '.hds-dropdown-list-item--color-critical button';
|
2024-08-12 10:41:27 -05:00
|
|
|
|
|
|
|
|
export const FIELD_NAME = '[name=name]';
|
|
|
|
|
export const FIELD_NAME_VALUE = 'Random name';
|
2024-10-21 17:12:00 -05:00
|
|
|
export const FIELD_NAME_ERROR = '[data-test-error-message-name]';
|
|
|
|
|
|
|
|
|
|
export const FIELD_DESCRIPTION = '[name=description]';
|
|
|
|
|
export const FIELD_DESCRIPTION_VALUE = 'description';
|
2024-08-12 10:41:27 -05:00
|
|
|
|
2025-06-10 23:19:23 +02:00
|
|
|
export const FIELD_PASSWORD = '[name=password]';
|
|
|
|
|
export const FIELD_PASSWORD_VALUE = 'password';
|
|
|
|
|
|
2025-06-20 10:32:28 -07:00
|
|
|
export const FIELD_ERROR = '.hds-form-error__message'; // Selects any error message on the DOM.
|
2025-06-17 11:51:04 -07:00
|
|
|
export const FIELD_IDENTIFICATION = '[name=identification]';
|
|
|
|
|
|
2024-12-02 12:22:01 -08:00
|
|
|
export const TABLE_RESOURCE_LINK = (url) => `tbody [href="${url}"]`;
|
2025-05-21 12:20:48 -07:00
|
|
|
export const TABLE_ROWS = 'tbody tr';
|
|
|
|
|
export const TABLE_ROW = (row) => `tbody tr:nth-child(${row})`;
|
2025-03-13 09:51:37 -07:00
|
|
|
export const TABLE_ROW_CHECKBOX = 'tbody tr input[type="checkbox"]';
|
2025-03-14 10:32:44 -05:00
|
|
|
export const TABLE_FIRST_ROW_ACTION_DROPDOWN =
|
|
|
|
|
'tbody tr:first-child td:last-child button';
|
2025-03-14 16:04:56 -07:00
|
|
|
export const TABLE_FIRST_ROW_ACTION_DROPDOWN_ITEM_BTN =
|
|
|
|
|
'tbody tr:first-child td:last-child ul li button';
|
|
|
|
|
export const TABLE_FIRST_ROW_ACTION_DROPDOWN_ITEM_LINK =
|
|
|
|
|
'tbody tr:first-child td:last-child ul li a';
|
2024-08-12 10:41:27 -05:00
|
|
|
|
2024-12-04 14:16:05 -08:00
|
|
|
export const RESOURCE_NOT_FOUND_SUBTITLE =
|
|
|
|
|
'[data-test-error-application-state] .hds-application-state__error-code';
|
|
|
|
|
export const RESOURCE_NOT_FOUND_VALUE = 'ERROR 404';
|
2024-08-12 10:41:27 -05:00
|
|
|
|
2025-01-22 14:32:16 -08:00
|
|
|
export const PAGE_MESSAGE_HEADER = '.hds-application-state__header';
|
2024-12-04 14:16:05 -08:00
|
|
|
export const PAGE_MESSAGE_DESCRIPTION = '.hds-application-state__body-text';
|
|
|
|
|
export const PAGE_MESSAGE_LINK =
|
|
|
|
|
'.hds-application-state__footer .hds-link-standalone';
|
2024-09-06 09:56:24 -05:00
|
|
|
|
2024-08-12 10:41:27 -05:00
|
|
|
export const HREF = (url) => `[href="${url}"]`;
|
2024-09-06 09:56:24 -05:00
|
|
|
|
2025-04-17 10:57:45 -07:00
|
|
|
export const SIDEBAR_NAV_LINK = (url) =>
|
|
|
|
|
`.hds-side-nav__content a[href="${url}"]`;
|
2025-04-14 14:27:02 -07:00
|
|
|
export const SIDEBAR_NAV_CONTENT = '.hds-side-nav__content';
|
|
|
|
|
export const SIDEBAR_USER_DROPDOWN =
|
|
|
|
|
'[data-test-side-nav-user-dropdown] button';
|
2025-06-20 10:32:28 -07:00
|
|
|
export const SIDEBAR_SCOPE_DROPDOWN =
|
|
|
|
|
'[data-test-side-nav-scope-dropdown] button';
|
|
|
|
|
export const SIDEBAR_SCOPE_LINK = (url) =>
|
|
|
|
|
`[data-test-side-nav-scope-dropdown] a[href="${url}"]`;
|
2025-06-17 11:51:04 -07:00
|
|
|
export const TOGGLE_THEME_DEFAULT =
|
|
|
|
|
'[data-test-side-nav-user-dropdown] [value=system-default-theme]';
|
|
|
|
|
export const TOGGLE_THEME_LIGHT =
|
|
|
|
|
'[data-test-side-nav-user-dropdown] [value=light]';
|
|
|
|
|
export const TOGGLE_THEME_DARK =
|
|
|
|
|
'[data-test-side-nav-user-dropdown] [value=dark]';
|
2024-10-18 09:56:31 -05:00
|
|
|
|
2024-11-19 15:18:18 -08:00
|
|
|
export const ALERT_TOAST = '[data-test-toast-notification]';
|
|
|
|
|
export const ALERT_TOAST_BODY =
|
|
|
|
|
'[data-test-toast-notification] .hds-alert__description';
|
|
|
|
|
export const ALERT_TOAST_DISMISS =
|
|
|
|
|
'[data-test-toast-notification] .hds-dismiss-button';
|
2024-12-09 09:42:16 -08:00
|
|
|
|
2024-12-20 14:16:43 -05:00
|
|
|
export const MODAL_WARNING = 'dialog';
|
|
|
|
|
export const MODAL_WARNING_CONFIRM_BTN =
|
|
|
|
|
'dialog .hds-modal__footer button:first-child';
|
|
|
|
|
export const MODAL_WARNING_CANCEL_BTN =
|
|
|
|
|
'dialog .hds-modal__footer button:last-child';
|
|
|
|
|
export const MODAL_WARNING_TITLE = '.hds-modal__header';
|
|
|
|
|
export const MODAL_WARNING_MESSAGE = '.hds-modal__body';
|
2025-01-22 14:32:16 -08:00
|
|
|
|
2025-06-17 11:51:04 -07:00
|
|
|
export const AUTH_SCOPE_DROPDOWN = '.hds-dropdown button';
|
|
|
|
|
export const AUTH_SCOPE_DROPDOWN_OPTIONS = '.hds-dropdown a';
|
|
|
|
|
|
2025-02-10 17:41:37 -06:00
|
|
|
// Search filtering selectors
|
|
|
|
|
export const SEARCH_INPUT = '.search-filtering [type="search"]';
|
2025-01-22 14:32:16 -08:00
|
|
|
export const FILTER_DROPDOWN = (filterName) =>
|
|
|
|
|
`.search-filtering [name="${filterName}"] button`;
|
|
|
|
|
export const FILTER_DROPDOWN_ITEM = (itemList) => `input[value="${itemList}"]`;
|
|
|
|
|
export const FILTER_DROPDOWN_ITEM_APPLY_BTN = (filterName) =>
|
|
|
|
|
`.search-filtering [name="${filterName}"] .hds-dropdown__footer button`;
|
2025-03-28 13:11:33 -05:00
|
|
|
|
|
|
|
|
export const PAGINATION = '[data-test-pagination]';
|
2025-03-28 15:00:59 -07:00
|
|
|
export const LINK_LIST_ITEM_TEXT = '.link-list-item__text';
|
|
|
|
|
export const FORM = 'main form';
|
2025-05-21 12:20:48 -07:00
|
|
|
|
|
|
|
|
// Sorting selectors
|
|
|
|
|
export const TABLE_SORT_BTN = (column) =>
|
|
|
|
|
`thead tr th:nth-child(${column}) button`;
|
|
|
|
|
export const TABLE_SORT_BTN_ARROW_UP = (column) =>
|
|
|
|
|
`thead tr th:nth-child(${column}) button .hds-icon-arrow-up`;
|
|
|
|
|
export const TABLE_SORT_BTN_ARROW_DOWN = (column) =>
|
|
|
|
|
`thead tr th:nth-child(${column}) button .hds-icon-arrow-down`;
|
2025-07-10 15:34:24 -07:00
|
|
|
|
|
|
|
|
export const CODE_EDITOR_CONTENT =
|
|
|
|
|
'[data-test-code-editor-field-editor] textarea';
|