Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Fail on Drupal 10 - element not interactable #284

Closed
andybroomfield opened this issue Sep 6, 2023 · 3 comments · Fixed by #285
Closed

Test Fail on Drupal 10 - element not interactable #284

andybroomfield opened this issue Sep 6, 2023 · 3 comments · Fixed by #285

Comments

@andybroomfield
Copy link
Contributor

Drupal\Tests\localgov_alert_banner\FunctionalJavascript\AlertBannerHideTest::testAlertBannerHide
WebDriver\Exception\ElementNotVisible: element not interactable
  (Session info: chrome=106.0.5249.119)
  (Driver info: chromedriver=106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249@{#569}),platform=Linux 5.15.0-1041-azure x86_64)

/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:198
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:167
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:234
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:241
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:805
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:791
/var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php:120
/var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php:200
/var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php:131
/var/www/html/vendor/behat/mink/src/Element/NodeElement.php:153
/var/www/html/web/modules/contrib/localgov_alert_banner/tests/src/FunctionalJavascript/AlertBannerHideTest.php:50
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

This will be the hide button

    // Find and click hide link.
    $page = $this->getSession()->getPage();
    $button = $page->findButton('Hide');
    $this->assertNotEmpty($button);
    $button->click();

Not sure what the issue in Drupal 10 that causes the fail though, maybe Chrome driver update?

@andybroomfield
Copy link
Contributor Author

On tech drop in we discovered the test profile that is used and possibly other web driver test profiles are not able to view the alert banner block on the user login page.

@andybroomfield
Copy link
Contributor Author

From testing in the testing profile.

alert_banner.js?v=10.1.3:40 Uncaught ReferenceError: Drupal is not defined
    at alert_banner.js?v=10.1.3:40:13

andybroomfield added a commit that referenced this issue Sep 8, 2023
Fix #284 

In Drupal 10 it was discovered that the core/drupal and drupalSettings arn't sent by default. They should be explicitlly declared as dependencies, however we don't actully use these so we can saftley remove them for now.
@andybroomfield
Copy link
Contributor Author

After doing a manual inspection with the testing profile, discovered this was due to the use of Drupal and drupalSettings in the javascript which arn't declared as dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant