Browse Source

script install cypress

philippe 5 years ago
parent
commit
db6b2053b9
1 changed files with 33 additions and 0 deletions
  1. 33 0
      install_cypress.sh

+ 33 - 0
install_cypress.sh View File

@@ -0,0 +1,33 @@
1
+#!/bin/bash
2
+. bash_library.sh # source bash_library.sh
3
+
4
+# install nodjs if not installed
5
+
6
+(
7
+  log "verify if nodjs is installed"
8
+  dpkg -l | grep '^ii' | grep 'nodejs\s'
9
+
10
+  if [ $? -eq 0 ]; then
11
+    log "nodjs is installed"
12
+  else
13
+    log "install nodejs"
14
+    sudo apt install curl
15
+    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
16
+    sudo apt install -y nodejs
17
+  fi
18
+)
19
+
20
+# install Cypress
21
+
22
+(
23
+  log "go to functionnal_tests subdir.."
24
+  cd  functionnal_tests || exit 1;
25
+  log "check if package.json exist"
26
+  if [ ! -f package.json ]; then
27
+    log "run npm init"
28
+    npm init -y
29
+  fi
30
+  log "install cypress"
31
+  npm install cypress --save-dev
32
+)
33
+