forked from mrlan/EnglishPal
Why not use PyPI's webdriver-manager?
parent
e8fbccdcf7
commit
374da86174
|
@ -150,6 +150,8 @@ Run English Pal first, then run the test using pytest as follows: pytest --html=
|
||||||
|
|
||||||
The above command will generate a HTML report file pytest_report.html after finishing executing test_add_word.py. Note: you need to install pytest-html package first: pip install pytest-html.
|
The above command will generate a HTML report file pytest_report.html after finishing executing test_add_word.py. Note: you need to install pytest-html package first: pip install pytest-html.
|
||||||
|
|
||||||
|
You may also want to use [webdriver-manager](https://pypi.org/project/webdriver-manager/) from PyPI, so that you can avoid tediously installing a web driver executable manually. However, my experience shows that webdriver-manager is too slow. For example, it took me 16 minutes to run 9 tests, which with the pre-installed web driver executable, it was 5 times faster.
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ import pytest
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import time
|
import time
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
|
from webdriver_manager.microsoft import EdgeChromiumDriverManager
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -11,7 +13,7 @@ def URL():
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def driver():
|
def driver():
|
||||||
return webdriver.Edge() # uncomment this line if you wish to run the test on your laptop
|
return webdriver.Edge() # follow the "End-to-end testing" section in README.md to install the web driver executable
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
Loading…
Reference in New Issue