Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Add role to install selenium, chrome, and chromedriver. #62

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

damontgomery
Copy link

The behat.yml configuration I tested with looks something like,

default:
  suites:
    default:
      contexts:
        - FeatureContext
        - Drupal\DrupalExtension\Context\DrupalContext
        - Drupal\DrupalExtension\Context\MinkContext
        - Drupal\DrupalExtension\Context\MessageContext
        - Drupal\DrupalExtension\Context\DrushContext
      filters:
        tags: "~@skipci"
  gherkin:
    cache: ~
  extensions:
    Behat\MinkExtension:
      browser_name: 'chrome'
      selenium2:
        wd_host: "http://127.0.0.1:4444/wd/hub"
        capabilities: { "browserName": "chrome", "browser": "chrome", "version": "62", 'chrome': {'switches':['--no-sandbox', '--headless']}}
      javascript_session: selenium2
      base_url: [INSERT HERE]
    Drupal\DrupalExtension:
      blackbox: ~
      api_driver: 'drupal'
      drupal:
        drupal_root: 'web'
      text:
        username_field: 'name'
        password_field: 'pass'
        log_out: 'Log out'
      region_map:
        anywhere: "*"

circle:
  extensions:
    Behat\MinkExtension:
      base_url: [INSERT HERE]:8000

The critical part was,

    Behat\MinkExtension:
      browser_name: 'chrome'
      selenium2:
        wd_host: "http://127.0.0.1:4444/wd/hub"
        capabilities: { "browserName": "chrome", "browser": "chrome", "version": "62", 'chrome': {'switches':['--no-sandbox', '--headless']}}
      javascript_session: selenium2
      base_url: [INSERT HERE]

I also created a Phing script to start the selenium server. I couldn't get it to stay on when I tried to add it to the Ansible part. Maybe someone else has ideas for that.

    <target name="start-selenium">
        <exec command='java -jar -Dwebdriver.chrome.driver="/usr/local/share/chromedriver/chromedriver" /usr/local/share/selenium/selenium-server-standalone.jar >/dev/null 2>&amp;1 &amp;' dir="/home" />
    </target>

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

Successfully merging this pull request may close these issues.

1 participant