0
0
Testing Fundamentalstesting~10 mins

Acceptance criteria verification in Testing Fundamentals - Interactive Code Practice

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

Complete the code to check if the feature meets the acceptance criteria by verifying the output status.

Testing Fundamentals
def test_feature_output():
    output = feature_function()
    assert output.status == [1]
Drag options to blanks, or click blank then click option'
A"passed"
B"completed"
C"done"
D"success"
Attempts:
3 left
💡 Hint
Common Mistakes
Using synonyms like 'completed' or 'done' instead of the exact 'success' string.
2fill in blank
medium

Complete the code to verify the acceptance criteria that the returned list contains exactly 3 items.

Testing Fundamentals
def test_list_length():
    result = get_items()
    assert len(result) == [1]
Drag options to blanks, or click blank then click option'
A2
B4
C3
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect expected length values like 2 or 4.
3fill in blank
hard

Fix the error in the assertion to correctly verify the acceptance criteria that the user role must be 'admin'.

Testing Fundamentals
def test_user_role():
    user = get_current_user()
    assert user.role == [1]
Drag options to blanks, or click blank then click option'
A"admin"
B"guest"
C"user"
D"moderator"
Attempts:
3 left
💡 Hint
Common Mistakes
Using roles other than 'admin' in the assertion.
4fill in blank
hard

Fill both blanks to verify acceptance criteria: the response code must be 200 and the response message must be 'OK'.

Testing Fundamentals
def test_response():
    response = get_response()
    assert response.code == [1]
    assert response.message == [2]
Drag options to blanks, or click blank then click option'
A200
B404
C"OK"
D"Error"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong status codes like 404 or messages like 'Error'.
5fill in blank
hard

Fill all three blanks to verify acceptance criteria: the data dictionary must have key 'id' with value 123, and key 'status' with value 'active'.

Testing Fundamentals
def test_data_dict():
    data = get_data()
    assert data[[1]] == [2]
    assert data[[3]] == "active"
Drag options to blanks, or click blank then click option'
A"id"
B123
C"status"
D"inactive"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys or values like 'inactive' instead of 'active'.