From 0e71ca37678f050f1ee7b29f0cd20957e47fb1e6 Mon Sep 17 00:00:00 2001 From: s87777 <s87777@bht-berlin.de> Date: Mon, 11 Dec 2023 14:42:37 +0100 Subject: [PATCH] Test23 --- .env | 2 +- .gitlab-ci.yml | 4 ++-- src/test/LoginTest.test.ts | 2 +- src/test/UserManagement.test.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 0b7186a..772f58b 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ REACT_APP_API_SERVER_URL=http://127.0.0.1:80 # related to proxy-setting in package.json DANGEROUSLY_DISABLE_HOST_CHECK=true -SELENIUM_HOST = selenium__standalone-chrome \ No newline at end of file +APP_TESTS_REMOTE_WEB_DRIVER_URL = selenium__standalone-chrome \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f3863c..466780f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ build_test_frontend: alias: chrome variables: - SELENIUM_HOST: chrome + APP_TESTS_REMOTE_WEB_DRIVER_URL: "http://chrome:4444" script: - echo "install npm" @@ -31,7 +31,7 @@ build_test_frontend: - echo "docker commands success" - npm start & - echo "start test" - - npm test --host=selenium__standalone-chrome + - npm test --host=$SELENIUM_HOST - echo "Testing finshed" tags: diff --git a/src/test/LoginTest.test.ts b/src/test/LoginTest.test.ts index 7eb410d..0c46511 100644 --- a/src/test/LoginTest.test.ts +++ b/src/test/LoginTest.test.ts @@ -6,7 +6,7 @@ describe("Login Test", function () { let driver:WebDriver; beforeEach(async function () { - driver = await new Builder().forBrowser("chrome").usingServer(`http://${process.env.SELENIUM_HOST}:4444`).setChromeOptions(new chrome.Options().headless().windowSize({width: 1920, height: 1080})).build(); + driver = await new Builder().forBrowser("chrome").usingServer(`${process.env.APP_TESTS_REMOTE_WEB_DRIVER_URL}`).setChromeOptions(new chrome.Options().headless().windowSize({width: 1920, height: 1080})).build(); //driver = await new Builder().forBrowser("chrome").setChromeOptions(new chrome.Options().headless()).build(); //navigate to the application await driver.get(`http://localhost:3000`); diff --git a/src/test/UserManagement.test.ts b/src/test/UserManagement.test.ts index f9abba0..7632d40 100644 --- a/src/test/UserManagement.test.ts +++ b/src/test/UserManagement.test.ts @@ -6,7 +6,7 @@ describe("User Management Test", function () { let driver: WebDriver; beforeEach(async function () { - driver = await new Builder().forBrowser("chrome").usingServer(`http://${process.env.SELENIUM_HOST}:4444`).setChromeOptions(new chrome.Options().headless().windowSize({width: 1920, height: 1080})).build(); + driver = await new Builder().forBrowser("chrome").usingServer(`${process.env.APP_TESTS_REMOTE_WEB_DRIVER_URL}`).setChromeOptions(new chrome.Options().headless().windowSize({width: 1920, height: 1080})).build(); await driver.get(`http://localhost:3000`); //await driver.manage().window().maximize(); -- GitLab