From 1560df1134811fa917d7e82d3953fb5a2f3d62ce Mon Sep 17 00:00:00 2001
From: Yuriy Maksymets <iurii.maksymets@gmail.com>
Date: Mon, 14 Oct 2019 14:57:49 +0100
Subject: [PATCH] Using server host and port in the tests

---
 __tests__/e2e/peer1.test.js | 7 ++++++-
 __tests__/e2e/peer2.test.js | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/__tests__/e2e/peer1.test.js b/__tests__/e2e/peer1.test.js
index 18fc9d1..58be35e 100644
--- a/__tests__/e2e/peer1.test.js
+++ b/__tests__/e2e/peer1.test.js
@@ -1,6 +1,9 @@
 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)
diff --git a/__tests__/e2e/peer2.test.js b/__tests__/e2e/peer2.test.js
index 01e143e..38388a9 100644
--- a/__tests__/e2e/peer2.test.js
+++ b/__tests__/e2e/peer2.test.js
@@ -1,6 +1,9 @@
 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 }
 
-- 
GitLab