diff --git a/Makefile b/Makefile index 9ef6e4a..3ebe934 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,9 @@ build: clean: docker compose rm -fsv -test: build - docker compose down +test: + docker compose --env-file ./test.env down docker compose --env-file ./test.env --profile testing up --build updatedb test acceptance: test - @echo Acceptance tests -- to be done \ No newline at end of file + @echo Acceptance tests -- to be done diff --git a/docker-compose.yaml b/docker-compose.yaml index e003e1e..2f081d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -206,8 +206,8 @@ services: networks: - default environment: - - GEOSHOP_DEMO_LOGIN=admin:Test1234 - - EXTRACT_DEMO_LOGIN=admin:motdepasse21 + - GEOSHOP_DEMO_LOGIN=${GEOSHOP_DEMO_LOGIN} + - EXTRACT_DEMO_LOGIN=${EXTRACT_DEMO_LOGIN} depends_on: selenium: condition: service_healthy diff --git a/test.env b/test.env index e3bb04c..8265cdc 100644 --- a/test.env +++ b/test.env @@ -1,3 +1,5 @@ TEST_MODE=True FRONTEND_HOST=frontend -FRONTEND_PORT=80 \ No newline at end of file +FRONTEND_PORT=80 +GEOSHOP_DEMO_LOGIN=admin:Test1234 +EXTRACT_DEMO_LOGIN=admin:motdepasse21 diff --git a/tests/extract_geoshop_smoke.py b/tests/extract_geoshop_smoke.py index fbf5cad..266fa65 100644 --- a/tests/extract_geoshop_smoke.py +++ b/tests/extract_geoshop_smoke.py @@ -9,8 +9,6 @@ SELENIUM_HOST = os.environ.get('SELENIUM_HOST', "http://selenium:4444") + "/wd/hub" FRONTEND_HOST = os.environ.get('FRONTEND_HOST', "http://frontend") -REQUEST_PROCESS_WAIT = 20 # Seconds (Selenium default time unit) - # Geoshop and Extract testing credentials in the username:password format EXTRACT_DEMO_LOGIN = tuple(os.environ.get("EXTRACT_DEMO_LOGIN").split(":")) GEOSHOP_DEMO_LOGIN = tuple(os.environ.get("GEOSHOP_DEMO_LOGIN").split(":")) @@ -34,8 +32,8 @@ def test_geoshopLoginLogout(self): self.assertEqual( self._driver.find_element(By.TAG_NAME, "title").get_attribute("innerText"), "Geoshop API" - ) - + ) + # Login self._driver.find_element(By.LINK_TEXT, "Admin").click() self._driver.find_element(By.ID, "id_username").send_keys(GEOSHOP_DEMO_LOGIN[0]) @@ -56,7 +54,6 @@ def test_geoshopLoginLogout(self): def test_extractLoginLogout(self): - return self._driver.get(f"{FRONTEND_HOST}/extract") self.assertEqual( self._driver.find_element(By.TAG_NAME, "title").get_attribute("innerText"), @@ -77,8 +74,7 @@ def test_extractLoginLogout(self): self._driver.find_element(By.ID, "logoutLink").click() self.assertEqual( self._driver.find_element(By.TAG_NAME, "title") - .get_attribute("innerText") - .strip(), + .get_attribute("innerText"), "Extract", )