From 374da86174b2f9fdf4791d7f5242b924bb72f38e Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 21 Apr 2024 15:31:39 +0800 Subject: [PATCH 1/3] Why not use PyPI's webdriver-manager? --- README.md | 2 ++ app/test/conftest.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39bd61b..2037de6 100644 --- a/README.md +++ b/README.md @@ -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. +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 diff --git a/app/test/conftest.py b/app/test/conftest.py index 734ca87..4d3af4e 100644 --- a/app/test/conftest.py +++ b/app/test/conftest.py @@ -2,6 +2,8 @@ import pytest import sqlite3 import time from selenium import webdriver +from webdriver_manager.microsoft import EdgeChromiumDriverManager + from pathlib import Path @pytest.fixture @@ -11,7 +13,7 @@ def URL(): @pytest.fixture 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 From 8ef62395ed9b4273456a7a1411f28b493674e032 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 21 Apr 2024 15:33:45 +0800 Subject: [PATCH 2/3] Revise README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2037de6..15fc966 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ 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. -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. +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, while with the pre-installed web driver executable, it took less than 2 minutes. ## TODO From 6dbb1e2c06d3ceb1b880b21ce4908a299237a35a Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 21 Apr 2024 15:40:35 +0800 Subject: [PATCH 3/3] No webdriver manager --- app/test/conftest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/test/conftest.py b/app/test/conftest.py index 4d3af4e..ed4186c 100644 --- a/app/test/conftest.py +++ b/app/test/conftest.py @@ -2,7 +2,6 @@ import pytest import sqlite3 import time from selenium import webdriver -from webdriver_manager.microsoft import EdgeChromiumDriverManager from pathlib import Path