Skip to content

Commit

Permalink
Parse number assigned and answered to an int
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasnaphas committed Mar 24, 2024
1 parent b8b1ea6 commit b981f8b
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions itest/Links.itest.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,17 @@ const waitOptions = { timeout: timeoutMs /*, visible: true*/ };

// How many were assigned?
const expectedNumberAssigned = participants[p].assignments.length;
const actualNumberAssigned = await readRosterPage
.$eval(guestAssignmentsSelector, (el) => el.textContent)
.catch(async (reason) => {
await failTest(
reason,
`Unable to get number assigned, ${guestAssignmentsSelector}`,
browsers
);
});
const actualNumberAssigned = parseInt(
await readRosterPage
.$eval(guestAssignmentsSelector, (el) => el.textContent)
.catch(async (reason) => {
await failTest(
reason,
`Unable to get number assigned, ${guestAssignmentsSelector}`,
browsers
);
})
);
if (expectedNumberAssigned !== actualNumberAssigned) {
await failTest(
"wrong number assigned on read roster",
Expand All @@ -693,15 +695,17 @@ const waitOptions = { timeout: timeoutMs /*, visible: true*/ };
// How many were answered?
// # assigned - # blanked out and not resubmitted - # never submitted
const expectedNumberAnswered = participants[p].answered;
const actualNumberAnswered = await readRosterPage
.$eval(guestAnswersSelector, (el) => el.textContent)
.catch(async (reason) => {
await failTest(
reason,
`Unable to get number answered, ${guestAnswersSelector}`,
browsers
);
});
const actualNumberAnswered = parseInt(
await readRosterPage
.$eval(guestAnswersSelector, (el) => el.textContent)
.catch(async (reason) => {
await failTest(
reason,
`Unable to get number answered, ${guestAnswersSelector}`,
browsers
);
})
);
if (expectedNumberAnswered !== actualNumberAnswered) {
await failTest(
"wrong number answered on read roster",
Expand Down

0 comments on commit b981f8b

Please sign in to comment.