-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
65 lines (53 loc) · 1.53 KB
/
main.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
- name: WDIO-based stress test
hosts: all
remote_user: root
tasks:
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400
- name: WDIO and Chrome dependencies
package:
name: "{{ item }}"
state: present
with_items:
- unzip
- nodejs
- npm
- libxss1
- libappindicator1
- libindicator7
- openjdk-8-jre
- name: Download Chrome
get_url:
url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
dest: "/tmp/chrome.deb"
- name: Install Chrome
shell: "apt install -y /tmp/chrome.deb"
- name: Get Chromedriver
get_url:
url: "https://chromedriver.storage.googleapis.com/73.0.3683.20/chromedriver_linux64.zip"
dest: "/tmp/chromedriver.zip"
- name: Extract Chromedriver
unarchive:
remote_src: yes
src: "/tmp/chromedriver.zip"
dest: "/tmp"
- name: Start Chromedriver
shell: "nohup /tmp/chromedriver &"
- name: Sync the source code of the WDIO test
copy:
src: "wdio"
dest: "/root/"
- name: Install WDIO
shell: "cd /root/wdio && npm install"
- name: Start date
debug:
var=ansible_date_time.iso8601
- name: Execute
shell: 'cd /root/wdio && ./node_modules/.bin/wdio wdio.conf.js --spec specs/stream.js'
- name: End date
debug:
var=ansible_date_time.iso8601