Skip to content

Commit e6a385b

Browse files
authored
Merge pull request #4370 from anoma/tomas/fix-e2e-with-hw-wallet
test/e2e: fix the test with HW wallet automation
2 parents 63665af + a9bb35e commit e6a385b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

crates/tests/src/hw_wallet_automation.rs

+27
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
6868
action: Some(PressAndRelease(Button::Right)),
6969
},
7070
],
71+
fee_steps(),
7172
vec![Step::Expect {
7273
text: Text("APPROVE"),
7374
action: Some(PressAndRelease(Button::Both)),
@@ -110,6 +111,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
110111
action: Some(PressAndRelease(Button::Right)),
111112
},
112113
],
114+
fee_steps(),
113115
vec![Step::Expect {
114116
text: Text("APPROVE"),
115117
action: Some(PressAndRelease(Button::Both)),
@@ -147,6 +149,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
147149
action: Some(PressAndRelease(Button::Right)),
148150
},
149151
],
152+
fee_steps(),
150153
vec![Step::Expect {
151154
text: Text("APPROVE"),
152155
action: Some(PressAndRelease(Button::Both)),
@@ -184,6 +187,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
184187
action: Some(PressAndRelease(Button::Right)),
185188
},
186189
],
190+
fee_steps(),
187191
vec![Step::Expect {
188192
text: Text("APPROVE"),
189193
action: Some(PressAndRelease(Button::Both)),
@@ -211,6 +215,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
211215
action: None,
212216
}],
213217
address_steps(),
218+
fee_steps(),
214219
vec![Step::Expect {
215220
text: Text("APPROVE"),
216221
action: Some(PressAndRelease(Button::Both)),
@@ -238,6 +243,7 @@ pub fn gen_automation_e2e_pos_bonds() -> Automation {
238243
action: None,
239244
}],
240245
address_steps(),
246+
fee_steps(),
241247
vec![Step::Expect {
242248
text: Text("APPROVE"),
243249
action: Some(PressAndRelease(Button::Both)),
@@ -311,6 +317,27 @@ fn address_steps() -> Steps {
311317
]
312318
}
313319

320+
fn fee_steps() -> Steps {
321+
[
322+
vec![Step::Expect {
323+
text: Text("Fee token"),
324+
action: None,
325+
}],
326+
address_steps(),
327+
vec![
328+
Step::Expect {
329+
text: Text("Fee"),
330+
action: None,
331+
},
332+
Step::Expect {
333+
text: Regex(r"\d+\.\d+"),
334+
action: Some(PressAndRelease(Button::Right)),
335+
},
336+
],
337+
]
338+
.concat()
339+
}
340+
314341
fn gen_automation(steps: Steps) -> Automation {
315342
let mut automation = Automation {
316343
version: 1,

0 commit comments

Comments
 (0)