Обновите местоположение устройства Android через детокс - PullRequest
0 голосов
/ 14 января 2020

Можно ли установить местоположение устройства с помощью конфигурации детоксикации при выполнении тестов пользовательского интерфейса в нашем приложении? Нам удалось сделать это для iOS с помощью этой команды -

 await device.setLocation(51.38488, -2.36197);

Это выполняется в тесте beforeEach, наш полный тест выглядит следующим образом

import {
LoginScreen,
MyProfileScreen,
EmailAddresses,
Passwords
 } from "../elements/sop";
import { clickLogOutAlertWindow } from "../functions/alertBoxes";
import { navigateToMyProfile } from "../functions/navigate";
import { signIn } from "../functions/common";

describe("Logout", () => {
beforeEach(async () => {
await device.launchApp({
  permissions: {
    location: "always",
    notifications: "YES"
  }
});
await device.setLocation(51.38488, -2.36197);
});

it("i should be able to logout", async () => {
await signIn(EmailAddresses.jamesEmail, Passwords.jamesPassword);
await navigateToMyProfile();
await element(by.id(MyProfileScreen.logoutButton)).tap();

await clickLogOutAlertWindow();

await expect(element(by.id(LoginScreen.emailField))).toBeVisible();
await expect(element(by.id(LoginScreen.passwordField))).toBeNull;
 });
});
...