Skip to content

Commit

Permalink
all_Automation_Git_Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKadam-Tekdi committed Jul 15, 2024
1 parent 3623649 commit 8ba0971
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 3 additions & 0 deletions allAutomation/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 21 additions & 17 deletions allAutomation/my_project/tests/BrowserManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,36 @@
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options as ChromeOptions
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager


@pytest.fixture(scope="module")
def setup():
# Initialize ChromeOptions
chrome_options = ChromeOptions()
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--remote-debugging-port=9222")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--remote-allow-origins=*")
chrome_options.add_argument("--incognito")
chrome_options.add_argument("--use-fake-ui-for-media-stream")
chrome_options.add_argument("--use-file-for-fake-audio-capture=output_audio.wav")

# Specify the ChromeDriver version
service = Service(ChromeDriverManager(version="114.0.5735.90").install())
driver = webdriver.Chrome(service=service, options=chrome_options)
driver = webdriver.Chrome(service=service, options=chrome_options)
options = Options()
options.add_argument("--headless") # Run Chrome in headless mode
options.add_argument("--no-sandbox") # Bypass OS security model
options.add_argument("--disable-dev-shm-usage") # Overcome limited resource problems
options.add_argument("--remote-debugging-port=9222")
options.add_argument("--disable-gpu")
options.add_argument("--remote-allow-origins=*")
options.add_argument("--incognito")
options.add_argument("--use-fake-ui-for-media-stream")
options.add_argument("--use-file-for-fake-audio-capture=path/to/audio/file.wav")

# Uncomment and set the correct path to load extension
# options.add_argument("load-extension=path/to/extension")

driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=options)
yield driver

driver.maximize_window()

# Return the WebDriver instance for the tests to use
yield driver
# yield driver

# Teardown - Close the browser
# driver.quit()
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion allAutomation/my_project/tests/microphoneSimulationTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def test_microphone_simulation(setup):
driver.find_element(By.XPATH, "//button[@type='submit']").click()

# Wait for UI to update
waitForUi(2)
time.sleep(3)

# Click on Start assessment button
Expand Down

0 comments on commit 8ba0971

Please sign in to comment.