Skip to content

Commit 0fd3283

Browse files
committed
Address review comments
* Add test for responsive behavior of reporter panel with filter * Add test to validate filter is maintained across `cy.domain` reinitialization
1 parent 3a59cc6 commit 0fd3283

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts

+42
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,33 @@ describe('cloud debug test filtering', () => {
3232
cy.get('.runnable-title').contains('t4')
3333
})
3434

35+
it('wraps filter UI with large number of tests', () => {
36+
cy.visitApp(`specs/runner?file=cypress/e2e/lots-of-tests.cy.js`)
37+
38+
cy.get('[data-cy="reporter-panel"]').as('reporterPanel')
39+
40+
cy.waitForSpecToFinish()
41+
42+
cy.withCtx((ctx) => {
43+
ctx.coreData.cloud.testsForRunResults = ['test1']
44+
})
45+
46+
cy.visitApp(`specs/runner?file=cypress/e2e/lots-of-tests.cy.js&runId=123`)
47+
cy.waitForSpecToFinish({ passCount: 50 })
48+
49+
cy.get('@reporterPanel').then((el) => el.width(500))
50+
cy.get('@reporterPanel').percySnapshot('wide')
51+
52+
cy.get('@reporterPanel').then((el) => el.width(350))
53+
cy.get('@reporterPanel').percySnapshot('medium')
54+
55+
cy.get('@reporterPanel').then((el) => el.width(250))
56+
cy.get('@reporterPanel').percySnapshot('narrow')
57+
58+
cy.get('@reporterPanel').then((el) => el.width(150))
59+
cy.get('@reporterPanel').percySnapshot('skinny')
60+
})
61+
3562
it('works with skips and onlys', () => {
3663
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js`)
3764

@@ -94,4 +121,19 @@ describe('cloud debug test filtering', () => {
94121
cy.get('.runnable-title').eq(1).contains('s1 (skipped due to browser)')
95122
cy.get('.runnable-title').eq(2).contains('t2')
96123
})
124+
125+
it('filter is maintained across cross-domain reinitialization', () => {
126+
cy.visitApp(`specs/runner?file=cypress/e2e/domain-change.cy.js`)
127+
128+
cy.get('[data-cy="reporter-panel"]').as('reporterPanel')
129+
130+
cy.waitForSpecToFinish()
131+
132+
cy.withCtx((ctx) => {
133+
ctx.coreData.cloud.testsForRunResults = ['t2', 't3']
134+
})
135+
136+
cy.visitApp(`specs/runner?file=cypress/e2e/domain-change.cy.js&runId=123`)
137+
cy.waitForSpecToFinish({ failCount: 2 })
138+
})
97139
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
it('t1', () => { })
2+
3+
it('t2', () => {
4+
cy.visit('http://www.cypress.io')
5+
expect(1).to.equal(2)
6+
})
7+
8+
it('t3', () => {
9+
cy.visit('http://www.cypress.io')
10+
cy.origin('https://example.cypress.io', {}, () => {
11+
cy.visit('/')
12+
})
13+
14+
expect(1).to.equal(2)
15+
})
16+
17+
it('t4', () => { })
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[...Array(50).keys()].forEach(() => {
2+
it('test1', () => {})
3+
it('test2', () => {})
4+
it('test3', () => {})
5+
})

0 commit comments

Comments
 (0)