Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Selenium install is broken #1305

Closed
jeff1985 opened this issue Apr 18, 2017 · 1 comment
Closed

Selenium install is broken #1305

jeff1985 opened this issue Apr 18, 2017 · 1 comment
Labels

Comments

@jeff1985
Copy link

Issue Type

  • Bug Report

Environment

Vagrant 1.9.3
VirtualBox 5.1.18r114002
ansible 2.3.0.0
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Oct 11 2016, 05:20:59) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)]

OS

  • macOS 10.12.4

Summary

Trying to configure BDD with Behat using Selenium and Chrome. I have a blank install with the default site as per documentation. My installed_extras is set to:

 installed_extras:
  - adminer
  - drupalconsole
  - drush
  - mailhog
  - selenium

The docs for selenium install are broken, see issue #1304. This however seems to be a problem with the drupal install, thats why i tried to verify that the selenium install would be working at least in a standalone setup with behat. So I created a minimum install as per behat docs. I also added mink and selenium2 driver.

My composer.json:

{
    "require-dev": {
        "behat/behat": "*",
        "behat/mink-extension": "*",
        "behat/mink" : "*",
        "behat/mink-zombie-driver" : "*",
        "behat/mink-selenium2-driver": "*",
        "behat/mink-goutte-driver": "*"
    },
    "config": {
        "bin-dir": "bin/"
    }
}

My behat.yml:

default:
    extensions:
        Behat\MinkExtension:
            base_url: http://localhost
            browser_name: chrome

            selenium2:
              browser: "chrome"
              wd_host:  http://drupalvm.dev:4444/wd/hub
              capabilities: { "platform": "LINUX", "browser": "chrome", "version": "" }

FeatureContext.php:

<?php

use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;

/**
 * Defines application features from the specific context.
 */
class FeatureContext extends MinkContext
{
    /**
     * Initializes context.
     *
     * Every scenario gets its own context instance.
     * You can also pass arbitrary arguments to the
     * context constructor through behat.yml.
     */
    public function __construct()
    {
    }
}

and HomeContent.feature:

Feature: Index
  I see welcome message on index page
  And can navigate to registration from here

  @javascript
  Scenario: Proceed with registering
    Given I am on "http://www.github.com/"
    Then I should see "Learn Git"

When I run behat, it shows the following error:

vagrant@drupalvm:/var/www/drupalvm/behat_standalone$ behat
Feature: Index
  I see welcome message on index page
  And can navigate to registration from here

  @javascript
  Scenario: Proceed with registering       # features/HomeContent.feature:6
    Given I am on "http://www.github.com/" # FeatureContext::visit()
      Could not open connection: chrome not reachable
        (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-62-generic x86_64) (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 114.33 seconds
      Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
      System info: host: 'drupalvm', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-62-generic', java.version: '1.8.0_121'
      Driver info: org.openqa.selenium.chrome.ChromeDriver (Behat\Mink\Exception\DriverException)
    Then I should see "Learn Git"          # FeatureContext::assertPageContainsText()

--- Failed scenarios:

    features/HomeContent.feature:6

1 scenario (1 failed)
2 steps (1 failed, 1 skipped)
1m54.41s (8.70Mb)
@geerlingguy
Copy link
Owner

@jeff1985 - Please see the reference here: https://github.com/geerlingguy/drupalvm-live/blob/master/tests/behat.yml

Currently chromedriver may or may not be working—I burned about 20 hours trying to get it to work correctly and eventually gave up. Sometime recently it started blowing up. Please use the upstream issue arknoll/ansible-role-selenium#37 for any follow-up (or other existing issues in that queue).

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

No branches or pull requests

2 participants