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

PHPUnit Exception: InvalidCookieDomain, invalid cookie domain #70

Open
gitressa opened this issue Jul 15, 2022 · 4 comments
Open

PHPUnit Exception: InvalidCookieDomain, invalid cookie domain #70

gitressa opened this issue Jul 15, 2022 · 4 comments

Comments

@gitressa
Copy link
Contributor

gitressa commented Jul 15, 2022

To recreate spin up a Drupal 10 instance, download the project_browser module and run the test:

$ cd web
$ composer require drupal/project_browser:1.0.x-dev@dev
$ lando phpunit --group project_browser
PHPUnit 9.5.20 #StandWithUkraine

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing 
.EEEEEEEEEEEEEEEE                                                 17 / 17 (100%)

Time: 03:40.217, Memory: 341.00 MB

There were 16 errors:

1) Drupal\Tests\project_browser\FunctionalJavascript\ProjectBrowserPluginTest::testRandomDataPlugin
WebDriver\Exception\InvalidCookieDomain: invalid cookie domain
  (Session info: headless chrome=98.0.4758.102)
  (Driver info: chromedriver=98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}),platform=Linux 5.15.0-41-generic x86_64)

/app/web/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:156
/app/web/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:172
/app/web/vendor/instaclick/php-webdriver/lib/WebDriver/Session.php:187
/app/web/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php:44
/app/web/vendor/behat/mink/src/Session.php:214
/app/web/core/tests/Drupal/Tests/UiHelperTrait.php:344
/app/web/core/tests/Drupal/Tests/UiHelperTrait.php:232
/app/web/core/tests/Drupal/Tests/UiHelperTrait.php:156
/app/web/modules/contrib/project_browser/tests/src/FunctionalJavascript/ProjectBrowserPluginTest.php:33
/app/web/vendor/phpunit/phpunit/src/Framework/TestResult.php:726
[...]
@naveenvalecha
Copy link

naveenvalecha commented Oct 8, 2022

Encountered with same issue today. Is there any workaround for it?
I tried with drupal core 9.4.x and 9.5.x
This looks related #63

@gitressa
Copy link
Contributor Author

gitressa commented Nov 6, 2022

Note that whitelisted-ips should also be updated allowed-ips, thought it doesn't seem to help here ...

changed whitelisted-ips to allowed-ips as chromedriver renamed in in 92/93 releases

From Running PHPUnit Javascript tests

@gitressa
Copy link
Contributor Author

gitressa commented Nov 6, 2022

@naveenvalecha It looks like updating to @neclimdul's config from lando/lando#3411 is the solution. Feel free to try the MR #76 (for Drupal 10) if it also works for Drupal 9.

@gitressa
Copy link
Contributor Author

gitressa commented Nov 6, 2022

My example in the original Issue summary, which now completes without errors:

$ lando phpunit --group project_browser
PHPUnit 9.5.26 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing 
.SSSSSSSSSSSSSSSS                                                 17 / 17 (100%)

Time: 03:28.791, Memory: 337.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 17, Assertions: 22, Skipped: 16.

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

No branches or pull requests

2 participants