0
0
Testing Fundamentalstesting~10 mins

Agile testing approach in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
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.

Test Code - Selenium with unittest
Testing Fundamentals
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()
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test starts and Chrome browser opensBrowser window is open and ready-PASS
2Navigates to 'https://example.com/new-feature'Page with new feature loads-PASS
3Waits until the feature header with CSS selector 'h1.feature-title' is visibleHeader element is visible on the pageHeader text equals 'New Feature'PASS
4Finds the button with ID 'start-feature-btn'Button element is present in the DOMButton is enabled (clickable)PASS
5Clicks the 'start-feature-btn' buttonPage reacts to button click, modal or next page loads-PASS
6Waits until the modal with ID 'feature-modal' is visibleModal dialog is displayed on screenModal is displayedPASS
7Test ends and browser closesBrowser window is closed-PASS
Failure Scenario
Failing Condition: The button with ID 'start-feature-btn' is not found or not enabled
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify after loading the new feature page?
AThe browser title is 'Home'
BThe header text is 'New Feature'
CThe URL contains 'login'
DThe footer is visible
Key Result
In Agile testing, continuous verification of small features with quick feedback is key. Using explicit waits ensures tests check elements only when ready, reducing flaky failures.