Test Overview
This test opens Chrome with a custom configuration to disable notifications and verifies the browser starts with these settings applied.
This test opens Chrome with a custom configuration to disable notifications and verifies the browser starts with these settings applied.
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options import unittest class TestChromeConfig(unittest.TestCase): def setUp(self): chrome_options = Options() chrome_options.add_argument('--disable-notifications') self.driver = webdriver.Chrome(service=Service(), options=chrome_options) def test_chrome_starts_with_disabled_notifications(self): self.driver.get('https://www.example.com') title = self.driver.title self.assertIn('Example Domain', title) def tearDown(self): self.driver.quit() if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and ChromeOptions is configured to disable notifications | ChromeOptions object created with '--disable-notifications' argument | - | PASS |
| 2 | Chrome browser opens with the configured options | Chrome browser window opens without notification popups | - | PASS |
| 3 | Browser navigates to 'https://www.example.com' | Example Domain page loads in browser | - | PASS |
| 4 | Test checks if page title contains 'Example Domain' | Page title is 'Example Domain' | assertIn('Example Domain', title) | PASS |
| 5 | Test ends and browser closes | Chrome browser window closes | - | PASS |