arknoll / ansible-role-selenium

Ansible Role Selenium
https://galaxy.ansible.com/list#/roles/4340
Other
20 stars 52 forks source link

Bigger browser window than 640x480 #26

Closed PieterDC closed 7 years ago

PieterDC commented 7 years ago

Some of my Selenium tests require a bigger screen resolution than 640x480 which is apparently the default resolution of xvfb.

vagrant@drupalvm:/var/www/drupalvm/selenium$ systemctl status selenium
* selenium.service - selenium test framework
   Loaded: loaded (/etc/systemd/system/selenium.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-02-02 14:34:38 UTC; 17s ago
 Main PID: 31953 (xvfb-run)
   CGroup: /system.slice/selenium.service
           |-31953 /bin/sh /usr/bin/xvfb-run /usr/bin/java -client -jar /opt/selenium/selenium-server-standalone-2.53.0.jar
           |-31967 Xvfb :99 -screen 0 640x480x8 -nolisten tcp -auth /tmp/xvfb-run.8RAJhg/Xauthority
           `-31970 /usr/bin/java -client -jar /opt/selenium/selenium-server-standalone-2.53.0.jar
vagrant@drupalvm:/var/www/drupalvm/selenium$

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5828#issuecomment-192123706 explains how xvfb can be started with a bigger resolution. Which works when manually replaced ExecStart=/usr/bin/xvfb-run /usr/bin/java -client -jar {{ selenium_install_dir }}/selenium/selenium-server-standalone-{{ selenium_version }}.jar in templates/selenium-unit.j2 with ExecStart=/usr/bin/xvfb-run -s "-screen 0, 1920x1080x24" /usr/bin/java -client -jar {{ selenium_install_dir }}/selenium/selenium-server-standalone-{{ selenium_version }}.jar

It would be handy if ansible-role-selenium would support this with a parameter.

heddn commented 7 years ago

It looks like #19 is trying to add that parameter, along with some others.

arknoll commented 7 years ago

Merged PR https://github.com/arknoll/ansible-role-selenium/pull/31 to help address this issue. Will be making a release shortly.

sguter90 commented 7 years ago

@arknoll: Thanks for merging! @PieterDC: The role has a new parameter selenium_xvfb_args which is set to the following value per default: --server-args='-screen 0, 1920x1080x24'

This seems to be exactly your use case.

geerlingguy commented 7 years ago

Looks like this can be closed, as it's in 2.2.0!