diff --git a/types/detox/detox-tests.ts b/types/detox/detox-tests.ts index 82e3a62d3a..6819f5e6ad 100644 --- a/types/detox/detox-tests.ts +++ b/types/detox/detox-tests.ts @@ -15,8 +15,13 @@ describe('Test', () => { test('Test', async () => { await element(by.id('element')).replaceText('text'); await element(by.id('element')).tap(); + await element(by.id('element')).scroll(50, 'down'); + await element(by.id('scrollView')).scrollTo('bottom'); await expect(element(by.id('element')).atIndex(0)).toNotExist(); + await element(by.id('scrollView')).swipe('down', 'fast'); + await element(by.type('UIPickerView')).setColumnToValue(1, "6"); await waitFor(element(by.id('element'))).toBeVisible().withTimeout(2000); + await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); }); }); diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts index f4479ff4db..52b96d57db 100644 --- a/types/detox/index.d.ts +++ b/types/detox/index.d.ts @@ -274,7 +274,7 @@ declare namespace Detox { * @param element * @example await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); */ - whileElement(by: Matchers): Element; + whileElement(by: Matchers): DetoxAny; } interface Actions { /** @@ -325,14 +325,14 @@ declare namespace Detox { * await element(by.id('scrollView')).scroll(100, 'down'); * await element(by.id('scrollView')).scroll(100, 'up'); */ - scroll(pixels: number, direction: Direction): Actions>; + scroll(pixels: number, direction: Direction): Promise>; /** * Scroll to edge. * @param edge * @example await element(by.id('scrollView')).scrollTo('bottom'); * await element(by.id('scrollView')).scrollTo('top'); */ - scrollTo(edge: Direction): Actions>; + scrollTo(edge: Direction): Promise>; /** * * @param direction @@ -342,7 +342,7 @@ declare namespace Detox { * await element(by.id('scrollView')).swipe('down', 'fast'); * await element(by.id('scrollView')).swipe('down', 'fast', 0.5); */ - swipe(direction: Direction, speed?: Speed, percentage?: number): Actions>; + swipe(direction: Direction, speed?: Speed, percentage?: number): Promise>; /** * (iOS Only) column - number of datepicker column (starts from 0) value - string value in setted column (must be correct) * @param column @@ -351,7 +351,7 @@ declare namespace Detox { * await element(by.type('UIPickerView')).setColumnToValue(1,"6"); * await element(by.type('UIPickerView')).setColumnToValue(2,"34"); */ - setColumnToValue(column: number, value: string): Actions>; + setColumnToValue(column: number, value: string): Promise>; } type Direction = "left" | "right" | "top" | "bottom" | "up" | "down";