add some helpers
This commit is contained in:
parent
680796fef3
commit
27c0ac5eca
|
@ -12,6 +12,11 @@ export const click = async tag => await $(`~${tag}`).click();
|
||||||
|
|
||||||
export const clickById = async tag => await $(`id=${tag}`).click();
|
export const clickById = async tag => await $(`id=${tag}`).click();
|
||||||
|
|
||||||
|
export const openDrawer = async () =>
|
||||||
|
await $('//android.view.ViewGroup[@content-desc="rooms-list-view-sidebar"]/android.widget.TextView').click(); //TEMP
|
||||||
|
|
||||||
|
export const clickAlert = async tag => await clickById('android:id/button1');
|
||||||
|
|
||||||
export const setValueAndEnter = async (tag, value) => {
|
export const setValueAndEnter = async (tag, value) => {
|
||||||
if (driver.capabilities.platformName === 'Android') {
|
if (driver.capabilities.platformName === 'Android') {
|
||||||
await $(`~${tag}`).click();
|
await $(`~${tag}`).click();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { click, clickById, scrollToBottom, setValue, setValueAndEnter } from '.';
|
import { click, clickAlert, openDrawer, setValue, setValueAndEnter } from '.';
|
||||||
import { swipeDown } from './gestures';
|
import { swipeDown } from './gestures';
|
||||||
// import data from '../../../e2e/data';
|
// import data from '../../../e2e/data';
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export const login = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const logout = async () => {
|
export const logout = async () => {
|
||||||
await $('//android.view.ViewGroup[@content-desc="rooms-list-view-sidebar"]/android.widget.TextView').click(); //TEMP
|
await openDrawer();
|
||||||
await click('sidebar-settings');
|
await click('sidebar-settings');
|
||||||
await swipeDown(20);
|
await swipeDown(20);
|
||||||
await click('settings-logout');
|
await click('settings-logout');
|
||||||
await clickById('android:id/button1'); // alert
|
await clickAlert();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue