diff --git a/appium/tests/helpers/index.js b/appium/tests/helpers/index.js index 582c599fe..fafa9cc8b 100644 --- a/appium/tests/helpers/index.js +++ b/appium/tests/helpers/index.js @@ -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(); diff --git a/appium/tests/helpers/login.js b/appium/tests/helpers/login.js index 2b56db436..d82578632 100644 --- a/appium/tests/helpers/login.js +++ b/appium/tests/helpers/login.js @@ -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(); };