0
0
Testing Fundamentalstesting~10 mins

Why documentation ensures repeatability in Testing Fundamentals - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show how documentation helps repeat tests.

Testing Fundamentals
def test_login():
    # Step 1: Open browser
    open_browser()
    # Step 2: Enter username
    enter_text('username_field', [1])
    # Step 3: Enter password
    enter_text('password_field', 'pass123')
    # Step 4: Click login
    click_button('login')
    assert is_logged_in() == True
Drag options to blanks, or click blank then click option'
A'test'
B'random_user'
C'admin_user'
D'guest'
Attempts:
3 left
💡 Hint
Common Mistakes
Using random or changing usernames that break repeatability.
2fill in blank
medium

Complete the code to document the expected result for repeatability.

Testing Fundamentals
def test_add_item():
    add_item('apple')
    result = get_cart_items()
    assert result == [1]
Drag options to blanks, or click blank then click option'
A['banana']
B['apple', 'banana']
C[]
D['apple']
Attempts:
3 left
💡 Hint
Common Mistakes
Expecting wrong or extra items in the cart.
3fill in blank
hard

Fix the error in the test to follow documented steps for repeatability.

Testing Fundamentals
def test_remove_item():
    add_item('orange')
    remove_item([1])
    result = get_cart_items()
    assert result == []
Drag options to blanks, or click blank then click option'
A'orange'
B'banana'
C'grape'
D'apple'
Attempts:
3 left
💡 Hint
Common Mistakes
Removing an item not added, causing test failure.
4fill in blank
hard

Fill both blanks to document a test that checks login failure with wrong password.

Testing Fundamentals
def test_login_fail():
    enter_text('username_field', [1])
    enter_text('password_field', [2])
    click_button('login')
    assert is_logged_in() == False
Drag options to blanks, or click blank then click option'
A'admin_user'
B'wrong_pass'
C'guest_user'
D'123456'
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid usernames or correct passwords that break the test logic.
5fill in blank
hard

Fill all three blanks to document a test that verifies item quantity update.

Testing Fundamentals
def test_update_quantity():
    add_item([1])
    update_quantity([2], [3])
    result = get_item_quantity([2])
    assert result == 5
Drag options to blanks, or click blank then click option'
A'apple'
C5
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using different item names or quantities than documented.