From a37ff70c98de4800199551c879d073384c2b6fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Matkovi=C4=87?= Date: Wed, 6 Nov 2019 11:47:55 +0100 Subject: [PATCH] Fixed e2e tests --- e2e/integration/infinite-scroll.e2e.ts | 42 +++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/e2e/integration/infinite-scroll.e2e.ts b/e2e/integration/infinite-scroll.e2e.ts index d153361f..b021e15e 100644 --- a/e2e/integration/infinite-scroll.e2e.ts +++ b/e2e/integration/infinite-scroll.e2e.ts @@ -1,6 +1,6 @@ describe('Infinite scroll disabling', () => { beforeEach(() => { - cy.visit('disable-infinite-scroll-index.html'); + cy.visit('e2e/disable-infinite-scroll-index.html'); }); it('should initially have only info component', () => { @@ -8,30 +8,38 @@ describe('Infinite scroll disabling', () => { .children() .should('have.length', 2) .first() - .should('have.text', 'Swagger Petstore') + .find('h1') + .should('include.text', 'Swagger Petstore'); + cy.get('.api-content') + .children() .last() - .should('have.text', 'Introduction'); - }); - - it('should render only 1 component after menu item click', () => { - cy.contains('pet') - .click() - .contains('Add a new pet to the store') - .click() - .window().then($window => { - expect($window.scrollY).to.be.closeTo(300, 20); }) - .get('#operation/addPet') - .should(' have.text', 'Add new pet to the store inventory.'); + .find('h1') + .should('include.text', 'Introduction'); }); it('should test group menu item click', () => { cy.contains('pet') - .click() + .click(); + cy.get('[id="tag/pet"]') .children() .should('have.length', 2) .first() - .should('have.text', 'pet') + .should('have.text', 'pet'); + cy.get('[id="tag/pet"]') + .children() .last() - .should('have.text', 'Everything about your Pets'); + .should('have.text', 'Everything about your Pets\n'); + }); + + it('should render only 1 component after menu item click', () => { + cy.contains('pet') + .click(); + cy.contains('Add a new pet to the store') + .click() + .window().then($window => { + expect($window.scrollY).to.be.closeTo(350, 20); + }); + cy.contains('Add a new pet to the store'); + cy.contains('Add new pet to the store inventory.'); }); });