import pytest
# Sample test strategy content simulating the document
TEST_STRATEGY_CONTENT = {
'manual_testing': 'Manual testing involves human testers executing test cases without automation.',
'automated_testing': 'Automated testing uses scripts and tools to run tests automatically.',
'exploratory_testing': 'Exploratory testing is simultaneous learning, test design, and execution.',
'regression_testing': 'Regression testing ensures new changes do not break existing features.'
}
@pytest.fixture
def test_strategy():
# Simulate loading the test strategy document
return TEST_STRATEGY_CONTENT
@pytest.mark.parametrize("section,expected_text", [
('manual_testing', 'Manual testing involves human testers executing test cases without automation.'),
('automated_testing', 'Automated testing uses scripts and tools to run tests automatically.'),
('exploratory_testing', 'Exploratory testing is simultaneous learning, test design, and execution.'),
('regression_testing', 'Regression testing ensures new changes do not break existing features.')
])
def test_testing_approach_sections_present(test_strategy, section, expected_text):
assert section in test_strategy, f"Section '{section}' is missing in the test strategy document."
assert test_strategy[section] == expected_text, f"Content for '{section}' does not match expected description."This test script uses pytest to verify that the test strategy document contains the required sections describing different testing approaches.
The test_strategy fixture simulates loading the document content as a dictionary.
The test function test_testing_approach_sections_present is parameterized to check each section's presence and content separately, making the test clear and focused.
Assertions include messages to help understand failures clearly.