mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-09 08:48:15 +01:00
several minor fixes where asserts or waitFor did not do anything other minor refactorings
40 lines
1.2 KiB
TypeScript
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();
|