test(trading): improved a dropdown verification test (#2969)

This commit is contained in:
daro-maj 2023-02-23 11:16:22 +01:00 committed by GitHub
parent afdb387742
commit eee85c231b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -18,9 +18,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Use Node.js 16
id: Node
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 16.15.1
- name: Run Cypress tests
uses: cypress-io/github-action@v4

View File

@ -4,6 +4,7 @@ import { marketsQuery } from '@vegaprotocol/mock';
import { getDateTimeFormat } from '@vegaprotocol/react-helpers';
const dialogCloseBtn = 'dialog-close';
const popoverTrigger = 'popover-trigger';
describe('markets table', { tags: '@smoke' }, () => {
beforeEach(() => {
@ -173,8 +174,13 @@ describe('markets table', { tags: '@smoke' }, () => {
});
function openMarketDropDown() {
cy.getByTestId(dialogCloseBtn).should('be.visible');
cy.getByTestId(dialogCloseBtn).click();
cy.getByTestId('popover-trigger').click();
cy.contains('Loading market data...').should('not.exist');
cy.getByTestId(dialogCloseBtn).then((button) => {
if (button.is(':visible')) {
cy.get('[data-testid^="market-link-"]').should('not.be.empty');
cy.getByTestId(dialogCloseBtn).click();
cy.get('[data-testid^="ask-vol-"]').should('be.visible');
cy.getByTestId(popoverTrigger).click({ force: true });
cy.contains('Loading market data...').should('not.exist');
}
});
}

View File

@ -1,6 +1,6 @@
import { mockConnectWallet } from '@vegaprotocol/cypress';
beforeEach(() => {
before(() => {
cy.mockTradingPage();
cy.mockSubscription();
cy.visit('/');