From 2166b18aae83aa5e6be1d56b3cd1b2e3539cab86 Mon Sep 17 00:00:00 2001 From: sidorchukandrew <36050911+sidorchukandrew@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:25:43 -0500 Subject: [PATCH] Update E2E specs Since there are multiple "default" options on the screen now, I've specified to tap the first one. I also had to make sure to scroll the screen before tapping the show picker button. --- example/e2e/detoxTest.spec.js | 3 +++ example/e2e/utils/actions.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/example/e2e/detoxTest.spec.js b/example/e2e/detoxTest.spec.js index 3ea6dbf2..8961720a 100644 --- a/example/e2e/detoxTest.spec.js +++ b/example/e2e/detoxTest.spec.js @@ -168,6 +168,7 @@ describe('e2e tests', () => { await expect(elementById('overriddenTzName')).toHaveText('Europe/Prague'); let timeZone = 'America/Vancouver'; + await elementById('DateTimePickerScrollView').scrollTo('bottom'); await waitFor(elementById('timezone')).toBeVisible().withTimeout(1000); await userSwipesTimezoneListUntilDesiredIsVisible(timeZone); @@ -192,6 +193,7 @@ describe('e2e tests', () => { it('daylight saving should work properly', async () => { let timeZone = 'America/Vancouver'; + await elementById('DateTimePickerScrollView').scrollTo('bottom'); await waitFor(elementById('timezone')).toBeVisible().withTimeout(1000); await userSwipesTimezoneListUntilDesiredIsVisible(timeZone); @@ -373,6 +375,7 @@ describe('e2e tests', () => { }); it(':android: when component unmounts, dialog is dismissed', async () => { + await elementById('DateTimePickerScrollView').scrollTo('bottom'); await elementById('showAndDismissPickerButton').tap(); await waitFor(getDatePickerAndroid()).toExist().withTimeout(4000); await wait(6000); diff --git a/example/e2e/utils/actions.js b/example/e2e/utils/actions.js index 4a70cbdd..6e18b360 100644 --- a/example/e2e/utils/actions.js +++ b/example/e2e/utils/actions.js @@ -35,7 +35,7 @@ async function userOpensPicker({ await elementById('DateTimePickerScrollView').scrollTo('top'); await element(by.text(mode)).tap(); - await element(by.text(display)).tap(); + await element(by.text(display)).atIndex(0).tap(); if (interval) { await element(by.text(String(interval))).tap(); } @@ -47,6 +47,7 @@ async function userOpensPicker({ if (firstDayOfWeek) { await element(by.id(firstDayOfWeek)).tap(); } + await elementById('DateTimePickerScrollView').scrollTo('bottom'); await element(by.id('showPickerButton')).tap(); }