Skip to content

Commit e2f737d

Browse files
committed
test: temporary workaround chrome 130 and testcafe
1 parent 43c4bcc commit e2f737d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ jobs:
200200
node-version: lts/*
201201
cache: 'npm'
202202
- run: npm clean-install
203-
- run: npm install --global testcafe@3
203+
- run: npm install --global testcafe@3.7.0-rc.1
204204
- name: Add rows to the TCC.db
205205
if: ${{ matrix.runs-on == 'macos-14' }}
206206
run: |

tap/.browser.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
import { t, Selector } from 'testcafe'
1+
import { t, ClientFunction } from 'testcafe'
22
import * as fs from 'node:fs'
33

44
const script = fs.readFileSync('./tap/run-browser.js', { encoding: 'utf-8' })
55

66
fixture('test suite').page('https://important-clam-66.deno.dev')
77

88
test('passes tests', async (user) => {
9-
const scriptTag = Selector('script')
9+
await ClientFunction(
10+
() => {
11+
function escapeHTML(str: string) {
12+
return str
13+
.replace(/&/g, '&')
14+
.replace(/</g, '&lt;')
15+
.replace(/>/g, '&gt;')
16+
.replace(/"/g, '&quot;')
17+
.replace(/'/g, '&#39;')
18+
}
19+
// @ts-expect-error
20+
document.getElementById('js').innerHTML = escapeHTML(innerHTML)
21+
document.querySelector('form')?.submit()
22+
},
23+
{ dependencies: { innerHTML: script } },
24+
)()
1025

11-
await user.typeText('#js', script, { paste: true }).click('[type=submit]')
12-
13-
await scriptTag()
1426
let i = 0
1527
const interval = setInterval(() => {
1628
t.getBrowserConsoleMessages().then(({ log: messages }) => {

0 commit comments

Comments
 (0)