Skip to content

Instantly share code, notes, and snippets.

@rotemmiz
Created February 22, 2018 00:01
Show Gist options
  • Save rotemmiz/f61665a8714dedd61fa2f8b2511ebb18 to your computer and use it in GitHub Desktop.
Save rotemmiz/f61665a8714dedd61fa2f8b2511ebb18 to your computer and use it in GitHub Desktop.
Detox: A Year in. Building It, Testing With It
describe('Login', () => {
const server = new MockServer();
beforeEach(async () => {
await server.start();
});
afterEach(async () => {
await server.stop();
});
it('should login and persist login after restart', async () => {
server.forUser(server.testUserId()).withBusinesses(1);
await device.launchApp({delete: true, permissions: {notifications: 'YES'}});
await element(by.text('Log In TestUser1')).tap();
await expect(element(by.text('feed.FeedScreen'))).toBeVisible();
await device.launchApp({newInstance: true});
await expect(element(by.text('feed.FeedScreen'))).toBeVisible();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment