From bb09866cba11119336a5415ad79569eb4e4277e3 Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Tue, 18 Dec 2018 15:54:39 -0800 Subject: [PATCH] Fix failing Switch E2E tests (#22698) Summary: Switch E2E tests have been failing on master, although they pass locally. Changelog: ---------- Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example. [General] [Fixed] - Fix failing Switch E2E tests Pull Request resolved: https://github.com/facebook/react-native/pull/22698 Differential Revision: D13511917 Pulled By: hramos fbshipit-source-id: b2f5cac1927531a855699e34e1a37036773f0aad --- RNTester/e2e/__tests__/Switch-test.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/RNTester/e2e/__tests__/Switch-test.js b/RNTester/e2e/__tests__/Switch-test.js index db38ae10e..c1d819d30 100644 --- a/RNTester/e2e/__tests__/Switch-test.js +++ b/RNTester/e2e/__tests__/Switch-test.js @@ -13,17 +13,13 @@ const jestExpect = require('expect'); describe('Switch', () => { - beforeAll(async () => { + beforeEach(async () => { await device.reloadReactNative(); await element(by.id('explorer_search')).replaceText(''); await element(by.label(' Native boolean input')).tap(); }); - afterAll(async () => { - await element(by.label('Back')).tap(); - }); - - it('Switch that starts on should switch', async () => { + it('Switch that starts off should switch', async () => { const testID = 'on-off-initial-off'; const indicatorID = 'on-off-initial-off-indicator'; @@ -34,7 +30,7 @@ describe('Switch', () => { await expect(element(by.id(indicatorID))).toHaveText('On'); }); - it('Switch that starts off should switch', async () => { + it('Switch that starts on should switch', async () => { const testID = 'on-off-initial-on'; const indicatorID = 'on-off-initial-on-indicator';