Skip to content

Commit

Permalink
Look for the id, not the selector
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasnaphas committed Apr 25, 2024
1 parent 12aa157 commit cf58341
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions itest/Links.itest.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,8 @@ const waitOptions = { timeout /*, visible: true */ };
for (let p = 0; p < participants.length; p++) {
const participantName = participants[p].gameName;
const guestNameCellSelector = `#guest-name-cell-${participantName}`;
const guestAnswersSelector = `#guest-answers-${participantName}`;
const guestAnswersId = `guest-answers-${participantName}`;
const guestAnswersSelector = `#${guestAnswersId}`;
const guestAssignmentsSelector = `#guest-assignments-${participantName}`;

// How many were assigned?
Expand Down Expand Up @@ -996,13 +997,22 @@ const waitOptions = { timeout /*, visible: true */ };
// How many were answered?
// # assigned - # blanked out and not resubmitted - # never submitted
const expectedNumberAnswered = participants[p].answered;
await readRosterPage.waitForFunction(() => {
const guestAnswersElement = document.getElementById(guestAnswersSelector);
return (
guestAnswersElement &&
parseInt(guestAnswersElement.textContent) === expectedNumberAnswered
);
});
await readRosterPage
.waitForFunction(() => {
const guestAnswersElement = document.getElementById(guestAnswersId);
return (
guestAnswersElement &&
parseInt(guestAnswersElement.textContent) === expectedNumberAnswered
);
})
.catch(async (reason) => {
await failTest(
reason,
`read roster: did not find ${expectedNumberAnswered} answered, ` +
`guestAnswersId ${guestAnswersId}`,
browsers
);
});
console.log(
`read roster: found ` +
`${expectedNumberAnswered} / ${actualNumberAssigned} for ` +
Expand Down

0 comments on commit cf58341

Please sign in to comment.