add some helpers

This commit is contained in:
GleidsonDaniel 2022-04-28 17:14:46 -03:00
parent 680796fef3
commit 27c0ac5eca
2 changed files with 8 additions and 3 deletions

View File

@ -12,6 +12,11 @@ export const click = async tag => await $(`~${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) => {
if (driver.capabilities.platformName === 'Android') {
await $(`~${tag}`).click();

View File

@ -1,4 +1,4 @@
import { click, clickById, scrollToBottom, setValue, setValueAndEnter } from '.';
import { click, clickAlert, openDrawer, setValue, setValueAndEnter } from '.';
import { swipeDown } from './gestures';
// import data from '../../../e2e/data';
@ -10,9 +10,9 @@ export const login = 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 swipeDown(20);
await click('settings-logout');
await clickById('android:id/button1'); // alert
await clickAlert();
};