From e03520d1047851235738d337ea78f038d815c2c0 Mon Sep 17 00:00:00 2001 From: Paul Tavares Date: Mon, 24 Jul 2023 13:40:23 -0400 Subject: [PATCH] Tests for Security Complete with Endpoint Complete --- .../complete_with_endpoint.cy.ts | 23 ++++++++++++++++--- .../essentials_with_endpoint.cy.ts | 9 +++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/complete_with_endpoint.cy.ts b/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/complete_with_endpoint.cy.ts index 2a0cb1c5bafbd3..f39d0deea2ea4a 100644 --- a/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/complete_with_endpoint.cy.ts +++ b/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/complete_with_endpoint.cy.ts @@ -5,8 +5,9 @@ * 2.0. */ -// FIXME:PT Delete when implemented -export {}; +import { FLEET_BASE_PATH } from '@kbn/fleet-plugin/public/constants'; +import { login } from '../../../tasks/login'; +import { getEndpointManagementPageList } from '../../../lib'; describe( 'App Features for Complete PLI with Endpoint Complete', @@ -21,6 +22,22 @@ describe( }, }, () => { - // FIXME:PT implement + beforeEach(() => { + login(); + }); + + const allPages = getEndpointManagementPageList(); + + for (const { url, title, pageTestSubj } of allPages) { + it(`should allow access to ${title}`, () => { + cy.visit(url); + cy.getByTestSubj(pageTestSubj).should('exist'); + }); + } + + it(`should have access to Fleet`, () => { + cy.visit(FLEET_BASE_PATH); + cy.getByTestSubj('fleetAgentListTable').should('exist'); + }); } ); diff --git a/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/essentials_with_endpoint.cy.ts b/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/essentials_with_endpoint.cy.ts index a14514a54418be..b08c7304c47e4e 100644 --- a/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/essentials_with_endpoint.cy.ts +++ b/x-pack/test_serverless/functional/test_suites/security/cypress/e2e/endpoint_management/feature_access/essentials_with_endpoint.cy.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { FLEET_BASE_PATH } from '@kbn/fleet-plugin/public/constants'; import { login } from '../../../tasks/login'; import { getEndpointManagementPageMap } from '../../../lib'; @@ -32,8 +33,9 @@ describe( allPages.trustedApps, allPages.blocklist, allPages.eventFilters, + allPages.hostIsolationExceptions, ]; - const deniedPages = [allPages.hostIsolationExceptions, allPages.responseActionLog]; + const deniedPages = [allPages.responseActionLog]; for (const { url, title, pageTestSubj } of allowedPages) { it(`should allow access to ${title}`, () => { @@ -48,5 +50,10 @@ describe( cy.getByTestSubj('noPrivilegesPage').should('exist'); }); } + + it(`should have access to Fleet`, () => { + cy.visit(FLEET_BASE_PATH); + cy.getByTestSubj('fleetAgentListTable').should('exist'); + }); } );