diff --git a/tests/online/bullet/test.js b/tests/online/bullet/test.js new file mode 100644 index 00000000..f4f03acd --- /dev/null +++ b/tests/online/bullet/test.js @@ -0,0 +1,19 @@ +import { delay } from '../../../dist/tests/test-utils.cjs' + +export default async function test(analyser) { + const url = 'https://magnum.graphics/showcase/bullet/' + const page = await analyser.start(url, { headless: false }) + + const mainCanv = page.locator('#canvas') + await mainCanv.waitFor({state: 'visible'}) + + await mainCanv.click({ + button: 'left', + position: {x: 100, y: 100}, + delay: 100 + }) + + await delay(10000) + + return await analyser.stop() +} diff --git a/tests/online/factorial/test.js b/tests/online/factorial/test.js new file mode 100644 index 00000000..ec80f1ba --- /dev/null +++ b/tests/online/factorial/test.js @@ -0,0 +1,27 @@ +import { delay } from '../../../dist/tests/test-utils.cjs' +import { expect } from 'playwright/test' + +export default async function test(analyser) { + const url = 'https://www.hellorust.com/demos/factorial/index.html' + const page = await analyser.start(url, { headless: false }) + + const textInput = page.locator('#input') + await textInput.waitFor({state: 'visible'}) + + const numberOut = page.locator('#number-out') + await numberOut.waitFor({state: 'visible'}) + + await textInput.fill('') + + await textInput.fill('0') + await expect(numberOut).toContainText('fact(0)', {timeout: 10000}) + + await textInput.fill('1') + await expect(numberOut).toContainText('fact(1)', {timeout: 10000}) + + await textInput.fill('2') + await expect(numberOut).toContainText('fact(2)', {timeout: 10000}) + + + return await analyser.stop() +}