Test Overview
This test simulates a pair testing session where two testers work together to test a simple login form. It verifies that both testers can interact with the form and validate the login functionality collaboratively.
This test simulates a pair testing session where two testers work together to test a simple login form. It verifies that both testers can interact with the form and validate the login functionality collaboratively.
class PairTestingSimulation: def __init__(self): self.login_successful = False self.tester1_input = None self.tester2_input = None def tester1_enters_username(self, username): self.tester1_input = username def tester2_enters_password(self, password): self.tester2_input = password def submit_login(self): if self.tester1_input == 'user' and self.tester2_input == 'pass': self.login_successful = True else: self.login_successful = False import unittest class TestPairTesting(unittest.TestCase): def test_pair_login(self): session = PairTestingSimulation() session.tester1_enters_username('user') session.tester2_enters_password('pass') session.submit_login() self.assertTrue(session.login_successful, 'Login should be successful with correct credentials') if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and PairTestingSimulation instance is created | A new testing session is ready with no inputs | - | PASS |
| 2 | Tester 1 enters username 'user' | Username field set to 'user' | - | PASS |
| 3 | Tester 2 enters password 'pass' | Password field set to 'pass' | - | PASS |
| 4 | Submit login is triggered | System checks if username and password match expected values | Check if login_successful is True | PASS |
| 5 | Assertion verifies login success | login_successful is True | assertTrue(login_successful) | PASS |