From 6e8afb9b98fa284b1154ba0cee986f91f403a3f4 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Fri, 22 Sep 2023 14:47:19 +0300 Subject: [PATCH] fix: update server host in GUI e2e tests --- package.json | 2 +- test/func/tests/common-gui/index.hermione.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d3dafadd6..6017b6480 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:build-browsers": "docker build -f test/func/docker/Dockerfile -t html-reporter-browsers:0.0.1 --network host test/func/docker", "e2e:build-packages": "npm run --workspace=test/func/packages --if-present build", "e2e:generate-fixtures": "npm run --workspace=test/func/fixtures generate", - "e2e:launch-browsers": "docker run -it --rm --network=host --add-host=host.docker.internal:127.0.0.1 html-reporter-browsers:0.0.1", + "e2e:launch-browsers": "docker run -it --rm --network=host --add-host=host.docker.internal:0.0.0.0 html-reporter-browsers:0.0.1", "e2e:test": "npm run --workspace=test/func/tests test", "e2e": "npm run e2e:build-packages && npm run e2e:generate-fixtures ; npm run e2e:test", "lint": "eslint .", diff --git a/test/func/tests/common-gui/index.hermione.js b/test/func/tests/common-gui/index.hermione.js index a6b706d3d..d139e2a24 100644 --- a/test/func/tests/common-gui/index.hermione.js +++ b/test/func/tests/common-gui/index.hermione.js @@ -8,9 +8,11 @@ const treeKill = promisify(require('tree-kill')); const {PORTS} = require('../../utils/constants'); const {getTestSectionByName} = require('../utils'); +const serverHost = process.env.SERVER_HOST ?? 'host.docker.internal'; + const projectName = process.env.PROJECT_UNDER_TEST; const projectDir = path.resolve(__dirname, '../../fixtures', projectName); -const guiUrl = `http://host.docker.internal:${PORTS[projectName].gui}`; +const guiUrl = `http://${serverHost}:${PORTS[projectName].gui}`; const reportDir = path.join(projectDir, 'report'); const reportBackupDir = path.join(projectDir, 'report-backup');