Fatal error when running tests

Created on 9 October 2023, 12 months ago
Updated 8 March 2024, 7 months ago

When running the tests on my local environment I am getting the following:

Testing /var/www/html/web/modules/contrib/antibot
..F                                                                 3 / 3 (100%)

Time: 00:32.759, Memory: 4.00 MB

There was 1 failure:

1) Drupal\Tests\antibot\FunctionalJavascript\AntibotJavaScriptTest::testJavaScript
TypeError: Cannot set properties of undefined (setting 'human')
    at Object.attach (http://web/modules/contrib/antibot/js/antibot.js?s29htq:19:36)
    at http://web/core/misc/drupal.js?v=10.1.5:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (http://web/core/misc/drupal.js?v=10.1.5:162:34)
    at http://web/core/misc/drupal.init.js?v=10.1.5:32:12
    at HTMLDocument.listener (http://web/core/misc/drupal.init.js?v=10.1.5:20:7)

/var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:133
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @2dareis2do
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Shreya_th โ†’ made their first commit to this issueโ€™s fork.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    3 pass
  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Hi @2dareis2do,
    I have fixed this issue and also created MR . Kindly review the changes.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    awesome,

    That fixes it for me ๐Ÿ˜€

    /var/www/html/web$ ../vendor/bin/phpunit -c core modules/contrib/antibot
    PHPUnit 9.6.13 by Sebastian Bergmann and contributors.
    
    Testing /var/www/html/web/modules/contrib/antibot
    ...                                                                 3 / 3 (100%)
    
    Time: 01:39.363, Memory: 4.00 MB
    
    OK (3 tests, 16 assertions)
  • Status changed to RTBC 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sarwan_verma

    Hi @gaurav.kapoor,
    I have tested the mergeable solution on my local .It fixes the issues. Moving to RTBC.

    Thank you!

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa

    I am getting this error when trying to run the tests, does anyone have any idea what is triggering this error?

    $  ../vendor/bin/phpunit -c core modules/contrib/antibot
    PHPUnit 9.6.15 by Sebastian Bergmann and contributors.
    
    Testing /var/www/html/web/modules/contrib/antibot
    ..E                                                                 3 / 3 (100%)
    
    Time: 00:10.177, Memory: 4.00 MB
    
    There was 1 error:
    
    1) Drupal\Tests\antibot\FunctionalJavascript\AntibotJavaScriptTest::testJavaScript
    TypeError: trim(): Argument #1 ($string) must be of type string, bool given
    
    /var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverCurlService.php:120
    /var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:125
    /var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php:66
    /var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:335
    /var/www/html/vendor/behat/mink/src/Session.php:77
    /var/www/html/vendor/behat/mink/src/Session.php:172
    /var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:281
    /var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:88
    /var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:251
    /var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:54
    /var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:370
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    ERRORS!
    Tests: 3, Assertions: 15, Errors: 1.
    
    HTML output was generated
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotCacheTagsTest-9-45696184.html
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotCacheTagsTest-10-45696184.html
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotCacheTagsTest-11-45696184.html
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotCacheTagsTest-12-45696184.html
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotNoJavascriptTest-5-20380071.html
    https://web/sites/simpletest/browser_output/Drupal_Tests_antibot_Functional_AntibotNoJavascriptTest-6-20380071.html
    

    I'll try to investigate this today, meanwhile I'll move this to "Needs Work"

  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    Hi @danrod this looks like a separate issue.

    Error above was fatal error. You are reporting 1 non fatal errors.

    e.g.

    Drupal\Tests\antibot\FunctionalJavascript\AntibotJavaScriptTest::testJavaScript
    TypeError: trim(): Argument #1 ($string) must be of type string, bool given

    You probably want to raise a new issue for that.

  • Status changed to RTBC 7 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa

    Makes sense, I'll push this to the 2.0.x branch.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    3 pass
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa

    Merged to the 2.0.x branch, thanks !

  • Status changed to Fixed 7 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada danrod Ottawa
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024