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