From 8f9be66407414268950770d50b3ed02826946869 Mon Sep 17 00:00:00 2001 From: Kate Patticha Date: Wed, 28 Jun 2023 12:29:25 +0200 Subject: [PATCH] Test navigation of servlerss --- .../cypress/e2e/navigation.cy.ts | 80 ++++++++++++++++--- .../observability/cypress/support/e2e.ts | 12 +++ 2 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 x-pack/test_serverless/functional/test_suites/observability/cypress/support/e2e.ts diff --git a/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts b/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts index 487931bbf9baa..3d91f0c299998 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts @@ -7,22 +7,11 @@ describe('Serverless', () => { it('Should login', () => { - // TODO move to command - cy.visit('/', { - auth: { - username: 'elastic', - password: 'changeme', - }, - }); + cy.loginAsElasticUser(); }); it('contains the side navigation for observabilitity serverless', () => { - cy.visit('/', { - auth: { - username: 'elastic', - password: 'changeme', - }, - }); + cy.loginAsElasticUser(); cy.contains('Discover'); cy.contains('Dashboards'); cy.contains('Visualizations'); @@ -32,4 +21,69 @@ describe('Serverless', () => { cy.contains('Get started'); cy.contains('Management'); }); + + it('navigates to discover-dashboard-viz links', () => { + cy.loginAsElasticUser(); + + cy.contains('Discover').click(); + cy.url().should('include', '/app/discover'); + + cy.contains('Dashboard').click(); + cy.url().should('include', '/app/dashboards'); + + cy.contains('Visualizations').click(); + cy.url().should('include', '/app/visualize'); + }); + + it('navigates to alerts links', () => { + cy.loginAsElasticUser(); + + cy.contains('Alerts').click(); + cy.url().should('include', '/observability/alerts'); + + cy.contains('Cases').click(); + cy.url().should('include', '/observability/cases'); + + cy.contains('SLOs').click(); + cy.url().should('include', '/observability/slos'); + }); + + it('navigates to apm links', () => { + cy.loginAsElasticUser(); + + cy.contains('Services').click(); + cy.url().should('include', '/apm/services'); + + cy.contains('Traces').click(); + cy.url().should('include', '/apm/traces'); + + cy.contains('Dependencies').click(); + cy.url().should('include', '/apm/dependencies/inventory'); + }); + + it('navigates to get started links', () => { + cy.loginAsElasticUser(); + + cy.contains('Get started').click(); + cy.url().should('include', '/app/observabilityOnboarding'); + }); + + it('navigates to management links', () => { + cy.loginAsElasticUser(); + + cy.contains('Management').click(); + cy.contains('Stack Monitoring').click(); + cy.url().should('include', '/app/monitoring'); + + cy.contains('Integrations').click(); + cy.url().should('include', '/app/integrations/browse'); + + cy.contains('Fleet').click(); + cy.url().should('include', '/app/fleet/agents'); + + cy.contains('Osquery').click(); + cy.url().should('include', 'app/osquery'); + }); }); + +export {}; diff --git a/x-pack/test_serverless/functional/test_suites/observability/cypress/support/e2e.ts b/x-pack/test_serverless/functional/test_suites/observability/cypress/support/e2e.ts new file mode 100644 index 0000000000000..5f5d1eb3b3614 --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/observability/cypress/support/e2e.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +Cypress.on('uncaught:exception', (err, runnable) => { + return false; +}); + +import './commands';