Looking for guidance on testing a complete food ordering and delivery process in Flutter

73 Views Asked by At

I am working on a project that involves three Flutter apps: a customer app, a driver app, and a pioneer app. We have already written integration tests for each app, but now we need to write a full end-to-end integration test that covers the entire cycle of ordering food from the pioneer app, delivering it to the customer, and marking the order as delivered. Specifically, we need to first run an integration test on the pioneer app to create a product, then run a second integration test on the customer app to order this product, and finally, open the pioneer app to accept the order and run an integration test on the driver app to accept and deliver the order to the customer. Can anyone suggest a way to achieve this in Flutter?

i am using patrol in integration test.

1

There are 1 best solutions below

0
On

You can run all 3 apps simultaneously. A batch file running each on web could even work on a remote linux system (the batch file may need to start other batch files, each doing a flutter run -d web). If you want to automate the sequence of tests, then you would need some sort of controller which can wait for a test to finish before starting the next.

You could use one of the 3 apps or your backend to create an http service which indicates which phase of testing should currently be running.

I recommend setting it up as follows:

  1. Create the test server as a route on your backend
  2. Create a test on each app which has different states based on its controller.
  3. Create a listener on the server which waits for all 3 devices to send an initial signal.
  4. Have the server send a signal which indicates that a specific test should be active (the overall test state).
  5. Each app should be listening for a specific signal to start its tests.
  6. Send all errors and relevant logs to the server where all 3 test logs can be concatenated.
  7. Have the test send a signal to the server to indicate that the next test should begin.
  8. Repeat 4-7 for each app