# Real-World Examples

Ready-to-use test case patterns for common mobile app flows. Copy, adapt, and use these in your own tests.

***

## Login Flow

A complete authentication test:

```
Launch MyApp
Tap the "Login" button
Enter "john.doe@example.com" in the email field
Enter "SecurePass123" in the password field
Tap the "Sign In" button
Wait for 3 seconds
Verify the home screen displays
```

***

## Form Submission

Create and save data:

```
Tap the "New Entry" button
Enter "Buy groceries" in the title field
Enter "Milk, eggs, bread" in the description field
Swipe up to view the submit button
Tap the "Save" button
Wait for 2 seconds
Verify the task "Buy groceries" appears in the list
```

***

## Search and Filter

Search with filters applied:

```
Tap the search bar at the top
Enter "laptop"
Press enter to search
Wait for 5 seconds
Swipe up to view more results
Tap the "Filters" button
Tap "Price: Low to High"
Verify the results are sorted by price
```

***

## E-commerce: Complete Purchase Flow

Test an entire shopping experience:

```
Launch ShopApp with a clean state
Tap "Sign In"
Enter "buyer@example.com" in the email field
Enter "shoppass123" in the password field
Tap "Login"
Wait for 3 seconds
Tap the search bar
Enter "running shoes"
Press enter to search
Wait for 5 seconds
Tap the first product in the results
Swipe up to view product details
Tap "Add to Cart"
Wait for 2 seconds
Verify the cart icon shows "1"
Tap the cart icon
Verify the product "Running Shoes" is in the cart
Tap "Proceed to Checkout"
Verify the checkout screen is displayed
```

***

## Social Media: Create and Delete Post

Full content lifecycle:

```
Launch SocialApp with notifications permission
Tap "Create Post"
Enter "Hello from automated testing!" in the post field
Tap the camera icon
Tap "Allow" on the camera permission dialog
Tap "Take Photo"
Wait for 2 seconds
Tap "Use Photo"
Tap "Post"
Wait for 3 seconds
Verify the post appears in the feed
Long press the post
Tap "Delete Post"
Tap "Confirm"
Verify the post is removed from the feed
```

***

## Settings: Language Change

Test localization:

```
Launch ConfigApp
Tap the menu icon
Tap "Settings"
Tap "Language & Region"
Tap "Español"
Wait for 2 seconds
Verify the settings header shows "Configuración"
Navigate back
Tap "Notifications"
Tap the toggle for "Email Notifications"
Verify the toggle is disabled
Navigate back to the previous screen
Navigate back to the previous screen
Verify the main menu is displayed in Spanish
```

***

## Cross-App: Photo Upload from Gallery

Testing app integrations:

```
Launch PhotoApp
Tap "Create New Album"
Enter "Vacation 2024" in the album name field
Tap "Create"
Tap "Add Photos"
Launch the Gallery app
Tap the album "Camera Roll"
Tap the first photo
Tap the second photo
Tap "Done"
Launch PhotoApp
Wait for 2 seconds
Verify 2 photos are displayed in the "Vacation 2024" album
```

***

## Background & Foreground Testing

Test operations that continue in background:

```
Launch MyApp
Tap "Start Download"
Wait for 2 seconds
Verify the download progress shows "10%"
Navigate to home screen
Wait for 5 seconds
Launch MyApp
Verify the download completed with "100%"
```

***

## Location-Based Testing

Test geolocation features:

```
Set location to New York City
Launch MapApp with location permission
Tap the "Find Nearby" button
Wait for 5 seconds
Verify nearby locations are displayed
Tap the first location
Verify the location details show address in New York
Set location to San Francisco
Tap the refresh button
Wait for 5 seconds
Verify the location details updated to San Francisco area
```

***

## Tips for Writing Tests

### Be Specific and Clear

✅ **Good:** `Tap the blue "Submit" button at the bottom`

❌ **Avoid:** `Tap submit`

### Use Exact Text When Quoted

```
Tap "Settings"     ← Must find exactly "Settings"
Tap the settings button  ← Can find variations
```

### Include Visual Context

```
Tap the search icon in the top-right corner
Tap the first product in the list
Tap the red "Delete" button next to the item title
```

### Verify Your Actions

```
Tap the "Add to Cart" button
Wait for 2 seconds
Verify the cart count shows "1"
```

### Handle Platform Differences

```
// Android
Navigate back to the previous screen

// iOS
Tap the back button in the top-left corner
```
