Files
trezor-suite/suite-native/app/e2e/pageObjects/send/sendOutputsFormActions.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

35 lines
1.1 KiB
TypeScript

import { expect as detoxExpect } from 'detox';
import { waitForVisible } from '../../support/utils';
class SendOutputsFormActions {
async waitForScreen() {
await waitForVisible(by.id('@screen/SendOutputs'));
}
async fillForm(values: { address?: string; amount?: string }[]) {
await detoxExpect(element(by.id(`@screen/SendOutputs`))).toBeVisible();
for (const [index, value] of values.entries()) {
const { address, amount } = value;
if (address) {
await element(by.id(`outputs.${index}.address`)).typeText(address);
}
if (amount) {
await element(by.id(`outputs.${index}.amount`)).typeText(amount);
}
}
}
async clearForm() {
await element(by.id(/^outputs\.\d+\.address$/)).clearText();
await element(by.id(/^outputs\.\d+\.amount$/)).clearText();
}
async submitForm() {
await element(by.id('@send/form-submit-button')).tap();
}
}
export const onSendOutputsForm = new SendOutputsFormActions();