File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ jobs:
200
200
node-version : lts/*
201
201
cache : ' npm'
202
202
- run : npm clean-install
203
- - run : npm install --global testcafe@3
203
+ - run : npm install --global testcafe@3.7.0-rc.1
204
204
- name : Add rows to the TCC.db
205
205
if : ${{ matrix.runs-on == 'macos-14' }}
206
206
run : |
Original file line number Diff line number Diff line change 1
- import { t , Selector } from 'testcafe'
1
+ import { t , ClientFunction } from 'testcafe'
2
2
import * as fs from 'node:fs'
3
3
4
4
const script = fs . readFileSync ( './tap/run-browser.js' , { encoding : 'utf-8' } )
5
5
6
6
fixture ( 'test suite' ) . page ( 'https://important-clam-66.deno.dev' )
7
7
8
8
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, '<' )
15
+ . replace ( / > / g, '>' )
16
+ . replace ( / " / g, '"' )
17
+ . replace ( / ' / g, ''' )
18
+ }
19
+ // @ts -expect-error
20
+ document . getElementById ( 'js' ) . innerHTML = escapeHTML ( innerHTML )
21
+ document . querySelector ( 'form' ) ?. submit ( )
22
+ } ,
23
+ { dependencies : { innerHTML : script } } ,
24
+ ) ( )
10
25
11
- await user . typeText ( '#js' , script , { paste : true } ) . click ( '[type=submit]' )
12
-
13
- await scriptTag ( )
14
26
let i = 0
15
27
const interval = setInterval ( ( ) => {
16
28
t . getBrowserConsoleMessages ( ) . then ( ( { log : messages } ) => {
You can’t perform that action at this time.
0 commit comments