From 2431aa1d3bfdb681ebb3671c9b78d6770e02a04b Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Wed, 30 Oct 2019 11:30:54 +0100 Subject: [PATCH] test(e2e): fix --- cypress/integration/component-data-edit.js | 2 ++ cypress/integration/components-tab.js | 27 ++++++++++------------ cypress/integration/vuex-tab.js | 7 +++--- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/cypress/integration/component-data-edit.js b/cypress/integration/component-data-edit.js index 743d19b..2e092ba 100644 --- a/cypress/integration/component-data-edit.js +++ b/cypress/integration/component-data-edit.js @@ -4,6 +4,7 @@ suite('component data edit', () => { it('should edit data using the decrease button', () => { // select Instance cy.get('.instance:nth-child(1) .instance:nth-child(2)').eq(0).click() + cy.get('.component-state-inspector .data-type').should('contain', 'data') cy.get('.data-field').eq(7).find('.actions .vue-ui-button').eq(1).click({ force: true }) cy.get('.component-state-inspector').within(() => { cy.get('.key').contains('0').parent().get('.value').contains('0') @@ -21,6 +22,7 @@ suite('component data edit', () => { it('should edit data using the increase button', () => { cy.get('.instance:nth-child(1) .instance:nth-child(2)').eq(0).click() + cy.get('.component-state-inspector .data-type').should('contain', 'data') cy.get('.data-field').eq(7).find('.actions .vue-ui-button').eq(2).click({ force: true }) cy.get('.component-state-inspector').within(() => { cy.get('.key').contains('0').parent().get('.value').contains('0') diff --git a/cypress/integration/components-tab.js b/cypress/integration/components-tab.js index 88b51a0..b46356b 100644 --- a/cypress/integration/components-tab.js +++ b/cypress/integration/components-tab.js @@ -120,30 +120,27 @@ suite('components tab', () => { it('should display injected props', () => { cy.get('.left .search input').clear().type('Mine') cy.get('.instance').eq(1).click() - cy.get('.right .data-wrapper').then(el => { - expect(el.text()).to.contain('injected') - expect(el.text()).to.contain('answer:42') - expect(el.text()).to.contain('foo:"bar"') - expect(el.text()).to.contain('noop:ƒ noop(a, b, c)') - }) + cy.get('.right .data-wrapper') + .should('contain', 'injected') + .should('contain', 'answer:42') + .should('contain', 'foo:"bar"') + .should('contain', 'noop:ƒ noop(a, b, c)') cy.get('.left .search input').clear() }) it('should display $refs', () => { cy.get('.instance .item-name').contains('RefTester').click() - cy.get('.right .data-wrapper').then(el => { - expect(el.text()).to.contain('list:Array[4]') - expect(el.text()).to.contain('
  • ') - expect(el.text()).to.contain('tester:

    ') + .should('contain', 'tester:

    { cy.get('.instance .instance:nth-child(2) .arrow-wrapper').click() cy.get('.instance .instance .instance:nth-child(1) .item-name').click() - cy.get('.right .data-wrapper').then(el => { - expect(el.text()).to.contain('$attrs') - expect(el.text()).to.contain('attr:"some-attr"') - }) + cy.get('.right .data-wrapper') + .should('contain', '$attrs') + .should('contain', 'attr:"some-attr"') }) }) diff --git a/cypress/integration/vuex-tab.js b/cypress/integration/vuex-tab.js index f56160e..3af2f97 100644 --- a/cypress/integration/vuex-tab.js +++ b/cypress/integration/vuex-tab.js @@ -14,10 +14,9 @@ suite('vuex tab', () => { cy.get('[data-id="load-vuex-state"]').click() cy.get('.recording-vuex-state').should('not.be.visible') cy.get('.loading-vuex-state').should('not.be.visible') - cy.get('.vuex-state-inspector').then(el => { - expect(el.text()).to.include('type:"DECREMENT"') - expect(el.text()).to.include('count:1') - }) + cy.get('.vuex-state-inspector') + .should('contain', 'type:"DECREMENT"') + .should('contain', 'count:1') cy.get('.history .entry').eq(5).should('have.class', 'inspected').should('have.class', 'active') }) -- GitLab