0
0
Testing Fundamentalstesting~10 mins

Mobile-specific test cases 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 app handles screen rotation correctly.

Testing Fundamentals
def test_screen_rotation():
    app.launch()
    app.rotate_screen([1])
    assert app.is_ui_stable()
Drag options to blanks, or click blank then click option'
A"landscape"
B"rotate"
C"portrait"
D"flip"
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid orientation strings like "flip" or "rotate" which are not recognized.
Forgetting to assert UI stability after rotation.
2fill in blank
medium

Complete the code to simulate a low battery condition in the mobile app test.

Testing Fundamentals
def test_low_battery_warning():
    device.set_battery_level([1])
    app.launch()
    assert app.shows_low_battery_warning()
Drag options to blanks, or click blank then click option'
A80
B15
C50
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Setting battery level too high, so warning does not appear.
Not simulating battery level before launching the app.
3fill in blank
hard

Fix the error in the code that tests app behavior when network is lost.

Testing Fundamentals
def test_network_loss():
    device.set_network_status([1])
    app.perform_sync()
    assert app.sync_failed()
Drag options to blanks, or click blank then click option'
A"no_network"
B"disconnect"
C"offline"
D"lost"
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported network status strings causing runtime errors.
Not setting network status before syncing.
4fill in blank
hard

Fill both blanks to create a test that verifies app behavior on different screen sizes.

Testing Fundamentals
def test_screen_size():
    device.set_screen_size([1])
    app.launch()
    assert app.layout_is_responsive([2])
Drag options to blanks, or click blank then click option'
A"small"
B"large"
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect screen size strings.
Asserting with wrong boolean values.
5fill in blank
hard

Fill all three blanks to test app behavior when switching between Wi-Fi and mobile data.

Testing Fundamentals
def test_network_switch():
    device.set_network_type([1])
    app.sync_data()
    device.set_network_type([2])
    app.sync_data()
    assert app.sync_successful([3])
Drag options to blanks, or click blank then click option'
A"wifi"
B"mobile"
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid network type strings.
Asserting sync failure instead of success.