Back to Blog
Blog

How to Test a Chat App: Test Cases and Two-Device Automation

How to test a chat app: a full test case checklist, offline and reconnect cases, push for new messages, and automated two-device flows on iOS and Android.

Written by
Gautam Agarwal
Read time
11 min read
Published
How to Test a Chat App: Test Cases and Two-Device Automation

Quick answer: to test a chat app, run each messaging journey with two users on two devices at the same time: one sends, the other receives, and the test checks delivery, order, read state and notifications on both screens, including offline, reconnect and retry cases. A chat test on one phone only proves the send button works. Chat bugs live in what the second phone sees.

A conversation needs two people. Testing chat on a single device is like rehearsing a phone call alone: you can check that your voice works, yet you learn little about whether anyone heard you, whether they heard you twice, or whether the call dropped halfway.

Key Takeaways

  • Most chat bugs appear on the receiving side, so every core test needs a sender and a receiver.
  • Test the uncertain moments: a send interrupted by a lost connection, a device that reconnects after missing messages, and a notification opened while the app was closed.
  • Give each test run its own pair of accounts, so parallel runs keep their conversations apart.
  • Cross platform chats, iOS to Android, need one side driven through your backend or a second flow.
  • BugRadar runs one flow across two phones: one agent sees both screens, acts on Device 1 or Device 2, and records results per device.

What can break in a chat app?

StageWhat can break
Accounts and contactsA user fails to find the other, or a blocked user still reaches them
SendingThe message fails silently, or sends twice after a retry
Delivery and syncMessages arrive late, out of order or only after a restart
Read receipts and typingStatus shows "read" too early, or a typing indicator gets stuck
NotificationsThe banner stays away, or the tap opens the wrong chat
Offline and reconnectMissed messages load twice, out of order or partly
MediaImages upload on one side and stay blank on the other
Same account on two devicesA message read on the phone stays unread on the tablet

Ways to test a chat app

MethodWhat it provesWhat it skips
Two phones by handEverything, onceRepeating it on every build
A backend script plays one userFast, the receiving UI on one deviceThe sender's UI
Two code driven sessions in one testBoth UIs, in codeSetup: each session needs its own driver ports and device
One flow across two devices (BugRadar)Both UIs, written as one journeyMixing iOS and Android in one run
Load testingServer behavior with thousands of usersThe UI on any device

This guide to native mobile app testing covers where code based suites fit. For most teams the useful mix is two device flows for core journeys, backend driven tests for edge cases, and a separate load test before big launches.

The chat app test case checklist

Test caseDevicesWhat to verify
Send a text message2It appears on the receiver in real time, once
Reply2Both sides show both messages in the same order
Read receipt2"Read" appears only after the receiver opens the chat
Typing indicator2It appears while typing and clears when the sender stops or leaves
Edit and delete2Changes reach the receiver
Image or file2The receiver can open the full file
Group message2 or moreEvery member receives it, the sender sees it once
Receiver in the background2A push banner appears and opens this conversation
Receiver with the app closed2The tap launches straight into the conversation
Sender goes offline mid send1 or 2The app shows a pending state and sends once on reconnect
Receiver offline, then back2Missed messages load once, in order, with the right unread count
Wi-Fi to mobile data switch1The connection recovers and every message arrives
Blocked user2Messages from them stop arriving
Long text, emoji and right to left text2Messages render fully on both sides
Chat with thousands of messages1The chat opens fast and scrolls smoothly
Same account on phone and tablet2Read state and history stay in sync

Every row marked 2 runs as one BugRadar two-device flow. The PubNub test case guide for chat apps adds operational cases worth borrowing, such as server outages and simultaneous users. The MirrorFly chat test scenarios add negative cases for registration and long calls.

__wf_reserved_inherit

How to automate two-device chat tests

Step 1: Create a two-device flow

With BugRadar: in the flow editor, open Advanced options and set Number of devices to 2. Then refer to each phone by name in the instructions:

On Device 1, sign in as ${env:CHAT_USER_A}.

On Device 2, sign in as ${env:CHAT_USER_B}.

On Device 1, open the chat with User B and send "Order 42 is ready".

On Device 2, verify that "Order 42 is ready" appears in the chat with User A.

On Device 2, reply "Thanks".

On Device 1, verify that "Thanks" appears below "Order 42 is ready".

One agent sees both screens and takes one action at a time on Device 1 or Device 2.

Step 2: Pick the devices

With BugRadar: choose a model and OS for each device when you start the run. Both devices use the same app build and platform, yet they can differ in model and OS version, so an older Android on Device 1 can chat with a newer one on Device 2. Both must be virtual, or both physical.

The same ordered device choice works from the Runs API, MCP run tools, automations and the GitHub Action, so two-device flows run on every pull request like any other flow.

Step 3: Read the results per device

With BugRadar: the run viewer shows both screens and marks which device took each action. Logs, performance data, network data and recordings are separated by device, and API results include a device_index for every device specific action.

Step 4: Keep repeat runs fast

With BugRadar: run caching works for two-device runs too. The first passing run records the steps, and later runs reuse a step only when both screens match the recording; when either screen differs, the live agent takes over for that step.

When you add a two-device flow to a suite, every flow and the suite's Auth Instructions must use the same device count, so keep two-device journeys in their own suite.

Testing chats between iOS and Android

A two-device flow uses one platform, which covers most chat logic. For cross platform cases, drive one side through your backend:

  • run the receiving app on Device 1 and Device 2 as usual
  • send the "other platform" message through your API with a runtime hook

curl --fail-with-body -X POST "${env:CHAT_API_URL}/messages" \

  -H "Authorization: Bearer ${env:CHAT_API_KEY}" \

  -d '{"from":"${env:CHAT_USER_C}","to":"${env:CHAT_USER_A}","text":"Hello from Android"}'

With BugRadar: runtime hooks run synchronously, so the flow continues only after your API accepts the message, and the next step can check that it appears on screen. Then repeat the journey in a second flow on the other platform.

Testing message notifications

New message notifications are the most used push in any chat app. Test three states: receiver in the background, receiver with the app closed, and receiver inside a different chat.

With BugRadar: in a two-device flow, press Home on Device 2 before Device 1 sends, then wait for the banner on Device 2 and tap it.

Keep test conversations apart

Chat tests write to shared state, so parallel runs collide fast. Give each run or worker its own pair of accounts, and create fresh users during the run when your backend allows it.

With BugRadar: store each pair as environment variables, and create users with email codes through leased inboxes, as this guide to OTP testing shows.

__wf_reserved_inherit

Chat app testing examples

Each example starts from a failing run and traces it to a cause and a fix.

Example 1: A message sends twice after a dropped connection

StepExpectedWhat the run showed
Device 1 sends "On my way"Message pendingMessage pending
Connection drops, then returnsOne retryTwo retries
Device 2 opens the chatOne message"On my way" twice

Cause: the client gave each retry a fresh ID, so the server stored both attempts.

Fix: attach a client generated message ID to every send and have the server drop duplicates.

With BugRadar: network data is separated by device, so the two identical send requests from Device 1 sit beside the step that triggered them.

Example 2: Missed messages arrive out of order

StepExpectedWhat the run showed
Device 2 goes offlineOfflineOffline
Device 1 sends three messagesQueued for Device 2Queued
Device 2 reconnectsMessages 1, 2, 3Messages 2, 1, 3

Cause: the client rendered messages in arrival order instead of server sequence order.

Fix: sort by the server's sequence number, and keep a reconnect journey in the suite.

With BugRadar: Device 2's recording shows the exact order the messages rendered in, next to Device 1's recording of the order they were sent.

Example 3: "Read" shows before the receiver opens the chat

StepExpectedWhat the run showed
Device 2 is in the backgroundDeliveredDelivered
Device 1 sends a messageDeliveredDelivered
The push banner appears on Device 2Still "Delivered" on Device 1"Read" on Device 1

Cause: the app marked messages as read when the notification arrived.

Fix: send the read receipt only when the conversation is on screen.

With BugRadar: the run viewer marks which device took each action, so the moment "Read" appeared on Device 1 lines up with the banner on Device 2.

Example 4: The notification opens the chat list

StepExpectedWhat the run showed
Close the app on Device 2ClosedClosed
Device 1 sends a messageBanner on Device 2Banner on Device 2
Tap the bannerThe conversation with User AThe chat list

Cause: the conversation route was registered after the launch notification arrived.

Fix: read the launch notification at startup and route once navigation is ready.

Common chat testing problems and fixes

ProblemWhat to check
Parallel runs see each other's messagesEach run uses its own pair of accounts
A suite rejects a two-device flowEvery flow and the Auth Instructions in the suite use two devices
Cross platform chat bugs slip throughA runtime hook sends from the other platform's user
Device 2 misses the pushNotification permission on Device 2 and the push setup
Tests flake on message timingWait for the message text itself, with a bounded wait

Beyond two devices

With BugRadar: a flow can use up to two devices today. For group chats with more members, drive the extra members through runtime hooks, and keep the two-device flow for the sender and one receiver.

The chat app testing process, summarized

StepWhat you doOutput
1. ListWrite the test cases from the checklistA chat test plan
2. AccountsCreate account pairs for each runIsolated conversations
3. Two devicesWrite sender and receiver journeys as two-device flowsReal time coverage
4. Edge casesAdd offline, reconnect, retry and push flowsRecovery coverage
5. Cross platformSend from the other platform through a hookiOS to Android coverage
6. AutomateRun the suite on every pull requestResults per device

Conclusion

Testing a chat app means testing the conversation, which always has two sides. Cover sending and receiving on two devices, then rehearse the uncertain moments: dropped connections, reconnects, retries and notifications opened from a closed app.

A good first step this week: create a two-device flow where Device 1 sends a message and Device 2 replies, then add a second flow that sends while Device 2 sits in the background. For a broader view of tools, see this ranking of mobile app testing tools, and for where emulators fit, this guide on emulators vs real devices.

__wf_reserved_inherit

FAQs

How do you test a chat app?

Run sender and receiver journeys on two devices, then test offline, reconnect and notification cases.

Can one automated test control two phones?

Yes. BugRadar runs one flow across two phones, with one agent acting on each device.

How do you test chat between iOS and Android?

Run one platform's devices in the flow and send from the other platform through your API.

What are the most important chat test cases?

Real time delivery, order, read receipts, retries after a lost connection, and notification taps.

How do you keep parallel chat tests apart?

Give every run its own pair of accounts, stored as environment variables.

Can group chats be tested with two devices?

Yes. Drive extra members through runtime hooks while two devices cover the main conversation.

‍

‍

Fix bugs, not tests.

Talk to an expert.

Book 30 minutes with our team. We'll show you BugRadar running on your app.

Start building.

Describe a user journey and watch an agent run it on iOS, Android, and web.

Try for free