-
-
Save ddikodroid/ced5f1f447569863ced0805864a48234 to your computer and use it in GitHub Desktop.
example detox e2e tests for search flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { device, element, by, expect } from 'detox'; | |
describe('Search', () => { | |
beforeEach(async () => { | |
await device.reloadReactNative(); | |
}); | |
it('should show a list of results and go to film details', async () => { | |
await waitFor(element(by.id('search-page'))) | |
.toBeVisible() | |
.withTimeout(5000); | |
await expect(element(by.id('search-input'))).toBeVisible(); | |
await element(by.id('search-input')).clearText(); | |
await element(by.id('search-input')).typeText('totoro'); | |
await element(by.id('search-button')).tap(); | |
await waitFor(element(by.id('results-page'))) | |
.toBeVisible() | |
.withTimeout(5000); | |
await element(by.id('result-list-item')).atIndex(0).tap(); | |
await waitFor(element(by.id('film-page'))) | |
.toBeVisible() | |
.withTimeout(5000); | |
await expect(element(by.id('title'))).toBeVisible(); | |
await expect(element(by.id('title'))).toHaveText( | |
'My Neighbor Totoro' | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment