Skip to content

Commit 89dfccb

Browse files
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.
1 parent 4f043fd commit 89dfccb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

example/e2e/detoxTest.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ describe('e2e tests', () => {
168168
await expect(elementById('overriddenTzName')).toHaveText('Europe/Prague');
169169

170170
let timeZone = 'America/Vancouver';
171+
await elementById('DateTimePickerScrollView').scrollTo('bottom');
171172
await waitFor(elementById('timezone')).toBeVisible().withTimeout(1000);
172173
await userSwipesTimezoneListUntilDesiredIsVisible(timeZone);
173174

@@ -192,6 +193,7 @@ describe('e2e tests', () => {
192193

193194
it('daylight saving should work properly', async () => {
194195
let timeZone = 'America/Vancouver';
196+
await elementById('DateTimePickerScrollView').scrollTo('bottom');
195197
await waitFor(elementById('timezone')).toBeVisible().withTimeout(1000);
196198
await userSwipesTimezoneListUntilDesiredIsVisible(timeZone);
197199

@@ -373,6 +375,7 @@ describe('e2e tests', () => {
373375
});
374376

375377
it(':android: when component unmounts, dialog is dismissed', async () => {
378+
await elementById('DateTimePickerScrollView').scrollTo('bottom');
376379
await elementById('showAndDismissPickerButton').tap();
377380
await waitFor(getDatePickerAndroid()).toExist().withTimeout(4000);
378381
await wait(6000);

example/e2e/utils/actions.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function userOpensPicker({
3535
await elementById('DateTimePickerScrollView').scrollTo('top');
3636

3737
await element(by.text(mode)).tap();
38-
await element(by.text(display)).tap();
38+
await element(by.text(display)).atIndex(0).tap();
3939
if (interval) {
4040
await element(by.text(String(interval))).tap();
4141
}
@@ -47,6 +47,7 @@ async function userOpensPicker({
4747
if (firstDayOfWeek) {
4848
await element(by.id(firstDayOfWeek)).tap();
4949
}
50+
await elementById('DateTimePickerScrollView').scrollTo('bottom');
5051
await element(by.id('showPickerButton')).tap();
5152
}
5253

0 commit comments

Comments
 (0)