Skip to content
Snippets Groups Projects
Verified Commit 3582e487 authored by Kent Richards's avatar Kent Richards :speech_balloon:
Browse files

Issue #3085781: Streamline waitAndAssertAriaPressedState()

parent be23acdf
No related branches found
No related tags found
1 merge request!11337Resolve #3085781 "Aria pressed attribute isn't updated correctly"
......@@ -117,15 +117,12 @@ private function waitAndAssertAriaPressedState(NodeElement $element, bool $expec
->getSession()
->getPage()
->waitFor(1, function () use ($element, $expected): bool {
$actual = $element->getAttribute('aria-pressed');
// Get boolean representation of `aria-pressed`.
// TRUE if `aria-pressed="true"`, FALSE otherwise.
$actual = $element->getAttribute('aria-pressed') == 'true';
// Check for $expected == TRUE.
if ($expected) {
return $actual == 'true';
}
// Check for $expected == FALSE.
return $actual == 'false';
// Exit `waitFor()` when $actual == $expected.
return $actual == $expected;
})
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment