Skip to content
Snippets Groups Projects
Commit 50e70d15 authored by Narendra Singh Rathore's avatar Narendra Singh Rathore Committed by Chris Wells
Browse files

Issue #3476812 by narendrar, phenaproxima: Fix failing phpunit (next major):...

Issue #3476812 by narendrar, phenaproxima: Fix failing phpunit (next major): [FunctionalJavascript] on 2.0.x
parent fc7fc798
No related branches found
No related tags found
No related merge requests found
......@@ -120,12 +120,25 @@ trait ProjectBrowserUiTestTrait {
* When TRUE, do not wait for a rerender after entering a search string.
*/
protected function clickWithWait(string $css_selector, string $wait_for_text = '', bool $bypass_wait = FALSE) {
$do_click = function () use ($css_selector): void {
$element = $this->assertSession()->elementExists('css', $css_selector);
// In W3C mode, you cannot click an <option> element. We have to set the
// value of the containing <select> correctly.
if (strtolower($element->getTagName()) === 'option') {
$element->getParent()->setValue($element->getValue());
}
else {
$element->click();
}
};
if ($bypass_wait) {
$this->assertSession()->elementExists('css', $css_selector)->click();
$do_click();
}
else {
$this->preFilterWait();
$this->assertSession()->elementExists('css', $css_selector)->click();
$do_click();
$this->postFilterWait();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment