File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
allAutomation/my_project/tests Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 26
26
sudo apt-get update
27
27
sudo apt-get install -y portaudio19-dev python3-dev
28
28
sudo apt-get install -y google-chrome-stable
29
+ pip install selenium pytest webdriver-manager
30
+
29
31
30
32
31
33
- name : Install Python packages
35
37
pip install pytest-html==3.2.0
36
38
pip install pytest-mock==3.11.1
37
39
pip install pyaudio
38
- pip install webdriver-manager==3.8.6
39
40
pip install selenium pytest gtts comtypes
40
41
41
42
Original file line number Diff line number Diff line change 4
4
from selenium .webdriver .chrome .options import Options as ChromeOptions
5
5
from webdriver_manager .chrome import ChromeDriverManager
6
6
7
-
8
7
@pytest .fixture (scope = "module" )
9
8
def setup ():
10
9
# Initialize ChromeOptions
@@ -22,10 +21,8 @@ def setup():
22
21
chrome_options .add_argument ("--use-fake-ui-for-media-stream" )
23
22
chrome_options .add_argument ("--use-file-for-fake-audio-capture=output_audio.wav" )
24
23
25
-
26
-
27
- # Initialize Chrome WebDriver using WebDriverManager
28
- service = Service (ChromeDriverManager ().install ())
24
+ # Initialize Chrome WebDriver using WebDriverManager with a specific version
25
+ service = Service (ChromeDriverManager (version = " 126.0.6478.127" ).install ())
29
26
driver = webdriver .Chrome (service = service , options = chrome_options )
30
27
31
28
driver .maximize_window ()
@@ -34,11 +31,11 @@ def setup():
34
31
yield driver
35
32
36
33
# Teardown - Close the browser
37
- # driver.quit()
38
-
34
+ driver .quit ()
39
35
40
36
def test_open_website (setup ):
41
37
driver = setup # Using the WebDriver instance from setup fixture
42
38
43
39
# Open a website
44
40
driver .get ('https://d114esnbvw5tst.cloudfront.net/' )
41
+ assert "Title of the website" in driver .title # Adjust this assertion as needed
You can’t perform that action at this time.
0 commit comments