Skip to content

Commit 973c85d

Browse files
author
Blue F
authored
chore: Fix flaky origin .wait() test (#25693)
1 parent ac99a5c commit 973c85d

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

packages/driver/cypress/e2e/e2e/origin/commands/waiting.cy.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,31 @@ import { findCrossOriginLogs } from '../../../../support/utils'
33
declare global {
44
interface Window {
55
xhrGet: any
6-
abortRequests: any
76
}
87
}
98

10-
let reqQueue: XMLHttpRequest[] = []
11-
129
const xhrGet = (url) => {
1310
const xhr = new window.XMLHttpRequest()
1411

1512
xhr.open('GET', url)
16-
reqQueue.push(xhr)
1713
xhr.send()
1814
}
1915

20-
const abortRequests = () => {
21-
reqQueue.forEach((xhr) => xhr.abort())
22-
reqQueue = []
23-
}
24-
2516
context('cy.origin waiting', { browser: '!webkit' }, () => {
2617
before(() => {
2718
cy.origin('http://www.foobar.com:3500', () => {
28-
let reqQueue: XMLHttpRequest[] = []
29-
3019
window.xhrGet = (url) => {
3120
const xhr = new window.XMLHttpRequest()
3221

3322
xhr.open('GET', url)
34-
reqQueue.push(xhr)
3523
xhr.send()
3624
}
37-
38-
window.abortRequests = () => {
39-
reqQueue.forEach((xhr) => xhr.abort())
40-
reqQueue = []
41-
}
4225
})
4326
})
4427

4528
let logs: Map<string, any>
4629

4730
beforeEach(() => {
48-
cy.origin('http://www.foobar.com:3500', () => {
49-
window.abortRequests()
50-
})
51-
52-
abortRequests()
53-
5431
logs = new Map()
5532

5633
cy.on('log:changed', (attrs, log) => {

0 commit comments

Comments
 (0)