From 50a5830b691468702daab754a5e06ffb1435f90a Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Tue, 18 Dec 2018 17:03:24 -0600 Subject: [PATCH 1/2] Fix reversed test names --- RNTester/e2e/__tests__/Switch-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RNTester/e2e/__tests__/Switch-test.js b/RNTester/e2e/__tests__/Switch-test.js index db38ae10eaf9..2f051ccac907 100644 --- a/RNTester/e2e/__tests__/Switch-test.js +++ b/RNTester/e2e/__tests__/Switch-test.js @@ -23,7 +23,7 @@ describe('Switch', () => { 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 +34,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'; From b21b533be3e324eb8097026122171afb8c46659f Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Tue, 18 Dec 2018 17:03:39 -0600 Subject: [PATCH 2/2] Make each Switch test case independent This is an attempt to prevent random failures of Switch tests --- RNTester/e2e/__tests__/Switch-test.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/RNTester/e2e/__tests__/Switch-test.js b/RNTester/e2e/__tests__/Switch-test.js index 2f051ccac907..c1d819d3023b 100644 --- a/RNTester/e2e/__tests__/Switch-test.js +++ b/RNTester/e2e/__tests__/Switch-test.js @@ -13,16 +13,12 @@ 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 off should switch', async () => { const testID = 'on-off-initial-off'; const indicatorID = 'on-off-initial-off-indicator';