Last active
August 3, 2017 10:12
-
-
Save llaine/1ef56452069293f871eb58d2d7f5f453 to your computer and use it in GitHub Desktop.
How to do end-to-end testing with React-Native. Spec
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
const { components, typeText, multiTap, reloadApp, asserElementIsVisible, assertElementIsNotVisible, textIsVisible } = require('./helpers'); | |
describe('Employee List', () => { | |
beforeEach(async () => { | |
await reloadApp(); | |
}); | |
it('should be able to search for a specific employee and see his profile', async () => { | |
const ceoName = 'Amy'; | |
const employeeItemId = `${components.employee_list_item}AnupGupta` | |
const ceoItemId = `${components.employee_list_item}AmyTaylor` | |
const ceoTitle = 'CEO'; | |
// We search for the CEO and click on it | |
await typeText(components.search_bar, ceoName); | |
await assertElementIsNotVisible(employeeItemId) | |
await asserElementIsVisible(ceoItemId) | |
await multiTap(ceoTitle, 'text'); | |
await asserElementIsVisible(components.employee_show_view) | |
await asserElementIsVisible(components.action_bar_email_button) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment