Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow URL params for Security plugin intercept calls #1276

Merged
merged 15 commits into from
May 16, 2024
Merged
16 changes: 8 additions & 8 deletions cypress/utils/plugins/security/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
Cypress.Commands.add(
'mockAuthAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(SEC_API_CONFIG_PATH, {
cy.intercept(`${SEC_API_CONFIG_PATH}*`, {
fixture: fixtureFileName,
}).as('getAuthDetails');

Expand All @@ -35,7 +35,7 @@ Cypress.Commands.add(
Cypress.Commands.add(
'mockRolesAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(SEC_API_ROLES_PATH, {
cy.intercept(`${SEC_API_ROLES_PATH}*`, {
fixture: fixtureFileName,
}).as('getRoleDetails');

Expand All @@ -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_ACCOUNTS_PATH}*`, {
fixture: fixtureFileName,
}).as('getInternalUsersDetails');

Expand All @@ -61,7 +61,7 @@ Cypress.Commands.add(
Cypress.Commands.add(
'mockPermissionsAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(SEC_API_ACTIONGROUPS_PATH, {
cy.intercept(`${SEC_API_ACTIONGROUPS_PATH}*`, {
fixture: fixtureFileName,
}).as('getPermissions');

Expand All @@ -74,7 +74,7 @@ Cypress.Commands.add(
Cypress.Commands.add(
'mockTenantsAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(SEC_API_TENANTS_PATH, {
cy.intercept(`${SEC_API_TENANTS_PATH}*`, {
fixture: fixtureFileName,
}).as('getTenants');

Expand All @@ -87,7 +87,7 @@ Cypress.Commands.add(
Cypress.Commands.add(
'mockAuditLogsAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(SEC_API_AUDIT_PATH, {
cy.intercept(`${SEC_API_AUDIT_PATH}*`, {
fixture: fixtureFileName,
}).as('getAuditInfo');

Expand All @@ -101,7 +101,7 @@ Cypress.Commands.add(
'mockAuditConfigUpdateAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(
{ method: 'POST', url: SEC_API_AUDIT_CONFIG_PATH },
{ method: 'POST', url: `${SEC_API_AUDIT_CONFIG_PATH}*` },
{
fixture: fixtureFileName,
}
Expand All @@ -117,7 +117,7 @@ Cypress.Commands.add(
'mockCachePurgeAction',
function (fixtureFileName, funcMockedOn) {
cy.intercept(
{ method: 'DELETE', url: SEC_API_CACHE_PURGE_PATH },
{ method: 'DELETE', url: `${SEC_API_CACHE_PURGE_PATH}*` },
{
fixture: fixtureFileName,
}
Expand Down
Loading