From 588abbb177ae7dde364c8513c2db6aa3b17f63f9 Mon Sep 17 00:00:00 2001 From: Sergej-Vlasov <37613182+Sergej-Vlasov@users.noreply.github.com> Date: Thu, 9 May 2024 18:12:03 +0300 Subject: [PATCH] DashboardScene: Adjust failing scenes e2e (#87553) * adjust failing scenes e2e * remove .only from test * restore e2e workflow --- .../load-options-from-url.spec.ts | 26 ++++++++++++++----- .../new-query-variable.spec.ts | 3 ++- .../set-options-from-ui.spec.ts | 24 ++++++++++++----- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/e2e/scenes/dashboard-suite/load-options-from-url.spec.ts b/e2e/scenes/dashboard-suite/load-options-from-url.spec.ts index 3d87b896947..677428a8be7 100644 --- a/e2e/scenes/dashboard-suite/load-options-from-url.spec.ts +++ b/e2e/scenes/dashboard-suite/load-options-from-url.spec.ts @@ -23,13 +23,15 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() .should('have.text', 'All') .parent() .next() + .should('have.text', 'A') + .next() .should('have.text', 'B') .next() .should('have.text', 'C') @@ -45,12 +47,14 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() .should('have.text', 'All') .parent() .next() + .should('have.text', 'AA') + .next() .should('have.text', 'AB') .next() .should('have.text', 'AC') @@ -66,13 +70,15 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() - .should('have.text', 'AAA') + .should('have.text', 'All') .parent() .next() + .should('have.text', 'AAA') + .next() .should('have.text', 'AAB') .next() .should('have.text', 'AAC') @@ -96,7 +102,7 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() @@ -105,6 +111,8 @@ describe('Variables - Load options from Url', () => { .next() .should('have.text', 'A') .next() + .should('have.text', 'B') + .next() .should('have.text', 'C') .next() .should('have.text', 'D'); @@ -118,7 +126,7 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() @@ -127,6 +135,8 @@ describe('Variables - Load options from Url', () => { .next() .should('have.text', 'BA') .next() + .should('have.text', 'BB') + .next() .should('have.text', 'BC') .next() .should('have.text', 'BD'); @@ -140,7 +150,7 @@ describe('Variables - Load options from Url', () => { .first() .click(); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() @@ -149,6 +159,8 @@ describe('Variables - Load options from Url', () => { .next() .should('have.text', 'BBA') .next() + .should('have.text', 'BBB') + .next() .should('have.text', 'BBC') .next() .should('have.text', 'BBD'); diff --git a/e2e/scenes/dashboard-suite/new-query-variable.spec.ts b/e2e/scenes/dashboard-suite/new-query-variable.spec.ts index c57fa011d3a..6f63d2ac46e 100644 --- a/e2e/scenes/dashboard-suite/new-query-variable.spec.ts +++ b/e2e/scenes/dashboard-suite/new-query-variable.spec.ts @@ -175,7 +175,8 @@ describe('Variables - Query - Add variable', () => { cy.get('input').click(); }); - e2e.components.Select.option().should('have.length', 1); + e2e.components.Select.option().should('have.length', 2); e2e.components.Select.option().contains('All'); + e2e.components.Select.option().contains('C'); }); }); diff --git a/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts b/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts index ac0775f966b..6ab14507b9c 100644 --- a/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts +++ b/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts @@ -24,12 +24,14 @@ describe('Variables - Set options from ui', () => { cy.get('input').click(); }); - e2e.components.Select.option().parent().should('have.length', 8); + e2e.components.Select.option().parent().should('have.length', 9); e2e.components.Select.option() .first() - .should('have.text', 'BA') + .should('have.text', 'All') .parent() .next() + .should('have.text', 'BA') + .next() .should('have.text', 'BB') .next() .should('have.text', 'BC'); @@ -47,9 +49,11 @@ describe('Variables - Set options from ui', () => { e2e.components.Select.option() .first() - .should('have.text', 'BAA') + .should('have.text', 'All') .parent() .next() + .should('have.text', 'BAA') + .next() .should('have.text', 'BAB') .next() .should('have.text', 'BAC') @@ -96,6 +100,8 @@ describe('Variables - Set options from ui', () => { .should('have.text', 'All') .parent() .next() + .should('have.text', 'AA') + .next() .should('have.text', 'AB') .next() .should('have.text', 'AC') @@ -110,13 +116,15 @@ describe('Variables - Set options from ui', () => { cy.get('input').click(); }); - e2e.components.Select.option().should('have.length', 8); + e2e.components.Select.option().should('have.length', 9); e2e.components.Select.option() .first() .should('have.text', 'All') .parent() .next() + .should('have.text', 'AAA') + .next() .should('have.text', 'AAB') .next() .should('have.text', 'AAC'); @@ -158,7 +166,7 @@ describe('Variables - Set options from ui', () => { cy.get('input').click(); }); - e2e.components.Select.option().should('have.length', 8); + e2e.components.Select.option().should('have.length', 9); e2e.components.Select.option() .first() @@ -167,6 +175,8 @@ describe('Variables - Set options from ui', () => { .next() .should('have.text', 'BA') .next() + .should('have.text', 'BB') + .next() .should('have.text', 'BC'); cy.get('body').click(0, 0); @@ -176,7 +186,7 @@ describe('Variables - Set options from ui', () => { .within(() => { cy.get('input').click(); }); - e2e.components.Select.option().should('have.length', 8); + e2e.components.Select.option().should('have.length', 9); e2e.components.Select.option() .first() @@ -185,6 +195,8 @@ describe('Variables - Set options from ui', () => { .next() .should('have.text', 'BBA') .next() + .should('have.text', 'BBB') + .next() .should('have.text', 'BBC'); }); });