Test Overview
This test simulates a simple Agile testing cycle where a tester verifies a new feature in a web application. It checks that the feature loads correctly and that a key button is clickable, reflecting continuous testing in Agile.
This test simulates a simple Agile testing cycle where a tester verifies a new feature in a web application. It checks that the feature loads correctly and that a key button is clickable, reflecting continuous testing in Agile.
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 AgileFeatureTest(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() self.driver.implicitly_wait(5) def test_feature_button_clickable(self): driver = self.driver driver.get('https://example.com/new-feature') # Wait until the feature header is visible header = WebDriverWait(driver, 10).until( EC.visibility_of_element_located((By.CSS_SELECTOR, 'h1.feature-title')) ) self.assertEqual(header.text, 'New Feature') # Find the action button and check if clickable button = driver.find_element(By.ID, 'start-feature-btn') self.assertTrue(button.is_enabled()) # Click the button button.click() # Verify the next page or modal appears modal = WebDriverWait(driver, 10).until( EC.visibility_of_element_located((By.ID, 'feature-modal')) ) self.assertTrue(modal.is_displayed()) def tearDown(self): self.driver.quit() if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and Chrome browser opens | Browser window is open and ready | — | PASS |
| 2 | Navigates to 'https://example.com/new-feature' | Page with new feature loads | — | PASS |
| 3 | Waits until the feature header with CSS selector 'h1.feature-title' is visible | Header element is visible on the page | Header text equals 'New Feature' | PASS |
| 4 | Finds the button with ID 'start-feature-btn' | Button element is present in the DOM | Button is enabled (clickable) | PASS |
| 5 | Clicks the 'start-feature-btn' button | Page reacts to button click, modal or next page loads | — | PASS |
| 6 | Waits until the modal with ID 'feature-modal' is visible | Modal dialog is displayed on screen | Modal is displayed | PASS |
| 7 | Test ends and browser closes | Browser window is closed | — | PASS |
Testers run automated tests after each code change.
Developers fix bugs immediately.
Tests pass successfully every time.Run all tests only once at the end of the sprint.Pass the test and this pattern moves unknown