From 5632e800312f106a8a56c622269ab97da1665010 Mon Sep 17 00:00:00 2001 From: Til Blechschmidt Date: Mon, 6 Dec 2021 12:43:17 +0100 Subject: [PATCH] :construction_worker: Modify integration test to use ParallelSeleniumTest with all browsers --- .github/workflows/build.yml | 6 ++++-- test/integration.py | 41 ------------------------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 test/integration.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a83ef181..b65d0c49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -191,7 +191,8 @@ jobs: make install docker-compose -f distribution/docker/docker-compose.yml logs -f & sleep 15 - python3 test/integration.py 8080 + docker run --rm -it --network host -e ENDPOINT=http://localhost:8080 -e FORKS=2 -e BROWSER=firefox ghcr.io/tilblechschmidt/parallelseleniumtest:sha-fa30ad9 + docker run --rm -it --network host -e ENDPOINT=http://localhost:8080 -e FORKS=2 -e BROWSER=chrome ghcr.io/tilblechschmidt/parallelseleniumtest:sha-fa30ad9 kubernetes-integration: name: ☸️ Kubernetes integration test @@ -247,7 +248,8 @@ jobs: kubectl describe pods - name: Run integration test run: | - python3 test/integration.py 30007 + docker run --rm -it --network host -e ENDPOINT=http://localhost:30007 -e FORKS=2 -e BROWSER=firefox ghcr.io/tilblechschmidt/parallelseleniumtest:sha-fa30ad9 + docker run --rm -it --network host -e ENDPOINT=http://localhost:30007 -e FORKS=2 -e BROWSER=chrome ghcr.io/tilblechschmidt/parallelseleniumtest:sha-fa30ad9 # ------------------ RELEASE ONLY JOBS ------------------ docker-hub: diff --git a/test/integration.py b/test/integration.py deleted file mode 100644 index 275a593c..00000000 --- a/test/integration.py +++ /dev/null @@ -1,41 +0,0 @@ -from selenium import webdriver -from selenium.webdriver.support.ui import WebDriverWait as wait -from selenium.webdriver.support import expected_conditions as EC -from selenium.webdriver.common.by import By -from time import sleep -import sys - -if len(sys.argv) < 2: - sys.exit("No port provided (first cli argument)!") - -port = sys.argv[1] -url = "http://127.0.0.1:" + port -print("Connecting to: " + url) -browser = webdriver.Remote(url) - -print("Session id: " + browser.session_id) - -browser.get('https://duckduckgo.com') -browser.add_cookie({"name": "webgrid:message", "value": "Visiting DuckDuckGo"}) -search_form = browser.find_element_by_id('search_form_input_homepage') -browser.add_cookie({"name": "webgrid:message", "value": "Searching for webgrid.dev"}) -search_form.send_keys('webgrid.dev') -search_form.submit() - -wait(browser, 10).until(EC.presence_of_element_located((By.CLASS_NAME, 'result__a'))) - -browser.add_cookie({"name": "webgrid:message", "value": "Looking at results"}) -results = browser.find_elements_by_class_name('result__a') - -found = False -for result in results: - found = result.text.find("WebGrid") > -1 - if found: - break - -browser.quit() - -if not found: - sys.exit("Did not find WebGrid in the search results :(") -else: - print("Test successful!")