Skip to content

Commit

Permalink
Update E2E specs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sidorchukandrew committed Dec 18, 2024
1 parent df73733 commit 2166b18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions example/e2e/detoxTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion example/e2e/utils/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}

Expand Down

0 comments on commit 2166b18

Please sign in to comment.