Skip to content

Commit

Permalink
AB#331 Fix "stale element reference" error in tests
Browse files Browse the repository at this point in the history
Now that the 'recents' buttons disappear after clicking them, make sure we get a fresh one each time before clicking.
  • Loading branch information
gjvoosten committed Feb 24, 2022
1 parent db22892 commit 0752960
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions client/tests/e2e/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ test.serial("Draft and submit a report", async t => {
shortWaitMs // wait for Slate to save the editor contents
)
const $addAuthGroupShortcutButtons = await $$(
"#meeting-details .shortcut-list button"
"#authorizationGroups-shortcut-list button"
)
// Add all recent authorization groups
await Promise.all(
$addAuthGroupShortcutButtons.map($button => $button.click())
)
const nrAuthGroups = $addAuthGroupShortcutButtons.length
for (let i = 0; i < nrAuthGroups; i++) {
await (await $("#authorizationGroups-shortcut-list button")).click()
}

const $formButtonSubmit = await $("#formBottomSubmit")
await t.context.driver.wait(
Expand Down Expand Up @@ -660,7 +661,10 @@ test.serial("Verify that validations work", async t => {
"#reportPeople-shortcut-list button"
)
// Add all recent attendees
await Promise.all($addAttendeeShortcutButtons.map($button => $button.click()))
const nrAttendees = $addAttendeeShortcutButtons.length
for (let i = 0; i < nrAttendees; i++) {
await (await $("#reportPeople-shortcut-list button")).click()
}

$advisorAttendeesRows = await $$(".advisorAttendeesTable tbody tr")
$principalAttendeesRows = await $$(".principalAttendeesTable tbody tr")
Expand Down

0 comments on commit 0752960

Please sign in to comment.