/
visibility_spec.js
44 lines (37 loc) · 1.49 KB
/
visibility_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
describe('visibility', () => {
// https://github.com/cypress-io/cypress/issues/631
describe('with overflow and transform - slider', () => {
beforeEach(() => {
cy.visit('/fixtures/issue-631.html')
// first slide is visible by default, nothing wrong here
cy.get('[name="test1"]').should('be.visible')
cy.get('[name="test2"]').should('not.be.visible')
cy.get('[name="test3"]').should('not.be.visible')
})
it('second slide', () => {
// ask for the second slide to become visible
cy.get('#button-2').click()
cy.get('[name="test1"]').should('not.be.visible')
cy.get('[name="test2"]').should('be.visible')
cy.get('[name="test3"]').should('not.be.visible')
})
it('third slide', () => {
// ask for the second slide to become visible
cy.get('#button-3').click()
cy.get('[name="test1"]').should('not.be.visible')
cy.get('[name="test2"]').should('not.be.visible')
cy.get('[name="test3"]').should('be.visible')
})
})
describe('with shadow dom', () => {
// https://github.com/cypress-io/cypress/issues/7794
it('fixed position ancestor does not hang when checking visibility', () => {
cy.visit('/fixtures/issue-7794.html')
cy.get('.container-2').should('be.visible')
})
it('non-visible ancestor causes element to not be visible', () => {
cy.visit('/fixtures/shadow-dom.html')
cy.get('.inside-non-visible', { includeShadowDom: true }).should('not.be.visible')
})
})
})