Skip to content

Commit

Permalink
Update api path in main after service account removal (opensearch-pro…
Browse files Browse the repository at this point in the history
…ject#1444)

* Update api path in main after service account removal

Signed-off-by: Derek Ho <[email protected]>

* Try fix for permissions page

Signed-off-by: Derek Ho <[email protected]>

* Remove only

Signed-off-by: Derek Ho <[email protected]>

* Fix the sanity tests

Signed-off-by: Derek Ho <[email protected]>

* Fix flaky test by differentiation

Signed-off-by: Derek Ho <[email protected]>

* Remove unused variable

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho authored Jul 23, 2024
1 parent 25f947d commit 98e90f4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
BASE_PATH,
SEC_UI_TENANTS_PATH,
SEC_INTERNALUSERS_FIXTURES_PATH,
SEC_API_INTERNAL_ACCOUNTS_PATH,
SEC_API_INTERNAL_USERS_PATH,
} from '../../../utils/constants';

if (Cypress.env('SECURITY_ENABLED')) {
Expand Down Expand Up @@ -65,7 +65,7 @@ if (Cypress.env('SECURITY_ENABLED')) {
// Navigate to Security/Internal User Database section

cy.visit(`${BASE_PATH}/app/security-dashboards-plugin#/users`);
cy.intercept(`${SEC_API_INTERNAL_ACCOUNTS_PATH}*`, {
cy.intercept(`${SEC_API_INTERNAL_USERS_PATH}*`, {
fixture:
SEC_INTERNALUSERS_FIXTURES_PATH + '/internalusers_info_response.json',
}).as('listUserResponse');
Expand All @@ -81,7 +81,7 @@ if (Cypress.env('SECURITY_ENABLED')) {
// Submit the form to create the user
cy.get('button').contains('Create').click();

cy.intercept(`${SEC_API_INTERNAL_ACCOUNTS_PATH}*`, {
cy.intercept(`${SEC_API_INTERNAL_USERS_PATH}*`, {
fixture:
SEC_INTERNALUSERS_FIXTURES_PATH +
'/internalusers_response_post_new_user_creation.json',
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/plugins/security/permissions_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if (Cypress.env('SECURITY_ENABLED')) {
cy.contains('button', 'Cancel');
cy.contains('.euiModalHeader__title', 'Create new action group');

const actionGroupName = 'test';
const actionGroupName = 'test-creation';
cy.get('input[data-test-subj="name-text"]').type(actionGroupName, {
force: true,
});
Expand Down Expand Up @@ -138,7 +138,7 @@ if (Cypress.env('SECURITY_ENABLED')) {
cy.contains('button', 'Cancel');
cy.contains('.euiModalHeader__title', 'Create new action group');

const actionGroupName = 'test';
const actionGroupName = 'test-selection';
cy.get('input[data-test-subj="name-text"]').type(actionGroupName, {
force: true,
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/utils/plugins/security/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import {
SEC_API_CONFIG_PATH,
SEC_API_ROLES_PATH,
SEC_API_INTERNAL_ACCOUNTS_PATH,
SEC_API_ACTIONGROUPS_PATH,
SEC_API_TENANTS_PATH,
SEC_API_AUDIT_PATH,
SEC_API_AUDIT_CONFIG_PATH,
SEC_API_CACHE_PURGE_PATH,
SEC_API_INTERNAL_USERS_PATH,
} from '../../constants';

/**
Expand Down Expand Up @@ -48,7 +48,7 @@ Cypress.Commands.add(
Cypress.Commands.add(
'mockInternalUsersAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(`${SEC_API_INTERNAL_ACCOUNTS_PATH}*`, {
cy.intercept(`${SEC_API_INTERNAL_USERS_PATH}*`, {
fixture: fixtureFileName,
}).as('getInternalUsersDetails');

Expand Down
2 changes: 0 additions & 2 deletions cypress/utils/plugins/security/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export const SEC_API_ACTIONGROUPS_PATH = BASE_SEC_API_PATH + '/actiongroups';
export const SEC_API_TENANTS_PATH = BASE_SEC_API_PATH + '/tenants';

export const SEC_API_INTERNAL_USERS_PATH = BASE_SEC_API_PATH + '/internalusers';
export const SEC_API_INTERNAL_ACCOUNTS_PATH =
BASE_SEC_API_PATH + '/internalaccounts';

export const SEC_API_ACCOUNT_PATH = BASE_SEC_API_PATH + '/account';

Expand Down

0 comments on commit 98e90f4

Please sign in to comment.