* chore: 🤖 add test selectors to roles list tests * chore: 🤖 add test selectors for roles global-scope tests * chore: 🤖 add TABLE_RESOURCE_LINK to global-scope tests * test: 💍 change exists to isVisible
46 lines
2.0 KiB
JavaScript
46 lines
2.0 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
export const NEW_ROLE_BTN = '[data-test-new-role-button]';
|
|
|
|
export const MANAGE_DROPDOWN_ROLES = '[data-test-manage-roles-dropdown] button';
|
|
export const MANAGE_DROPDOWN_ROLES_PRINCIPALS =
|
|
'[data-test-manage-dropdown-principals]';
|
|
export const MANAGE_DROPDOWN_ROLES_SCOPES =
|
|
'[data-test-manage-dropdown-scopes]';
|
|
export const MANAGE_DROPDOWN_ROLES_REMOVE =
|
|
'[data-test-manage-roles-dropdown] div:last-child button';
|
|
|
|
export const ROLE_BADGE = (id) =>
|
|
`tbody [data-test-role-row="${id}"] td:nth-child(2) .hds-badge__text`;
|
|
export const ROLE_TOOLTIP_BTN = (id) =>
|
|
`tbody [data-test-role-row="${id}"] td:nth-child(2) .hds-tooltip-button`;
|
|
export const ROLE_TOOLTIP_CONTENT = (id) =>
|
|
`tbody [data-test-role-row="${id}"] td:nth-child(2) [data-tippy-root]`;
|
|
export const GRANT_SCOPE_ROW = (id) =>
|
|
`tbody [data-test-grant-scope-row="${id}"]`;
|
|
export const GRANT_SCOPE_PARENT_SCOPE =
|
|
'tbody tr:nth-child(2) td:nth-child(3) a';
|
|
export const TABLE_ALL_CHECKBOX = 'thead input[type="checkbox"]';
|
|
|
|
export const NO_RESULTS_MSG = '[data-test-no-role-results]';
|
|
export const NO_RESULTS_GRANT_SCOPE_MSG = '[data-test-no-grant-scope-results]';
|
|
|
|
export const NO_SCOPES_MSG = '.role-grant-scopes div';
|
|
export const NO_SCOPES_MSG_LINK = '.role-grant-scopes div div:nth-child(3) a';
|
|
|
|
// Manage scopes selectors
|
|
export const SCOPE_TOGGLE = (name) => `.hds-form-toggle input[name="${name}"]`;
|
|
export const SCOPE_CHECKBOX = (type, id) =>
|
|
`tbody [data-test-${type}-scopes-table-row="${id}"] input`;
|
|
export const MANAGE_CUSTOM_SCOPES_BUTTON_ICON =
|
|
'[data-test-manage-custom-scopes-button] [data-test-icon="check-circle"]';
|
|
export const REMOVE_ORG_MODAL = (name) =>
|
|
`[data-test-manage-scopes-remove-${name}-modal]`;
|
|
export const REMOVE_ORG_ONLY_BTN = (name) =>
|
|
`[data-test-manage-scopes-remove-${name}-modal] div:nth-child(3) button:last-of-type`;
|
|
export const REMOVE_ORG_PROJECTS_BTN = (name) =>
|
|
`[data-test-manage-scopes-remove-${name}-modal] div:nth-child(3) button`;
|