File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ beautifulsoup4
33numpy
44opencv-python
55pillow
6- selenium == 4.6.1
6+ selenium => 4.6.1 , < 5
77undetected-chromedriver
Original file line number Diff line number Diff line change 11import os
2+ import platform
3+
24import pytest
35import conftest
46
57from PIL import Image
6- from botcity .web import WebBot , By
8+ from botcity .web import WebBot , By , Browser
79
810
911def test_context (web : WebBot ):
@@ -201,12 +203,12 @@ def test_leave_iframe(web: WebBot):
201203def test_get_view_port_size (web : WebBot ):
202204 web .browse (conftest .INDEX_PAGE )
203205 size = web .get_viewport_size ()
204-
205- element = web .find_element ( 'window-size' , By . ID ). text
206- print ( f"Elements by selenium { element } " )
207- element = element . split ( 'x' )
208- print ( f"Elements by split to x { element } " )
209- print ( f"Transform in int and insert in tuple: { tuple ( int ( e ) for e in element ) } " )
206+ if web . browser == Browser . UNDETECTED_CHROME and conftest . platforms . get ( platform . system ()) == 'mac' :
207+ width = web .execute_javascript ( "return window.innerWidth" )
208+ height = web . execute_javascript ( "return window.innerHeight " )
209+ element = [ width , height ]
210+ else :
211+ element = web . find_element ( 'window-size' , By . ID ). text . split ( 'x' )
210212 assert size == tuple (int (e ) for e in element )
211213
212214
You can’t perform that action at this time.
0 commit comments