简体   繁体   中英

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

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.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM