jhedstrom / DrupalDriver

A collection of drivers for controlling Drupal.
GNU General Public License v2.0
64 stars 95 forks source link

Could not open connection: Unable to create new service: GeckoDriverService #246

Open ptmkenny opened 2 years ago

ptmkenny commented 2 years ago

EDIT: Upon further debugging, this issue is caused by drupal-extension 4.2.1, not drupal-driver, so it should be moved to the other repo.

After updating to drupal-extension 4.2.1 from 4.1.0:

  - Installing friends-of-behat/mink-extension (v2.6.1): Extracting archive
  - Upgrading drupal/drupal-extension (v4.1.0 => v4.2.1): Extracting archive

I'm getting an error when I try to run my tests:

  ╳  Could not open connection: Unable to create new service: GeckoDriverService
  ╳  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
  ╳  System info: host: 'f9b3338ce1f4', ip: '172.19.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.102.1-microsoft-standard-WSL2', java.version: '1.8.0_191'
  ╳  Driver info: driver.version: unknown (Behat\Mink\Exception\DriverException)

I'm confused about why I'm getting this error because Gecko is Firefox right? In my behat.yml, I am testing with Chrome only.

I originally thought this was caused by updating drupal-driver to 2.1.2, but upon further testing, I found that when I updated drupal-driver to 2.1.2 while locking drupal-extension to 4.1.0, the error did not occur.

My test command:

/app/vendor/bin/behat /app/tests/behat/features/ -c /app/tests/behat/behat-lando-selenium.yml --tags '@ci' --format pretty --out std --format html --out /app/tests/reports --profile profile_chrome

And behat.yml:

#
# behat.yml file for testing on lando with selenium.
#
default:
  suites:
    default:
      paths:
        - "%paths.base%/features/ci"
        - "%paths.base%/features/site_audit"
      contexts:
        - FeatureContext
        - MyDrupalFeatureContext
        - MyMinkContext
        # - Drupal\DrupalExtension\Context\MinkContext
        # - Drupal\DrupalExtension\Context\DrupalContext
        - Drupal\DrupalExtension\Context\DrushContext
        - Drupal\DrupalExtension\Context\MessageContext
        - Drupal\DrupalExtension\Context\RawDrupalContext
        # - Drupal\Tests\honeypot\Behat\HoneypotContext
        - FailAid\Context\FailureContext
        - emuse\BehatHTMLFormatter\Context\ScreenshotContext:
            # "assets" needs to be within the reports output_path
            screenshotDir: /app/tests/reports/assets/screenshots
      formatters:
        html:
          # Where to put the HTML report
          output_path: /app/tests/reports
  extensions:
    emuse\BehatHTMLFormatter\BehatHTMLFormatterExtension:
      name: html
      renderer: Twig
      # renderer: Twig,Behat2,Minimal
      # file_name: index
      # If the file name is not set, a timestamp is used.
      print_args: true
      print_outp: true
      loop_break: true
    FailAid\Extension:
      output:
        url: true
        status: false
        tags: true
        feature: true
        context: true
        screenshot: true # Use with BehatHTMLFormatter to get giant screenshots.
        driver: true
        rerun: true
        debugBarSelectors: true
      screenshot:
        directory: /app/tests/reports/assets/screenshots
        hostUrl: https://example.lndo.site/
        mode: png
        autoClean: true
        size: 1280x6400
    Drupal\MinkExtension:
      # https://github.com/jhedstrom/drupalextension/issues/486
      ajax_timeout: 15
      # Default configuration has this commented out so it can be overidden.
      base_url: http://example.lndo.site/
      browser_name: chrome
      # For file uploads.
      files_path: /app/submodules/behat-media/behat-test-files
      sessions:
        default:
          goutte:
            guzzle_parameters:
              verify: false
    Drupal\DrupalExtension:
      blackbox: ~
      api_driver: 'drush'
      drush:
        root: '/app/vendor/bin/drush'
        alias: ''
      region_map:
        content: "#page-content"
        footer: "#footer"

profile_chrome:
  extensions:
    Drupal\MinkExtension:
      browser_name: chrome
      sessions:
        javascript:
          selenium2:
            browser: chrome
            wd_host: http://seleniumchromedriver:4444/wd/hub
            capabilities:
              marionette: null
              browserName: chrome
              browser: chrome
              chrome:
                # https://stackoverflow.com/questions/48450594/selenium-timed-out-receiving-message-from-renderer/52340526
                switches:
                  - "start-maximized" # https://stackoverflow.com/a/26283818/1689770
                  - "automation" # https://stackoverflow.com/a/43840128/1689770
                  - "--no-sandbox" # https://stackoverflow.com/a/50725918/1689770
                  - "--disable-infobars" # //https://stackoverflow.com/a/43840128/1689770
                  - "--disable-dev-shm-usage" # https://stackoverflow.com/a/50725918/1689770
                  - "--disable-browser-side-navigation" # https://stackoverflow.com/a/49123152/1689770
                  - "--disable-gpu"  # https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
                  - "--disable-web-security"
                  - "--disable-extensions"
                  - "--dns-prefetch-disable"

# profile_firefox:
#   extensions:
#     Drupal\MinkExtension:
#       browser_name: firefox
#       sessions:
#         javascript:
#           selenium2:
#             browser: firefox
#             wd_host: http://seleniumfirefoxdriver:4444/wd/hub
#             capabilities:
#               marionette: true