3939LIST_CHROMIUM_VERSIONS = ['140.0' , '139.0' , '138.0' , '137.0' , '136.0' , '135.0' , '134.0' ]
4040LIST_FIREFOX_VERSIONS = ['142.0' , '141.0' , '140.0' , '139.0' , '138.0' , '137.0' , '136.0' ]
4141LIST_PLATFORMS = ['Linux' , None , 'Windows 11' ]
42+ TEST_SITE = os .environ .get ('TEST_SITE' , 'the-internet.herokuapp.com' )
4243
4344if not TEST_MULTIPLE_VERSIONS_EXPLICIT :
4445 LIST_CHROMIUM_VERSIONS .append (None )
6566class SeleniumGenericTests (unittest .TestCase ):
6667
6768 def test_title (self ):
68- self .driver .get ('https ://the-internet.herokuapp.com ' )
69+ self .driver .get (f'http ://{ TEST_SITE } ' )
6970 wait = WebDriverWait (self .driver , WEB_DRIVER_WAIT_TIMEOUT )
7071 wait .until (EC .title_is ('The Internet' ))
7172 self .assertTrue (self .driver .title == 'The Internet' )
7273
7374 # https://github.com/tourdedave/elemental-selenium-tips/blob/master/03-work-with-frames/python/frames.py
7475 def test_with_frames (self ):
7576 driver = self .driver
76- driver .get ('http://the-internet.herokuapp.com /nested_frames' )
77+ driver .get (f 'http://{ TEST_SITE } /nested_frames' )
7778 wait = WebDriverWait (driver , WEB_DRIVER_WAIT_TIMEOUT )
7879 frame_top = wait .until (EC .frame_to_be_available_and_switch_to_it ('frame-top' ))
7980 frame_middle = wait .until (EC .frame_to_be_available_and_switch_to_it ('frame-middle' ))
@@ -82,7 +83,7 @@ def test_with_frames(self):
8283 # https://github.com/tourdedave/elemental-selenium-tips/blob/master/05-select-from-a-dropdown/python/dropdown.py
8384 def test_select_from_a_dropdown (self ):
8485 driver = self .driver
85- driver .get ('http://the-internet.herokuapp.com /dropdown' )
86+ driver .get (f 'http://{ TEST_SITE } /dropdown' )
8687 dropdown_list = driver .find_element (By .ID , 'dropdown' )
8788 options = dropdown_list .find_elements (By .TAG_NAME , 'option' )
8889 for opt in options :
@@ -98,7 +99,7 @@ def test_select_from_a_dropdown(self):
9899 # https://github.com/tourdedave/elemental-selenium-tips/blob/master/13-work-with-basic-auth/python/basic_auth_1.py
99100 def test_visit_basic_auth_secured_page (self ):
100101 driver = self .driver
101- driver .get ('http://admin:admin@the-internet.herokuapp.com /basic_auth' )
102+ driver .get (f 'http://admin:admin@{ TEST_SITE } /basic_auth' )
102103 page_message = driver .find_element (By .CSS_SELECTOR , '.example p' ).text
103104 self .assertTrue (page_message == 'Congratulations! You must have the proper credentials.' )
104105
@@ -116,7 +117,7 @@ def test_play_video(self):
116117
117118 def test_download_file (self ):
118119 driver = self .driver
119- driver .get ('https ://the-internet.herokuapp.com /download' )
120+ driver .get (f'http ://{ TEST_SITE } /download' )
120121 file_name = 'some-file.txt'
121122 wait = WebDriverWait (driver , 30 )
122123 file_link = wait .until (EC .element_to_be_clickable ((By .LINK_TEXT , file_name )))
@@ -305,7 +306,7 @@ def setUp(self):
305306 raise e
306307
307308 def test_title_and_maximize_window (self ):
308- self .driver .get ('https ://the-internet.herokuapp.com ' )
309+ self .driver .get (f'http ://{ TEST_SITE } ' )
309310 self .driver .maximize_window ()
310311 self .assertTrue (self .driver .title == 'The Internet' )
311312
0 commit comments