forked from ymcatwincities/openy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.yml
77 lines (69 loc) · 1.95 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
- hosts: localhost
connection: local
gather_facts: no
vars:
behat_root: '..'
browser: 'chrome'
selenium_ip: 127.0.0.1
selenium_port: 4444
selenium_url: "{{ selenium_ip }}:{{ selenium_port }}/wd/hub"
run_javascript_tests: 'yes'
container_name: 'selenium'
container_image: 'selenium/standalone-chrome-debug:3.3'
pre_tasks:
- name: Wait for Selenium container to be stopped
wait_for:
host: "{{ selenium_ip }}"
port: "{{ selenium_port }}"
delay: 0
state: stopped
when: run_javascript_tests == 'yes'
tasks:
- name: Run Selenium container
docker:
name: "{{ container_name }}"
image: "{{ container_image }}"
detach: true
ports:
- "{{ selenium_port }}:{{ selenium_port }}"
- 5901:5900
state: started
sudo: yes
when: run_javascript_tests == 'yes'
tags:
- run_selenium
- name: Wait for Selenium container to be run
wait_for:
host: "{{ selenium_ip }}"
port: "{{ selenium_port }}"
delay: 10
state: drained
when: run_javascript_tests == 'yes'
- name: Run full Behat tests
ignore_errors: yes
shell: 'cd {{ behat_root }} && bin/behat'
when: run_javascript_tests == 'yes'
- name: Run headless Behat tests
ignore_errors: yes
shell: 'cd {{ behat_root }} && bin/behat --tags "~@javascript"'
when: run_javascript_tests == 'no'
post_tasks:
- name: Stop Selenium container
docker:
name: "{{ container_name }}"
image: "{{ container_image }}"
state: stopped
sudo: yes
when: run_javascript_tests == 'yes'
tags:
- stop_selenium
- name: Remove Selenium container
docker:
name: "{{ container_name }}"
image: "{{ container_image }}"
state: absent
sudo: yes
when: run_javascript_tests == 'yes'
tags:
- stop_selenium