From 1dabeebb3d0f47ffb4ea42441e8426d7a716348e Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 20 Nov 2017 13:55:32 +0200 Subject: [PATCH] Do not reload page extra times in e2e tests --- e2e/standalone.e2e.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/e2e/standalone.e2e.ts b/e2e/standalone.e2e.ts index a44c9239..735308d0 100644 --- a/e2e/standalone.e2e.ts +++ b/e2e/standalone.e2e.ts @@ -1,33 +1,29 @@ describe('Standalone bundle test', function() { describe('OAS3 mode', () => { + before(() => { + cy.visit('e2e/standalone.html'); + }); + it('Render and check no errors', function() { - cy - .visit('e2e/standalone.html') - .get('.api-info') - .should('exist'); + cy.get('.api-info').should('exist'); }); it('Render and click all the menu items', function() { - cy - .visit('e2e/standalone.html') - .get('.menu-content li') - .click({ multiple: true, force: true }); + cy.get('.menu-content li').click({ multiple: true, force: true }); }); }); describe('OAS2 compatibility mode', () => { + before(() => { + cy.visit('e2e/standalone.html'); + }); + it('Render and check no errors', function() { - cy - .visit('e2e/standalone.html') - .get('.api-info') - .should('exist'); + cy.get('.api-info').should('exist'); }); it('Render and click all the menu items', function() { - cy - .visit('e2e/standalone.html') - .get('.menu-content li') - .click({ multiple: true, force: true }); + cy.get('.menu-content li').click({ multiple: true, force: true }); }); }); });