Skip to content

Commit

Permalink
Modified gol, added gotemplate, hnset-bench
Browse files Browse the repository at this point in the history
  • Loading branch information
yusungsim committed Feb 6, 2024
1 parent f598812 commit 6c3b653
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/online/game-of-life/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export default async function test(analyser) {
// await delay(500)
// await button.click()

const nextButton = page.locator('#button')
await nextButton.wasabi({state: 'visible'})
const N = 5
const nextButton = page.locator('#next')
await nextButton.waitFor({state: 'visible'})
const N = 10
for (let i = 0; i < N; i++) {
await nextButton.click()
await delay(1000)
Expand Down
23 changes: 23 additions & 0 deletions tests/online/gotemplate/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { delay } from '../../../dist/tests/test-utils.cjs'
import { expect } from 'playwright/test'

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

const templateText = page.locator('#input-tmpl')
await templateText.waitFor({state: 'visible'})

const dataText = page.locator('#input-data')
await dataText.waitFor({state: 'visible'})

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

await templateText.fill('what, {{.planet}}')
await expect(outputText).toContainText('what, World', {timeout: 100000})

await delay(5000)

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

export default async function test(analyser) {
const url = 'https://raw.githack.com/gorhill/uBlock/master/docs/tests/hnset-benchmark.html'
const page = await analyser.start(url, { headless: false })

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

await lookupButton.click()

await delay(10000)

return await analyser.stop()
}

0 comments on commit 6c3b653

Please sign in to comment.