SeleniumHQ.selenium

Selenium Module for Ansible

Get It! Run: ansible-galaxy install SeleniumHQ.selenium Star this repo Fork this repo

How to Use It

After installing the module with Ansible Galaxy, take the library/selenium file and place it where you need it.

Add it to your playbook/roles:

- name: Start a standalone server
  selenium:
    role: standalone
    state: running

- name: Start a standalone server (specific selenium version)
  selenium:
    version: 2.53.1 
    role: standalone
    state: running
    
- name: Start a basic hub that listens on port 4444
  selenium:
    role: hub
    state: running

- name: Start a hub on port 4445
  selenium:
    role: hub
    state: running
    args:
      port: 4445

- name: Start the hub with more memory
  selenium:
    role: hub
    state: running
    javaargs:
      - Xmx1024M
      - Xmy1024M

- name: Start a basic node that connects locally
  selenium:
    role: node
    state: running
    args:
      hubUrl: http://0.0.0.0:4444

- name: Restart a node that was on a previous port
  selenium:
    role: node
    state: restarted
    args:
      hubUrl: http://0.0.0.0:4445

- name: Start a node with a JSON config and a logfile
  roles:
    - name: Output the config file
      template: src=config.json.j2 dest=config.json

    - name: Start the node
      selenium:
        role: node
        state: running
        logfile: node.log
        args:
          nodeConfig: config.json

- name: Stop the running Selenium standalone server
  selenium:
    state: stopped

Developer Instructions

(These instructions are for Vagrant users)

Before running tests:

alias test-module=/home/vagrant/ansible/hacking/test-module

To test the module manually, use:

cd library/
test-module -m ./selenium -a "role=hub state=running"

To run all tests:

cd tests/
ansible-playbook -i localhost, test.yml
Informazioni sul progetto

Module for managing a grid / nodes using Ansible

Installa
ansible-galaxy install SeleniumHQ.selenium
Licenza
apache-2.0
Download
2.3k
Proprietario
Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers.