fix tests
This commit is contained in:
parent
05f6a1e9f4
commit
74a4480418
|
@ -237,7 +237,7 @@ class Sidebar extends Component<ISidebarProps, ISidebarState> {
|
||||||
theme={theme!}
|
theme={theme!}
|
||||||
right={<CustomIcon name='edit' size={20} color={themes[theme!].titleText} />}
|
right={<CustomIcon name='edit' size={20} color={themes[theme!].titleText} />}
|
||||||
onPress={() => this.sidebarNavigate('StatusView')}
|
onPress={() => this.sidebarNavigate('StatusView')}
|
||||||
testID='sidebar-custom-status'
|
test='sidebar-custom-status'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// @ts-ignore
|
||||||
import { RectReturn } from '@wdio/protocols/build/types';
|
import { RectReturn } from '@wdio/protocols/build/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,6 +38,7 @@ const SWIPE_DIRECTION = {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function swipe(from: XY, to: XY) {
|
async function swipe(from: XY, to: XY) {
|
||||||
|
// @ts-ignore
|
||||||
await driver.performActions([
|
await driver.performActions([
|
||||||
{
|
{
|
||||||
// a. Create the event
|
// a. Create the event
|
||||||
|
@ -61,6 +63,7 @@ async function swipe(from: XY, to: XY) {
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
// Add a pause, just to make sure the swipe is done
|
// Add a pause, just to make sure the swipe is done
|
||||||
|
// @ts-ignore
|
||||||
await driver.pause(1000);
|
await driver.pause(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +84,7 @@ function getDeviceScreenCoordinates(screenSize: RectReturn, coordinates: XY): XY
|
||||||
async function swipeOnPercentage(from: XY, to: XY) {
|
async function swipeOnPercentage(from: XY, to: XY) {
|
||||||
// Get the screen size and store it so it can be re-used.
|
// Get the screen size and store it so it can be re-used.
|
||||||
// This will save a lot of webdriver calls if this methods is used multiple times.
|
// This will save a lot of webdriver calls if this methods is used multiple times.
|
||||||
|
// @ts-ignore
|
||||||
SCREEN_SIZE = SCREEN_SIZE || (await driver.getWindowRect());
|
SCREEN_SIZE = SCREEN_SIZE || (await driver.getWindowRect());
|
||||||
// Get the start position on the screen for the swipe
|
// Get the start position on the screen for the swipe
|
||||||
const pressOptions = getDeviceScreenCoordinates(SCREEN_SIZE, from);
|
const pressOptions = getDeviceScreenCoordinates(SCREEN_SIZE, from);
|
||||||
|
|
Loading…
Reference in New Issue