diff --git a/peer.test.js b/peer.test.js new file mode 100644 index 0000000000000000000000000000000000000000..422bcf8e2c6008ce7aef8c5f1de8f142085b1fba --- /dev/null +++ b/peer.test.js @@ -0,0 +1,11 @@ +import { Selector } from "testcafe" + +fixture`Peer 2`.page`localhost:12345` + +const selectorOptions = { timeout: 100 } + +test("Connection id appears", async (t) => { + const articleHeader = Selector("#user-id").with(selectorOptions) + let inputValue = await articleHeader.value + await t.expect(inputValue.length).gt(0) +}) diff --git a/serverIntegration.test.js b/serverIntegration.test.js index a823577a27b8465eb1511c572ac4545ae05ce24f..d24add10391209a9fff1e9af6b0efd0b101742a2 100644 --- a/serverIntegration.test.js +++ b/serverIntegration.test.js @@ -1,7 +1,9 @@ -// import { Selector } from "testcafe" +import { Selector } from "testcafe" -fixture`Getting Started`.page`http://devexpress.github.io/testcafe/example` +fixture`Peer 1`.page`localhost:12345` -test("My first test", async (t) => { - await t.typeText("#developer-name", "John Smith").click("#submit-button") +test("Connection id appears", async (t) => { + const articleHeader = Selector("#user-id").with({ timeout: 100 }) + let inputValue = await articleHeader.value + await t.expect(inputValue.length).gt(0) }) diff --git a/serverTest.js b/serverTest.js index 92a2ebfc2c775e858e0052b858803dd7ffc65606..250794f79173d58ecd3b22af3254ab654a40ac8b 100644 --- a/serverTest.js +++ b/serverTest.js @@ -1,10 +1,11 @@ const createTestCafe = require("testcafe") let runner = null +let runner2 = null createTestCafe("localhost", 1337, 1338) .then((testcafe) => { runner = testcafe.createRunner() - + runner2 = testcafe.createRunner() return testcafe.createBrowserConnection() }) .then((remoteConnection) => { @@ -14,11 +15,20 @@ createTestCafe("localhost", 1337, 1338) .reporter("json") .run() .then((failedCount) => { - console.log("failed count " + failedCount) - /* ... */ + console.log("failed count 1: " + failedCount) + // runner2 + // .src("peer.test.js") + // .browsers(["chrome"]) + // .reporter("json") + // .run() + // .then((failedCount) => { + // console.log("failed count 2: " + failedCount) + // }) + // .catch((error) => { + // console.log("error" + error) + // }) }) .catch((error) => { console.log("error" + error) - /* ... */ }) })