From 3f6c36c6ef28314e876800b32ce5b5d81347dfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CShahid?= <“shahid.k@browserstack.com”> Date: Thu, 17 Aug 2023 20:15:43 +0530 Subject: [PATCH 1/2] supported changes --- Makefile | 8 ++++---- requirements.txt | 2 +- tests/todo.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9715b73..ab55caf 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ VENVDEPS=$(REQUIREMENTS setup.py) NPMDEPS=$(package-lock.json) $(VENV): - python -m venv .venv - $(VENV)/python -m pip install --upgrade pip + python3 -m venv .venv + $(VENV)/python3 -m pip install --upgrade pip $(VENV)/$(MARKER): $(VENVDEPS) | $(VENV) $(VENV)/pip install $(foreach path,$(REQUIREMENTS),-r $(path)) @@ -27,7 +27,7 @@ clean: rm -rf $$(cat .gitignore) serve: - $(VENV)/python -m http.server 8000 + $(VENV)/python3 -m http.server 8000 test: install - $(NPM)/percy exec -- $(VENV)/python tests/todo.py + $(NPM)/percy exec -- $(VENV)/python3 tests/todo.py diff --git a/requirements.txt b/requirements.txt index 3f7c66d..a5ff456 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -selenium==3.* +selenium==4.* percy-selenium==1.* requests==2.* diff --git a/tests/todo.py b/tests/todo.py index 8f080ad..668463a 100644 --- a/tests/todo.py +++ b/tests/todo.py @@ -7,7 +7,7 @@ # start the example app in another thread httpd = HTTPServer(('localhost', 8000), SimpleHTTPRequestHandler) thread = Thread(target=httpd.serve_forever) -thread.setDaemon(True) +thread.daemon = True thread.start() # launch firefox headless @@ -23,13 +23,13 @@ percy_snapshot(browser, 'Empty Todo State') # snapshot with a new todo -new_todo_input = browser.find_element_by_class_name('new-todo') +new_todo_input = browser.find_element('class name', 'new-todo') new_todo_input.send_keys('Try Percy') new_todo_input.send_keys(Keys.ENTER) percy_snapshot(browser, 'With a Todo') # snapshot with a completed todo -todo_toggle = browser.find_element_by_class_name('toggle') +todo_toggle = browser.find_element('class name', 'toggle') todo_toggle.click() percy_snapshot(browser, 'Completed Todo') From 15e6ba4efb22f8d39b0f6cf87eb57becac3fd91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CShahid?= <“shahid.k@browserstack.com”> Date: Tue, 29 Aug 2023 11:44:57 +0530 Subject: [PATCH 2/2] comment make file --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ab55caf..5a87eae 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,12 @@ VENVDEPS=$(REQUIREMENTS setup.py) NPMDEPS=$(package-lock.json) $(VENV): - python3 -m venv .venv - $(VENV)/python3 -m pip install --upgrade pip + python -m venv .venv + $(VENV)/python -m pip install --upgrade pip + +# For python 3 on Mac, uncomment below code +# python3 -m venv .venv +# $(VENV)/python3 -m pip install --upgrade pip $(VENV)/$(MARKER): $(VENVDEPS) | $(VENV) $(VENV)/pip install $(foreach path,$(REQUIREMENTS),-r $(path)) @@ -27,7 +31,13 @@ clean: rm -rf $$(cat .gitignore) serve: - $(VENV)/python3 -m http.server 8000 + $(VENV)/python -m http.server 8000 + +# For python 3 on Mac, uncomment below code +# $(VENV)/python3 -m http.server 8000 test: install - $(NPM)/percy exec -- $(VENV)/python3 tests/todo.py + $(NPM)/percy exec -- $(VENV)/python tests/todo.py + +# For python 3 on Mac, uncomment below code +# $(NPM)/percy exec -- $(VENV)/python3 tests/todo.py \ No newline at end of file