diff --git a/apps/trading-e2e/src/integration/markets-page.feature b/apps/trading-e2e/src/integration/markets-page.feature index e81982a85..81698cba6 100644 --- a/apps/trading-e2e/src/integration/markets-page.feature +++ b/apps/trading-e2e/src/integration/markets-page.feature @@ -8,10 +8,10 @@ Feature: Markets page Scenario: Select active market Given I am on the markets page - When I click on "Active" market + When I click on "Active" mocked market Then trading page for "active" market is displayed Scenario: Select suspended market Given I am on the markets page - When I click on "Suspended" market + When I click on "Suspended" mocked market Then trading page for "suspended" market is displayed diff --git a/apps/trading-e2e/src/support/pages/markets-page.ts b/apps/trading-e2e/src/support/pages/markets-page.ts index 759d20c2a..2a2904fa7 100644 --- a/apps/trading-e2e/src/support/pages/markets-page.ts +++ b/apps/trading-e2e/src/support/pages/markets-page.ts @@ -7,6 +7,7 @@ export default class MarketPage extends BasePage { 'tradableInstrument.instrument.product.settlementAsset.symbol'; marketRowPrices = 'flash-cell'; marketRowDescription = 'name'; + marketStateColId = 'data'; validateMarketsAreDisplayed() { cy.get('.ag-root-wrapper').should('be.visible'); @@ -54,6 +55,8 @@ export default class MarketPage extends BasePage { } clickOnMarket(text: string) { - cy.contains(text).click(); + cy.get(`[col-id=${this.marketStateColId}]`) + .contains(text) + .click({ force: true }); } } diff --git a/apps/trading-e2e/src/support/step_definitions/trading-page.step.ts b/apps/trading-e2e/src/support/step_definitions/trading-page.step.ts index d83d98147..13116f1a3 100644 --- a/apps/trading-e2e/src/support/step_definitions/trading-page.step.ts +++ b/apps/trading-e2e/src/support/step_definitions/trading-page.step.ts @@ -14,9 +14,11 @@ import AccountsList from '../trading-windows/accounts-list'; import TradesList from '../trading-windows/trades-list'; import TradingPage from '../pages/trading-page'; import OrdersList from '../trading-windows/orders-list'; +import MarketPage from '../pages/markets-page'; const tradesList = new TradesList(); const tradingPage = new TradingPage(); +const marketPage = new MarketPage(); const positionsList = new PositionsList(); const accountList = new AccountsList(); const ordersList = new OrdersList(); @@ -97,15 +99,25 @@ Given('I am on the trading page for a suspended market', () => { cy.contains('Market: SUSPENDED MARKET'); }); +When('I click on {string} mocked market', (marketType) => { + switch (marketType) { + case 'Active': + mockMarket(MarketState.Active); + break; + case 'Suspended': + mockMarket(MarketState.Suspended); + break; + } + marketPage.clickOnMarket(marketType); +}); + Then('trading page for {string} market is displayed', (marketType) => { switch (marketType) { case 'active': - mockMarket(MarketState.Active); cy.wait('@Market'); cy.contains('Market: ACTIVE MARKET'); break; case 'suspended': - mockMarket(MarketState.Suspended); cy.wait('@Market'); cy.contains('Market: SUSPENDED MARKET'); break;