From 31144cda5337af0ecb8d8539c7831daaad3a1079 Mon Sep 17 00:00:00 2001 From: k3yi0 Date: Wed, 29 Jun 2022 15:13:54 +0200 Subject: [PATCH] chore(cypress): adjust dashboard test --- ui/cypress/integration/dashboard.test.ts | 25 +++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ui/cypress/integration/dashboard.test.ts b/ui/cypress/integration/dashboard.test.ts index 9e2231ef3..54367d3fb 100644 --- a/ui/cypress/integration/dashboard.test.ts +++ b/ui/cypress/integration/dashboard.test.ts @@ -32,8 +32,8 @@ describe('Use Dashboards', () => { describe('Use Dashboards as reader', () => { beforeEach(() => { - cy.createDashboard('Reader Dashboard').then(() => { - cy.createChronografUser('Reader', 'oauth-mock', 'oauth2').then(() => { + cy.createChronografUser('Reader', 'oauth-mock', 'oauth2').then(() => { + cy.createDashboard('Reader Dashboard').then(() => { cy.getByTestID('dashboard-panel') .should('be.visible') .then(() => { @@ -65,13 +65,20 @@ describe('Use Dashboards', () => { cy.get('.template-control-bar').should('exist').and('be.visible') cy.get('.annotation-control-bar').should('not.exist') cy.getByTestID('show-annotations--button').should('be.visible').click() - cy.get('.annotation-control-bar').should('exist').and('be.visible').within(() => { - cy.getByTestID('add-template-variable').should('not.exist') - cy.getByTestID('add-annotation--button').should('not.exist') - cy.getByTestID('wizard-bucket-selected').click() - cy.getByTestID('dropdown--item').contains('Filter Annotations By Tags').click() - cy.getByTestID('add-annotation-filter--button').should('exist').and('be.visible') - }) + cy.get('.annotation-control-bar') + .should('exist') + .and('be.visible') + .within(() => { + cy.getByTestID('add-template-variable').should('not.exist') + cy.getByTestID('add-annotation--button').should('not.exist') + cy.getByTestID('wizard-bucket-selected').click() + cy.getByTestID('dropdown--item') + .contains('Filter Annotations By Tags') + .click() + cy.getByTestID('add-annotation-filter--button') + .should('exist') + .and('be.visible') + }) cy.reload().then(() => { cy.get('.page-header--title')