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

Commit db8079e

Browse files
committed
chore: add tests for primitives
1 parent cfa6f99 commit db8079e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cypress/integration/spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,20 @@ describe('cypress-xpath', () => {
2323
it('gets h1 text', () => {
2424
cy.xpath('//h1/text()').its('0.textContent').should('equal', 'cypress-xpath')
2525
})
26+
27+
describe('primitives', () => {
28+
it('counts h1 elements', () => {
29+
cy.xpath('count(//h1)').should('equal', 1)
30+
})
31+
32+
it('returns h1 text content', () => {
33+
cy.xpath('string(//h1)').should('equal', 'cypress-xpath')
34+
})
35+
36+
it('returns boolean', () => {
37+
cy.xpath('boolean(//h1)').should('be.true')
38+
cy.xpath('boolean(//h2)').should('be.false')
39+
})
40+
})
2641
})
2742
})

0 commit comments

Comments
 (0)