Skip to content
Snippets Groups Projects
Commit 1560df11 authored by Yuriy Maksymets's avatar Yuriy Maksymets
Browse files

Using server host and port in the tests

parent 76deb064
No related branches found
No related tags found
1 merge request!66Testcafe testing base
Pipeline #101172 failed
import { Selector } from "testcafe"
fixture`Peer 1`.page`localhost:3000`
const host = "0.0.0.0"
const port = process.env.PORT || 3000
fixture`Peer 1`.page`${host}:${port}`
const idAppearTimeout = 1000
const selectorOptions = { timeout: 100 }
......@@ -8,6 +11,7 @@ const selectorOptions = { timeout: 100 }
test("Connection id appears", async (t) => {
const userId = async () =>
await Selector("#user-id").with(selectorOptions).value
await t
.wait(idAppearTimeout)
.expect((await userId()).length)
......@@ -16,6 +20,7 @@ test("Connection id appears", async (t) => {
test("Clicking and dragging on whiteboard creates a single child element", async (t) => {
const whiteboard = Selector("#whiteboard").with(selectorOptions)
await t
.drag(whiteboard, 10, 10)
.expect(whiteboard.childElementCount)
......
import { Selector } from "testcafe"
fixture`Peer 2`.page`localhost:3000`
const host = "0.0.0.0"
const port = process.env.PORT || 3000
fixture`Peer 2`.page`${host}:${port}`
const selectorOptions = { timeout: 100 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment