Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit cfa6f99

Browse files
committed
chore: refactor specs
1 parent 53e1738 commit cfa6f99

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

cypress/integration/spec.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ describe('cypress-xpath', () => {
55
expect(cy).property('xpath').to.be.a('function')
66
})
77

8-
it('finds h1', () => {
9-
cy.visit('cypress/integration/index.html')
10-
cy.xpath('//h1').should('have.length', 1)
11-
})
8+
context('elements', () => {
9+
beforeEach(() => {
10+
cy.visit('cypress/integration/index.html')
11+
})
1212

13-
it('returns jQuery wrapped elements', () => {
14-
cy.visit('cypress/integration/index.html')
15-
cy.xpath('//h1').then((el$) => {
16-
expect(el$).to.have.property('jquery')
13+
it('finds h1', () => {
14+
cy.xpath('//h1').should('have.length', 1)
1715
})
18-
})
1916

20-
it('gets h1 text', () => {
21-
cy.visit('cypress/integration/index.html')
22-
cy.xpath('//h1/text()').its('0.textContent').should('equal', 'cypress-xpath')
17+
it('returns jQuery wrapped elements', () => {
18+
cy.xpath('//h1').then((el$) => {
19+
expect(el$).to.have.property('jquery')
20+
})
21+
})
22+
23+
it('gets h1 text', () => {
24+
cy.xpath('//h1/text()').its('0.textContent').should('equal', 'cypress-xpath')
25+
})
2326
})
2427
})

0 commit comments

Comments
 (0)