From 680796fef31830b5eb3bfe14fb5dd55ea429cc49 Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Thu, 28 Apr 2022 17:11:04 -0300 Subject: [PATCH] basic login on android --- appium/tests/helpers/index.js | 4 +--- appium/tests/helpers/login.js | 9 ++++----- appium/tests/specs/011-onboarding.e2e.js | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/appium/tests/helpers/index.js b/appium/tests/helpers/index.js index 5e2332603..582c599fe 100644 --- a/appium/tests/helpers/index.js +++ b/appium/tests/helpers/index.js @@ -10,9 +10,7 @@ export const equal = async (value, text) => expect(value).to.equal(prop); export const click = async tag => await $(`~${tag}`).click(); -export const clickById = async tag => await $(`#${tag}`).click(); - -export const scrollToBottom = async () => await driver.execute('mobile: scroll', { direction: 'down' }); +export const clickById = async tag => await $(`id=${tag}`).click(); export const setValueAndEnter = async (tag, value) => { if (driver.capabilities.platformName === 'Android') { diff --git a/appium/tests/helpers/login.js b/appium/tests/helpers/login.js index ba776298c..2b56db436 100644 --- a/appium/tests/helpers/login.js +++ b/appium/tests/helpers/login.js @@ -1,5 +1,6 @@ import { click, clickById, scrollToBottom, setValue, setValueAndEnter } from '.'; -import data from '../../../e2e/data'; +import { swipeDown } from './gestures'; +// import data from '../../../e2e/data'; export const login = async () => { await setValueAndEnter('new-server-view-input', 'mobile'); @@ -11,9 +12,7 @@ export const login = async () => { export const logout = async () => { await $('//android.view.ViewGroup[@content-desc="rooms-list-view-sidebar"]/android.widget.TextView').click(); //TEMP await click('sidebar-settings'); - await click('sidebar-settings'); - // await scrollToBottom(); + await swipeDown(20); await click('settings-logout'); - await click('settings-logout'); - await clickById('android:id/button1'); + await clickById('android:id/button1'); // alert }; diff --git a/appium/tests/specs/011-onboarding.e2e.js b/appium/tests/specs/011-onboarding.e2e.js index 86beb32cb..354faba7f 100644 --- a/appium/tests/specs/011-onboarding.e2e.js +++ b/appium/tests/specs/011-onboarding.e2e.js @@ -1,4 +1,4 @@ -const { launchApp, equal } = require('../helpers'); +const { launchApp, equal, getText } = require('../helpers'); const { login, logout } = require('../helpers/login'); describe('Onboarding', () => {