From cd94b814f5439bd2711b6dd9ff4425132a1ca7f6 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Fri, 16 Jul 2021 21:00:14 -0700 Subject: [PATCH] improve bisq tests --- .../cypress/integration/bisq/bisq.spec.ts | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/frontend/cypress/integration/bisq/bisq.spec.ts b/frontend/cypress/integration/bisq/bisq.spec.ts index 6cc9ad910..c6ba44306 100644 --- a/frontend/cypress/integration/bisq/bisq.spec.ts +++ b/frontend/cypress/integration/bisq/bisq.spec.ts @@ -10,32 +10,41 @@ describe('Bisq', () => { cy.intercept('/bisq/api/txs/*/*').as('txs'); cy.intercept('/bisq/api/blocks/*/*').as('blocks'); cy.intercept('/bisq/api/stats').as('stats'); + + Cypress.Commands.add('waitForDashboard', (label) => { + cy.wait('@socket'); + cy.wait('@hloc'); + cy.wait('@ticker'); + cy.wait('@markets'); + cy.wait('@7d'); + cy.wait('@trades'); + }) }); - it('loads the dashboard', () => { - cy.visit('/bisq'); - cy.wait('@socket'); - cy.wait('@hloc'); - cy.wait('@ticker'); - cy.wait('@markets'); - cy.wait('@7d'); - cy.wait('@trades'); + it('loads the dashboard', () => { + cy.visit('/bisq'); + cy.waitForDashboard(); }); it('loads the transactions screen', () => { cy.visit('/bisq'); + cy.waitForDashboard(); cy.get('li:nth-of-type(2) > a').click().then(() => { - cy.wait('@txs'); + cy.get('.table > tr').should('have.length', 50); }); }); + it('loads the blocks screen', () => { cy.visit('/bisq'); + cy.waitForDashboard(); cy.get('li:nth-of-type(3) > a').click().then(() => { cy.wait('@blocks'); }); }); + it('loads the stats screen', () => { cy.visit('/bisq'); + cy.waitForDashboard(); cy.get('li:nth-of-type(4) > a').click().then(() => { cy.wait('@stats'); }); @@ -43,8 +52,11 @@ describe('Bisq', () => { it('loads the api screen', () => { cy.visit('/bisq'); + cy.waitForDashboard(); cy.get('li:nth-of-type(5) > a').click().then(() => { - + cy.get('.card').should('have.length.at.least', 1); + cy.get('.card').first().click(); + cy.get('.card-body'); }); });