Flutter integration test, how to ensure user is signed out? (flushed state)

Viewed 35

I'm writing my first Flutter integrations tests, and noticed that when the app starts up, the user is already signed in and lands on the page after sign in. I don't know why this happens, maybe because the app has been running previously on the same device in development mode with a signed in user?

Is there a way to start the tests with no previous state, no sessions, etc? I can't find anything in the documentation for this.

1 Answers

Use setUp and tearDown to set/clear state before/after each test.

setUp(() async {
  // TODO
});

tearDown(() async {
  // TODO
});
Related