Files
trezor-suite/suite-native/app/e2e/pageObjects/deviceManagerActions.ts
Martin Vere Cihlar aa866c7ae5 refactor(e2e-native): refactor and unite all waitFor methods to one
several minor fixes where asserts or waitFor did not do anything
other minor refactorings
2025-11-11 05:41:34 -04:00

40 lines
1.2 KiB
TypeScript

import { waitForVisible } from '../support/utils';
class DeviceManagerActions {
async tapDeviceSwitch() {
const deviceSwitch = element(by.id('@device-manager/device-switch'));
await waitForVisible(deviceSwitch);
await waitFor(element(by.id('@screen/ConnectingDevice')))
.not.toBeVisible()
.withTimeout(30_000);
await deviceSwitch.tap();
}
async tapDeviceSettingsButton() {
const deviceSettingsButton = element(by.id('@device-manager/device-settings-button'));
await waitForVisible(deviceSettingsButton);
await deviceSettingsButton.tap();
}
async tapOpenPassphraseButton() {
const openPassphraseButton = element(by.id('@device-manager/passphrase/add'));
await waitForVisible(openPassphraseButton);
await openPassphraseButton.tap();
}
async assertDeviceSwitcherState({
title,
}: {
title: 'Connected' | 'Disconnected' | 'Hi there!';
}) {
await waitForVisible(
element(by.id('@device-manager/device-switch').withDescendant(by.text(title))),
);
}
}
export const onDeviceManager = new DeviceManagerActions();