Skip to content

switch to chromedriver #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
17 changes: 8 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
run: git submodule update --init --recursive

- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ matrix.chrome }}
run: |
sudo apt-get -qq update
sudo apt-get install chromium-browser

- name: Get Date
id: get-date
Expand All @@ -47,14 +47,13 @@ jobs:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}

- name: Install geckodriver
- name: Install tools
run: |
sudo apt-get -qq update
sudo apt-get install autoconf libtool libsass-dev
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
mkdir geckodriver
tar -xzf geckodriver-v0.32.0-linux64.tar.gz -C geckodriver
export PATH=$PATH:$PWD/geckodriver
sudo apt-get install autoconf libtool libsass-dev xvfb

- name: Install chromedriver
uses: nanasess/setup-chromedriver@v1

- name: Install choosenim
run: |
Expand Down
14 changes: 7 additions & 7 deletions tests/browsertester.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import options, osproc, streams, threadpool, os, strformat, httpclient
import std/[options, osproc, streams, threadpool, os, strformat, httpclient, json]

import webdriver

Expand Down Expand Up @@ -47,21 +47,21 @@ import browsertests/[scenario1, threads, issue181, categories]

proc main() =
# Kill any already running instances
discard execCmd("killall geckodriver")
spawn runProcess("geckodriver -p 4444 --log config")
discard execCmd("killall chromedriver")
spawn runProcess("chromedriver --port:9515 --log-level=DEBUG")
defer:
discard execCmd("killall geckodriver")
discard execCmd("killall chromedriver")

# Create a fresh DB for the tester.
doAssert(execCmd("nimble testdb") == QuitSuccess)

doAssert(execCmd("nimble -y frontend") == QuitSuccess)
echo("Waiting for geckodriver to startup...")
echo("Waiting for chromedriver to startup...")
sleep(5000)

try:
let driver = newWebDriver()
let session = driver.createSession()
let driver = newWebDriver(url = "http://localhost:9515")
let session = driver.createSession(%*{"capabilities": {"alwaysMatch": {"browserName": "chrome", "goog:chromeOptions": {"args": ["--headless", "--no-sandbox", "--disable-dev-shm-usage", "disable-infobars", "--disable-extension"]}}}})

withBackend:
scenario1.test(session, baseUrl)
Expand Down