Skip to content

Commit

Permalink
Added tests: jqkungfu, livesplit(failing), mandelbrot.
Browse files Browse the repository at this point in the history
  • Loading branch information
yusungsim committed Feb 8, 2024
1 parent 2a38c1b commit e70a683
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/online/jqkungfu/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { delay } from '../../../dist/tests/test-utils.cjs'

export default async function test(analyser) {
const url = 'http://jqkungfu.com/'
const page = await analyser.start(url, { headless: true})

const queryBox = page.locator('#query')
await queryBox.waitFor({state: 'visible'})

const goButton = page.locator('#btnRun')
await goButton.waitFor({state: 'visible'})


await queryBox.fill('')
await queryBox.press('.')
await queryBox.press('[')
await queryBox.press('1')
await queryBox.press(']')
await goButton.click()

await queryBox.fill('')
await queryBox.press('.')
await queryBox.press('[')
await queryBox.press('2')
await queryBox.press(']')
await goButton.click()

return await analyser.stop()
}
10 changes: 10 additions & 0 deletions tests/online/livesplit/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { delay } from '../../../dist/tests/test-utils.cjs'

export default async function test(analyser) {
const url = 'https://one.livesplit.org/'
const page = await analyser.start(url, { headless: false })

await delay(10000)

return await analyser.stop()
}
22 changes: 22 additions & 0 deletions tests/online/mandelbrot/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { delay } from '../../../dist/tests/test-utils.cjs'

export default async function test(analyser) {
const url = 'http://whealy.com/Rust/mandelbrot.html'
const page = await analyser.start(url, { headless: true })

const canvas = page.locator('#mandelImage')
await canvas.waitFor({state: 'visible' })

for (let i = 0; i < 10; i++){
await canvas.click({
button: 'left',
position: {x: 400, y: 200},
})
await delay(1000)
}


await delay(1000)

return await analyser.stop()
}
1 change: 1 addition & 0 deletions tests/run-tests.cts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ async function runOnlineTests(names: string[], options) {
'uarm', // doesn't work for js because string is too long
'image-convolute', // asm2wasm - f64-to-int is too large
'lichess', // failing test
'livesplit' // uses simd, filter for now
]
names = names.filter((n) => !filter.includes(n))
let successfull = 0;
Expand Down

0 comments on commit e70a683

Please sign in to comment.