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
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}

- name: Install geckodriver
- name: Install chromedriver
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
wget https://chromedriver.storage.googleapis.com/108.0.5359.71/chromedriver_linux64.zip
mkdir chromedriver
unzip chromedriver_linux64.zip -d chromedriver
export PATH=$PATH:$PWD/chromedriver

- name: Install choosenim
run: |
Expand Down
2 changes: 1 addition & 1 deletion nimforum.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requires "sass#649e0701fa5c"

requires "karax#45bac6b"

requires "webdriver#429933a"
requires "webdriver#699d3b9"

# Tasks

Expand Down
12 changes: 6 additions & 6 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=4444 --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 session = driver.createSession(%*{"capabilities": {"browserName": "chrome"}})

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