Skip to content

Instantly share code, notes, and snippets.

@llaine
Last active August 3, 2017 10:12
Show Gist options
  • Save llaine/1ef56452069293f871eb58d2d7f5f453 to your computer and use it in GitHub Desktop.
Save llaine/1ef56452069293f871eb58d2d7f5f453 to your computer and use it in GitHub Desktop.
How to do end-to-end testing with React-Native. Spec
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