diff --git a/.env b/.env index 0b7186a6d865cf0ed1f5182a1533da7c9f97b644..772f58b620c367521076aeff03114c2a67811aea 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 1f3863cea04dce5bfe7540b898c5f315c90d7ad3..466780f3129c263722bbc92c4ac248e2c1fcf343 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 7eb410d9fca15dbc748ca7c8abe83a3bdde9be71..0c46511774a7116fe64faf8e180016662b9c52c6 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 f9abba081666e954ec8307be6c5bdf62937250f2..7632d40c7aa44c274f0c8f9ec0508e38df48c1a7 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();