Skip to content

Commit ede063f

Browse files
martinflorian-darautenrieth-daOriolMunoz-dajulientinguely-da
committed
0.4.23: backport various frontend testing fixes (#3114)
Backports all of these to 0.4.23: - #2331 - #2936 - #2890 - #2822 Hope is that this reduces preflight flakiness. (Also backporting the whole chain made it easier to deal with conflicts.) Fixes DACH-NY/cn-test-failures#6376 Signed-off-by: Martin Florian <[email protected]> Co-authored-by: Robert Autenrieth <[email protected]> Co-authored-by: Oriol Muñoz <[email protected]> Co-authored-by: Julien Tinguely <[email protected]>
1 parent d40f04c commit ede063f

24 files changed

+181
-143
lines changed

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/AllocationsFrontendIntegrationTest.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ class AllocationsFrontendIntegrationTest
9292
.sendKeys(wantedAllocation.transferLegId)
9393
textField("create-allocation-settlement-ref-id").underlying
9494
.sendKeys(wantedAllocation.settlement.settlementRef.id)
95-
click on "create-allocation-transfer-leg-receiver"
95+
eventuallyClickOn(id("create-allocation-transfer-leg-receiver"))
9696
setAnsField(
9797
textField("create-allocation-transfer-leg-receiver"),
9898
receiver.toProtoPrimitive,
9999
receiver.toProtoPrimitive,
100100
)
101-
click on "create-allocation-settlement-executor"
101+
eventuallyClickOn(id("create-allocation-settlement-executor"))
102102
setAnsField(
103103
textField("create-allocation-settlement-executor"),
104104
validatorPartyId.toProtoPrimitive,
105105
validatorPartyId.toProtoPrimitive,
106106
)
107-
click on "create-allocation-amulet-amount"
107+
eventuallyClickOn(id("create-allocation-amulet-amount"))
108108
numberField("create-allocation-amulet-amount").value = ""
109109
numberField("create-allocation-amulet-amount").underlying.sendKeys(
110110
wantedAllocation.transferLeg.amount.toString
@@ -134,7 +134,7 @@ class AllocationsFrontendIntegrationTest
134134
setMeta(wantedAllocation.settlement.meta, "settlement")
135135
setMeta(wantedAllocation.transferLeg.meta, "transfer-leg")
136136

137-
click on "create-allocation-submit-button"
137+
eventuallyClickOn(id("create-allocation-submit-button"))
138138
},
139139
)(
140140
"the allocation is created",
@@ -162,7 +162,7 @@ class AllocationsFrontendIntegrationTest
162162
import scala.jdk.CollectionConverters.*
163163

164164
meta.values.asScala.zipWithIndex.foreach { case ((key, value), index) =>
165-
click on s"$idPrefix-add-meta"
165+
eventuallyClickOn(id(s"$idPrefix-add-meta"))
166166
textField(s"$idPrefix-meta-key-$index").underlying.sendKeys(key)
167167
textField(s"$idPrefix-meta-value-$index").underlying.sendKeys(value)
168168
}
@@ -230,7 +230,9 @@ class AllocationsFrontendIntegrationTest
230230
otcTrade.aliceRequest.transferLegs.asScala
231231
.find(_._2.sender == aliceParty.toProtoPrimitive)
232232
.valueOrFail("Couldn't find alice's transfer leg")
233-
click on s"transfer-leg-${otcTrade.trade.id.contractId}-$aliceTransferLegId-accept"
233+
eventuallyClickOn(
234+
id(s"transfer-leg-${otcTrade.trade.id.contractId}-$aliceTransferLegId-accept")
235+
)
234236
},
235237
)(
236238
"the allocation is shown",
@@ -295,7 +297,7 @@ class AllocationsFrontendIntegrationTest
295297
private def browseToAllocationsPage()(implicit driver: WebDriverType) = {
296298
actAndCheck(
297299
"go to allocations page", {
298-
click on "navlink-allocations"
300+
eventuallyClickOn(id("navlink-allocations"))
299301
},
300302
)(
301303
"allocations page is shown",

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/AnsFrontendIntegrationTest.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class AnsFrontendIntegrationTest
4343

4444
clue("requesting an existing name to check the already taken message") {
4545
waitForQuery(id("entry-name-field"))
46-
click on "entry-name-field"
46+
eventuallyClickOn(id("entry-name-field"))
4747
textField("entry-name-field").value = entryNameWithoutSufffix
4848

4949
waitForCondition(id("search-entry-button")) { ExpectedConditions.elementToBeClickable(_) }
50-
click on "search-entry-button"
50+
eventuallyClickOn(id("search-entry-button"))
5151
waitForQuery(id("unavailable-icon"))
5252
}
5353
}
@@ -93,11 +93,11 @@ class AnsFrontendIntegrationTest
9393

9494
clue("requesting an invalid name to check invalid name message") {
9595
waitForQuery(id("entry-name-field"))
96-
click on "entry-name-field"
96+
eventuallyClickOn(id("entry-name-field"))
9797
textField("entry-name-field").value = entryName;
9898

9999
waitForCondition(id("search-entry-button")) { ExpectedConditions.elementToBeClickable(_) }
100-
click on "search-entry-button"
100+
eventuallyClickOn(id("search-entry-button"))
101101

102102
waitForQuery(id("unavailable-icon"))
103103
find(id("entry-name-validation-message")).fold(fail("Unable to find validation message"))(
@@ -122,11 +122,11 @@ class AnsFrontendIntegrationTest
122122

123123
clue("requesting an name of length over limit to check invalid name message") {
124124
waitForQuery(id("entry-name-field"))
125-
click on "entry-name-field"
125+
eventuallyClickOn(id("entry-name-field"))
126126
textField("entry-name-field").value = entryNameJustOverLimit;
127127

128128
waitForCondition(id("search-entry-button")) { ExpectedConditions.elementToBeClickable(_) }
129-
click on "search-entry-button"
129+
eventuallyClickOn(id("search-entry-button"))
130130

131131
waitForQuery(id("unavailable-icon"))
132132
find(id("entry-name-validation-message")).fold(fail("Unable to find validation message"))(

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/DockerComposeFullNetworkFrontendIntegrationTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DockerComposeFullNetworkFrontendIntegrationTest
5050
)
5151
actAndCheck(
5252
"onboard alice",
53-
click on "onboard-button",
53+
eventuallyClickOn(id("onboard-button")),
5454
)(
5555
"Alice is logged in",
5656
_ => seleniumText(find(id("logged-in-user"))) should not be "",

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/DockerComposeValidatorFrontendIntegrationTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class DockerComposeValidatorFrontendIntegrationTest
111111
)
112112
actAndCheck(
113113
"onboard alice",
114-
click on "onboard-button",
114+
eventuallyClickOn(id("onboard-button")),
115115
)(
116116
"Alice is logged in",
117117
_ => seleniumText(find(id("logged-in-user"))) should not be "",
@@ -259,7 +259,7 @@ class DockerComposeValidatorFrontendIntegrationTest
259259

260260
actAndCheck(
261261
"onboard alice",
262-
click on "onboard-button",
262+
eventuallyClickOn(id("onboard-button")),
263263
)(
264264
"Alice is logged in and maintained her balance",
265265
_ => userLoggedInAndHasBalance("alice", aliceTap),

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/FrontendIntegrationTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ trait FrontendTestCommon extends TestCommon with WebBrowser with CustomMatchers
431431

432432
protected def consumeError(err: String)(implicit webDriver: WebDriver): Unit = {
433433
find(id("error")).value.text should include(err)
434-
click on "clear-error-button"
434+
eventuallyClickOn(id("clear-error-button"))
435435
eventually() {
436436
find(id("error")) shouldBe None
437437
}
@@ -576,7 +576,7 @@ trait FrontendTestCommon extends TestCommon with WebBrowser with CustomMatchers
576576
if (find(id("logout-button")).isDefined) {
577577
silentActAndCheck(
578578
"Auth0 login: Log out",
579-
click on id("logout-button"),
579+
eventuallyClickOn(id("logout-button")),
580580
)(
581581
"Auth0 login: Login button is visible",
582582
_ => find(id("oidc-login-button")) should not be empty,
@@ -626,7 +626,7 @@ trait FrontendTestCommon extends TestCommon with WebBrowser with CustomMatchers
626626
) = {
627627
silentActAndCheck(
628628
"Auth0 login: Click the login button",
629-
click on "oidc-login-button",
629+
eventuallyClickOn(id("oidc-login-button")),
630630
)(
631631
"Auth0 login: Login form is visible",
632632
_ => assertAuth0LoginFormVisible(),

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/ScanFrontendTimeBasedIntegrationTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class ScanFrontendTimeBasedIntegrationTest
168168
actAndCheck(
169169
"Go to Scan homepage and switch to the Network Info Tab", {
170170
go to s"http://localhost:${scanUIPort}"
171-
click on "navlink-/dso"
171+
eventuallyClickOn(id("navlink-/dso"))
172172
},
173173
)(
174174
"The tabs 'DSO Info' and 'Amulet Info' are visible",
@@ -180,7 +180,7 @@ class ScanFrontendTimeBasedIntegrationTest
180180

181181
actAndCheck(
182182
"Click on DSO Info", {
183-
click on "information-tab-dso-info"
183+
eventuallyClickOn(id("information-tab-dso-info"))
184184
},
185185
)(
186186
"The DSO info is visible",
@@ -208,7 +208,7 @@ class ScanFrontendTimeBasedIntegrationTest
208208

209209
actAndCheck(
210210
"Click on Amulet Info", {
211-
click on "information-tab-amulet-info"
211+
eventuallyClickOn(id("information-tab-amulet-info"))
212212
},
213213
)(
214214
"The Amulet info is visible",
@@ -586,7 +586,7 @@ class ScanFrontendTimeBasedIntegrationTest
586586
_ => {
587587
closeVoteModalsIfOpen
588588

589-
click on "tab-panel-executed"
589+
eventuallyClickOn(id("tab-panel-executed"))
590590
val rows = getAllVoteRows("sv-vote-results-executed-table-body")
591591

592592
forExactly(1, rows) { reviewButton =>

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SplitwellUpgradeFrontendIntegrationTest.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class SplitwellUpgradeFrontendIntegrationTest
132132

133133
actAndCheck(
134134
"Alice accepts bob's request",
135-
click on className("add-user-link") withClue "alice accepts bob's request",
135+
eventuallyClickOn(className("add-user-link")) withClue "alice accepts bob's request",
136136
)(
137137
"Group contract id changes",
138138
_ => {
@@ -156,8 +156,10 @@ class SplitwellUpgradeFrontendIntegrationTest
156156
// the workflow
157157
actAndCheck(
158158
"bob creates AppPaymentRequest and DeliveryOffer",
159-
click on cssSelector(
160-
s""".group-entry[data-group-id="$abGroupName"] ~ * .settle-my-debts-link"""
159+
eventuallyClickOn(
160+
cssSelector(
161+
s""".group-entry[data-group-id="$abGroupName"] ~ * .settle-my-debts-link"""
162+
)
161163
),
162164
)(
163165
"Bob was redirected to wallet",
@@ -298,7 +300,7 @@ class SplitwellUpgradeFrontendIntegrationTest
298300
field.underlying.click()
299301
reactTextInput(field).value = description
300302
}
301-
click on cssSelector(s"$groupEntry .enter-payment-link")
303+
eventuallyClickOn(cssSelector(s"$groupEntry .enter-payment-link"))
302304
}
303305
}
304306

0 commit comments

Comments
 (0)