From ea4c7a4a3746762f22b78b161cc06d0313283fc6 Mon Sep 17 00:00:00 2001 From: daro-maj <119658839+daro-maj@users.noreply.github.com> Date: Fri, 17 Feb 2023 15:31:14 +0100 Subject: [PATCH] test(trading): fixed dropdown issue in markets tests (#2930) --- apps/trading-e2e/src/integration/markets.cy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/trading-e2e/src/integration/markets.cy.ts b/apps/trading-e2e/src/integration/markets.cy.ts index c0cfac48f..5a8baf735 100644 --- a/apps/trading-e2e/src/integration/markets.cy.ts +++ b/apps/trading-e2e/src/integration/markets.cy.ts @@ -3,6 +3,8 @@ import { aliasGQLQuery } from '@vegaprotocol/cypress'; import { marketsQuery } from '@vegaprotocol/mock'; import { getDateTimeFormat } from '@vegaprotocol/react-helpers'; +const dialogCloseBtn = 'dialog-close'; + describe('markets table', { tags: '@smoke' }, () => { beforeEach(() => { cy.clearLocalStorage().then(() => { @@ -147,7 +149,7 @@ describe('markets table', { tags: '@smoke' }, () => { }); cy.visit('#/markets/market-0'); cy.url().should('contain', 'market-0'); - cy.getByTestId('dialog-close').click(); + cy.getByTestId(dialogCloseBtn).click(); cy.getByTestId('item-value').contains('Opening auction').realHover(); cy.getByTestId('opening-auction-sub-status').should( 'contain.text', @@ -171,7 +173,8 @@ describe('markets table', { tags: '@smoke' }, () => { }); function openMarketDropDown() { - cy.getByTestId('dialog-close').click(); + cy.getByTestId(dialogCloseBtn).should('be.visible'); + cy.getByTestId(dialogCloseBtn).click(); cy.getByTestId('popover-trigger').click(); cy.contains('Loading market data...').should('not.exist'); }