# Shop app — example test cases

## Sign up (SIGN)

| ID | Journey | Preconditions | Steps | Expected result | WEB | AND | IOS |
|---|---|---|---|---|---|---|---|
| SIGN-01 | Sign up with an email address | Signed out. No account exists for the email you will use | 1. Open the app. 2. Tap Create account. 3. Enter a name, a new email address and a password of at least 8 characters. 4. Tap Create account. | The home screen opens with the name you entered at the top. A verification email arrives within a minute. | | | |
| SIGN-02 | Sign up with an email that already has an account | Signed out. An account already exists for the email | 1. Tap Create account. 2. Enter that email, a name and a valid password. 3. Tap Create account. | A message says an account already exists for this email and offers Sign in and Forgot password. No second account is created. | | | |
| SIGN-03 | A password that is too short is refused | Signed out | 1. Tap Create account. 2. Enter a name, a new email and a 7-character password. 3. Tap Create account. | A message beside the password field gives the minimum length. The name and email are still filled in. No account is created. | | | |

## Password reset (RESET)

| ID | Journey | Preconditions | Steps | Expected result | WEB | AND | IOS |
|---|---|---|---|---|---|---|---|
| RESET-01 | Reset a forgotten password | Signed out. An existing account whose inbox you can open | 1. Tap Sign in, then Forgot password. 2. Enter the account's email and submit. 3. Open the link in the reset email. 4. Set a new password. 5. Sign in with the new password. | The new password signs you in. Signing in with the old password fails with the usual wrong-password message. | | | |
| RESET-02 | A reset link only works once | A reset link that has already been used to set a new password | 1. Open the same link again. | A page says the link has expired or been used, with a way to ask for a new one. The password is not changed. | | | |
| RESET-03 | Reset for an unknown email gives nothing away | Signed out. No account exists for the email | 1. Tap Forgot password. 2. Enter the unknown email and submit. | The same confirmation appears as for a real account. No email arrives, and nothing on screen says the account does not exist. | | | |

## Checkout (PAY)

| ID | Journey | Preconditions | Steps | Expected result | WEB | AND | IOS |
|---|---|---|---|---|---|---|---|
| PAY-01 | Pay with a saved card | Signed in. A saved card that will succeed. One item in the basket | 1. Open the basket. 2. Tap Checkout. 3. Choose the saved card. 4. Tap Pay. | A confirmation shows an order number and the same total as the basket. A receipt email arrives. The basket is empty. | | | |
| PAY-02 | A declined card is handled | Signed in. A test card that will decline. One item in the basket | 1. Open the basket. 2. Tap Checkout. 3. Enter the declining card. 4. Tap Pay. | A message says the card was declined and offers another way to pay. The basket keeps its item. No order appears under Orders. | | | |
| PAY-03 | Tapping Pay twice charges once | Signed in. A saved card. One item in the basket | 1. Go to checkout. 2. Tap Pay twice, quickly. | One order is created and the card is charged once. The button shows it is working after the first tap. | | | |

## Offline (NET)

| ID | Journey | Preconditions | Steps | Expected result | WEB | AND | IOS |
|---|---|---|---|---|---|---|---|
| NET-01 | Open the app with no connection | Signed in. The app opened once before. Aeroplane mode on | 1. Open the app. | A clear no-connection message with a Retry button, not an endless spinner. Anything already loaded is still shown. | | | |
| NET-02 | The connection drops during payment | Signed in. A saved card. One item in the basket | 1. Tap Pay. 2. Turn on aeroplane mode before the confirmation appears. 3. Turn it off again. 4. Open Orders. | The app says the payment may not have gone through and how to check. Orders shows at most one order. Paying again does not charge twice. | | | |

## Permissions (PERM)

| ID | Journey | Preconditions | Steps | Expected result | WEB | AND | IOS |
|---|---|---|---|---|---|---|---|
| PERM-01 | Notifications are asked for at the right moment | A fresh install | 1. Open the app. 2. Sign up. 3. Place a first order. | No prompt on first launch. The prompt appears after the first order, with a line saying the notifications are for order updates. | N/A | | |
| PERM-02 | Camera denied is survivable | Signed in. Camera access denied for the app in system settings | 1. Open Profile. 2. Tap Change photo. 3. Choose Take photo. | A message says camera access is off, with a button that opens the app's settings and an option to pick from the photo library instead. No crash, and no repeated prompt. | N/A | | |
