basic login on android

This commit is contained in:
GleidsonDaniel 2022-04-28 17:11:04 -03:00
parent 0c0d9b8946
commit 680796fef3
3 changed files with 6 additions and 9 deletions

View File

@ -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') {

View File

@ -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
};

View File

@ -1,4 +1,4 @@
const { launchApp, equal } = require('../helpers');
const { launchApp, equal, getText } = require('../helpers');
const { login, logout } = require('../helpers/login');
describe('Onboarding', () => {