Skip to content

Commit 0f7665d

Browse files
test(launchpad): fix flaky queries
Closes #23154
1 parent f0e44f4 commit 0f7665d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('Config files error handling', () => {
3131

3232
cy.findByRole('button', { name: 'Try again' }).click()
3333

34-
cy.get('h1', { timeout: 10000 }).should('contain', 'Welcome to Cypress')
34+
cy.contains('h1', 'Welcome to Cypress')
3535
})
3636

3737
it('shows the upgrade screen if there is a legacy config file', () => {
@@ -70,7 +70,7 @@ describe('Config files error handling', () => {
7070

7171
cy.findByRole('button', { name: 'Try again' }).click()
7272

73-
cy.get('h1').should('contain', 'Welcome to Cypress')
73+
cy.contains('h1', 'Welcome to Cypress')
7474
})
7575

7676
it('handles deprecated config fields', () => {
@@ -92,7 +92,7 @@ describe('Config files error handling', () => {
9292

9393
cy.findByRole('button', { name: 'Try again' }).click()
9494

95-
cy.get('h1', { timeout: 10000 }).should('contain', 'Choose a browser')
95+
cy.contains('h1', 'Choose a browser')
9696
})
9797
})
9898

@@ -165,7 +165,7 @@ describe('Launchpad: Error System Tests', () => {
165165

166166
cy.findByRole('button', { name: 'Try again' }).click()
167167

168-
cy.get('h1').should('contain', 'Welcome to Cypress')
168+
cy.contains('h1', 'Welcome to Cypress')
169169
})
170170

171171
it(`clears the error correctly after first 'try again' attempt`, () => {
@@ -190,7 +190,7 @@ describe('Launchpad: Error System Tests', () => {
190190

191191
cy.findByRole('button', { name: 'Try again' }).click()
192192

193-
cy.get('h1').should('contain', 'Welcome to Cypress')
193+
cy.contains('h1', 'Welcome to Cypress')
194194
})
195195

196196
it('shows correct user file instead of node file', () => {
@@ -279,7 +279,7 @@ describe('setupNodeEvents', () => {
279279

280280
cy.findByRole('button', { name: 'Try again' }).click()
281281

282-
cy.get('h1', { timeout: 10000 }).should('contain', 'Choose a browser')
282+
cy.contains('h1', 'Choose a browser')
283283
})
284284

285285
it('handles multiple config errors and then recovers', () => {
@@ -310,7 +310,7 @@ describe('setupNodeEvents', () => {
310310
})
311311

312312
cy.findByRole('button', { name: 'Try again' }).click()
313-
cy.get('h1', { timeout: 10000 }).should('contain', 'Choose a browser')
313+
cy.contains('h1', 'Choose a browser')
314314
cy.get('[data-cy="alert"]').should('contain', 'Warning: Cannot Connect Base Url Warning')
315315
})
316316

packages/launchpad/cypress/e2e/config-warning.cy.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('component testing dependency warnings', () => {
232232
cy.skipWelcome()
233233
cy.contains('component-testing-outdated-dependencies').click()
234234
cy.get('[data-cy="warning-alert"]').should('not.exist')
235-
cy.get('a').contains('Projects').click()
235+
cy.contains('a', 'Projects').click()
236236
cy.get('[data-cy-testingtype="component"]').click()
237237
cy.get('[data-cy="warning-alert"]', { timeout: 12000 }).should('exist')
238238
.should('contain.text', 'Warning: Component Testing Mismatched Dependencies')
@@ -243,7 +243,6 @@ describe('component testing dependency warnings', () => {
243243
cy.get('.warning-markdown').find('li').should('have.length', 3)
244244
})
245245

246-
// TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23154
247246
it('warns against outdated @vue/cli dependency', { retries: 15 }, () => {
248247
cy.scaffoldProject('outdated-deps-vuecli3')
249248
cy.addProject('outdated-deps-vuecli3')
@@ -252,7 +251,7 @@ describe('component testing dependency warnings', () => {
252251
cy.skipWelcome()
253252
cy.contains('outdated-deps-vuecli3').click()
254253
cy.get('[data-cy="warning-alert"]').should('not.exist')
255-
cy.get('a').contains('Projects').click()
254+
cy.contains('a', 'Projects').click()
256255
cy.get('[data-cy-testingtype="component"]').click()
257256
cy.get('[data-cy="warning-alert"]', { timeout: 12000 }).should('exist')
258257
.should('contain.text', 'Warning: Component Testing Mismatched Dependencies')

0 commit comments

Comments
 (0)