Select Git revision
administration.py
peer1.e2e.js 880 B
import { Selector } from "testcafe"
const host = "127.0.0.1"
const port = process.env.PORT || 3000
fixture`Peer 1`.page`${host}:${port}`
const idAppearTimeout = 1000
const syncTimeout = 5000
const selectorOptions = { timeout: 1000 }
test("Connection id appears", async (t) => {
const userId = async () =>
await Selector("#user-avatar")
.child(1)
.addCustomDOMProperties({ innerHTML: (el) => el.innerHTML })
.with(selectorOptions).innerHTML
await t
.wait(idAppearTimeout)
.expect((await userId()).length)
.gt(0)
})
test("Clicking and dragging on canvas creates a single child element", async (t) => {
const canvas = Selector("#canvas").with(selectorOptions)
await t
.drag(canvas, 10, 10)
.wait(syncTimeout)
.expect(canvas.childElementCount)
// first draw also creates last recognised path placeholder
.eql(2)
})