Test Overview
This test checks if a web application works correctly on different browsers and operating systems. It verifies that the main page loads and the login button is clickable on each platform.
This test checks if a web application works correctly on different browsers and operating systems. It verifies that the main page loads and the login button is clickable on each platform.
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import unittest class CompatibilityTest(unittest.TestCase): def setUp(self): # Example: Chrome driver setup; in real tests, this would vary per browser/OS self.driver = webdriver.Chrome() self.driver.implicitly_wait(5) def test_main_page_loads_and_login_button(self): driver = self.driver driver.get('https://example.com') # Wait for main page title to be correct WebDriverWait(driver, 10).until(EC.title_contains('Example Domain')) # Find login button by accessible name login_button = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.CSS_SELECTOR, 'button[aria-label="Login"]')) ) self.assertTrue(login_button.is_displayed(), 'Login button should be visible') def tearDown(self): self.driver.quit() if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and Chrome browser opens | Chrome browser window is open and ready | - | PASS |
| 2 | Navigates to 'https://example.com' | Browser loads the Example Domain main page | - | PASS |
| 3 | Waits until page title contains 'Example Domain' | Page title is 'Example Domain' | Title contains 'Example Domain' | PASS |
| 4 | Finds login button with aria-label 'Login' and waits until clickable | Login button is visible and enabled on the page | Login button is clickable | PASS |
| 5 | Checks if login button is displayed | Login button is visible to user | login_button.is_displayed() returns True | PASS |
| 6 | Test ends and browser closes | Browser window is closed | - | PASS |