diff --git a/tests/online/jqkungfu/test.js b/tests/online/jqkungfu/test.js new file mode 100644 index 00000000..dbfb8d1a --- /dev/null +++ b/tests/online/jqkungfu/test.js @@ -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() +} diff --git a/tests/online/livesplit/test.js b/tests/online/livesplit/test.js new file mode 100644 index 00000000..19cf1a0a --- /dev/null +++ b/tests/online/livesplit/test.js @@ -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() +} diff --git a/tests/online/mandelbrot/test.js b/tests/online/mandelbrot/test.js new file mode 100644 index 00000000..c9b66975 --- /dev/null +++ b/tests/online/mandelbrot/test.js @@ -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() +} diff --git a/tests/run-tests.cts b/tests/run-tests.cts index 10b22404..b63e37b5 100644 --- a/tests/run-tests.cts +++ b/tests/run-tests.cts @@ -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;