From 02473e1609c9b605ef67b572444e52bc3530d3b2 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Thu, 24 Aug 2023 13:59:08 -0400 Subject: [PATCH] Update security and security-dashboards-plugin tests to run with Cypress12 Signed-off-by: Craig Perkins --- .../security-dashboards-plugin/aggregation_view.cy.js | 1 - .../plugins/security-dashboards-plugin/default_tenant.cy.js | 1 - .../inaccessible_tenancy_features.cy.js | 3 --- .../plugins/security-dashboards-plugin/multi_tenancy.cy.js | 1 - cypress/e2e/plugins/security/audit_log.cy.js | 6 ------ cypress/e2e/plugins/security/auth.cy.js | 6 ------ cypress/e2e/plugins/security/get_started.cy.js | 6 ------ cypress/e2e/plugins/security/internalusers.cy.js | 6 ------ cypress/e2e/plugins/security/permissions.cy.js | 6 ------ cypress/e2e/plugins/security/roles.cy.js | 6 ------ cypress/e2e/plugins/security/tenants.cy.js | 6 ------ 11 files changed, 48 deletions(-) diff --git a/cypress/e2e/plugins/security-dashboards-plugin/aggregation_view.cy.js b/cypress/e2e/plugins/security-dashboards-plugin/aggregation_view.cy.js index 93e9d6796..7d8a54309 100644 --- a/cypress/e2e/plugins/security-dashboards-plugin/aggregation_view.cy.js +++ b/cypress/e2e/plugins/security-dashboards-plugin/aggregation_view.cy.js @@ -29,7 +29,6 @@ if (Cypress.env('SECURITY_ENABLED') && Cypress.env('AGGREGATION_VIEW')) { // start a server so that server responses can be mocked via fixtures // in all of the below test cases before(() => { - cy.server(); cy.createTenant(tenantName, tenantDescription); cy.createIndexPattern('index-pattern1', { diff --git a/cypress/e2e/plugins/security-dashboards-plugin/default_tenant.cy.js b/cypress/e2e/plugins/security-dashboards-plugin/default_tenant.cy.js index 5a8162a74..4b479fcbc 100644 --- a/cypress/e2e/plugins/security-dashboards-plugin/default_tenant.cy.js +++ b/cypress/e2e/plugins/security-dashboards-plugin/default_tenant.cy.js @@ -13,7 +13,6 @@ const tenantName = 'test'; if (Cypress.env('SECURITY_ENABLED')) { describe('Multi Tenancy Default Tenant Tests: ', () => { before(() => { - cy.server(); cy.createTenant(tenantName, tenantDescription); cy.changeDefaultTenant({ multitenancy_enabled: true, diff --git a/cypress/e2e/plugins/security-dashboards-plugin/inaccessible_tenancy_features.cy.js b/cypress/e2e/plugins/security-dashboards-plugin/inaccessible_tenancy_features.cy.js index 8c938f463..90e0a60a1 100644 --- a/cypress/e2e/plugins/security-dashboards-plugin/inaccessible_tenancy_features.cy.js +++ b/cypress/e2e/plugins/security-dashboards-plugin/inaccessible_tenancy_features.cy.js @@ -7,9 +7,6 @@ import { TENANTS_MANAGE_PATH } from '../../../utils/dashboards/constants'; if (Cypress.env('SECURITY_ENABLED')) { describe('Multi Tenancy Tests: ', () => { - before(() => { - cy.server(); - }); it('Test Dashboards tenancy features should not be accessible ', () => { // This test is to ensure tenancy related features are not accessible when opensearch_security.multitenancy.enabled is disabled in the opensearchdashboard.yaml cy.visit(TENANTS_MANAGE_PATH); diff --git a/cypress/e2e/plugins/security-dashboards-plugin/multi_tenancy.cy.js b/cypress/e2e/plugins/security-dashboards-plugin/multi_tenancy.cy.js index 988b84412..c790a3840 100644 --- a/cypress/e2e/plugins/security-dashboards-plugin/multi_tenancy.cy.js +++ b/cypress/e2e/plugins/security-dashboards-plugin/multi_tenancy.cy.js @@ -19,7 +19,6 @@ const tenantName = 'test'; if (Cypress.env('SECURITY_ENABLED')) { describe('Multi Tenancy Tests: ', () => { before(() => { - cy.server(); cy.createTenant(tenantName, tenantDescription); cy.createIndexPattern( 'index-pattern1', diff --git a/cypress/e2e/plugins/security/audit_log.cy.js b/cypress/e2e/plugins/security/audit_log.cy.js index 369169b92..32a2a9f2d 100644 --- a/cypress/e2e/plugins/security/audit_log.cy.js +++ b/cypress/e2e/plugins/security/audit_log.cy.js @@ -10,12 +10,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Audit logs page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load Audit logs page properly', () => { cy.mockAuditLogsAction( SEC_AUDIT_FIXTURES_PATH + '/audit_info_response.json', diff --git a/cypress/e2e/plugins/security/auth.cy.js b/cypress/e2e/plugins/security/auth.cy.js index ffe9ceedd..049febfe9 100644 --- a/cypress/e2e/plugins/security/auth.cy.js +++ b/cypress/e2e/plugins/security/auth.cy.js @@ -10,12 +10,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Authc and Authz page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('authentication and authorization section should exist', () => { cy.mockAuthAction(SEC_FIXTURES_BASE_PATH + '/auth_response.json', () => { cy.visit(SEC_UI_AUTH_PATH); diff --git a/cypress/e2e/plugins/security/get_started.cy.js b/cypress/e2e/plugins/security/get_started.cy.js index 8e2dc3e4b..ec8e2fd54 100644 --- a/cypress/e2e/plugins/security/get_started.cy.js +++ b/cypress/e2e/plugins/security/get_started.cy.js @@ -10,12 +10,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Home(Get Started) page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load Home page properly', () => { cy.visit(BASE_SEC_UI_PATH); diff --git a/cypress/e2e/plugins/security/internalusers.cy.js b/cypress/e2e/plugins/security/internalusers.cy.js index ee2b838e1..5617b1ca0 100644 --- a/cypress/e2e/plugins/security/internalusers.cy.js +++ b/cypress/e2e/plugins/security/internalusers.cy.js @@ -11,12 +11,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Internal users page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load internal users page properly', () => { cy.mockInternalUsersAction( SEC_INTERNALUSERS_FIXTURES_PATH + '/internalusers_info_response.json', diff --git a/cypress/e2e/plugins/security/permissions.cy.js b/cypress/e2e/plugins/security/permissions.cy.js index d91fb0ad8..ba31a68c2 100644 --- a/cypress/e2e/plugins/security/permissions.cy.js +++ b/cypress/e2e/plugins/security/permissions.cy.js @@ -10,12 +10,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Permissions page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load Permissions page properly', () => { cy.mockPermissionsAction( SEC_PERMISSIONS_FIXTURES_PATH + '/actiongroups_response.json', diff --git a/cypress/e2e/plugins/security/roles.cy.js b/cypress/e2e/plugins/security/roles.cy.js index 46fa7c450..533812092 100644 --- a/cypress/e2e/plugins/security/roles.cy.js +++ b/cypress/e2e/plugins/security/roles.cy.js @@ -11,12 +11,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Roles page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load Roles page properly', () => { cy.mockRolesAction( SEC_ROLES_FIXTURES_PATH + '/roles_response.json', diff --git a/cypress/e2e/plugins/security/tenants.cy.js b/cypress/e2e/plugins/security/tenants.cy.js index d47e00378..59397b6be 100644 --- a/cypress/e2e/plugins/security/tenants.cy.js +++ b/cypress/e2e/plugins/security/tenants.cy.js @@ -10,12 +10,6 @@ import { if (Cypress.env('SECURITY_ENABLED')) { describe('Tenants page', () => { - // start a server so that server responses can be mocked via fixtures - // in all of the below test cases - before(() => { - cy.server(); - }); - it('should load Tenants page properly', () => { cy.mockTenantsAction( SEC_TENANTS_FIXTURES_PATH + '/tenants_info_response.json',