|
@@ -8,26 +8,56 @@
|
8
|
8
|
dpkg -l | grep '^ii' | grep 'nodejs\s'
|
9
|
9
|
|
10
|
10
|
if [ $? -eq 0 ]; then
|
11
|
|
- log "nodjs is installed"
|
|
11
|
+ loggood "nodejs is installed"
|
12
|
12
|
else
|
13
|
13
|
log "install nodejs"
|
14
|
14
|
sudo apt install curl
|
15
|
15
|
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
16
|
16
|
sudo apt install -y nodejs
|
|
17
|
+ loggood "nodejs is now installed"
|
17
|
18
|
fi
|
18
|
19
|
)
|
19
|
20
|
|
20
|
21
|
# install Cypress
|
21
|
|
-
|
|
22
|
+log "go to functionnal_tests subdir.."
|
|
23
|
+cd functionnal_tests || exit 1;
|
22
|
24
|
(
|
23
|
|
- log "go to functionnal_tests subdir.."
|
24
|
|
- cd functionnal_tests || exit 1;
|
|
25
|
+ ACTUALDIR=$(pwd)
|
|
26
|
+ loggood "Your are now here: \"$ACTUALDIR\""
|
25
|
27
|
log "check if package.json exist"
|
26
|
28
|
if [ ! -f package.json ]; then
|
27
|
|
- log "run npm init"
|
|
29
|
+ log "package.json not exist => run npm init"
|
28
|
30
|
npm init -y
|
|
31
|
+ loggood "npm init finished => package.json is now created"
|
|
32
|
+ else
|
|
33
|
+ loggood "package.json exist"
|
29
|
34
|
fi
|
30
|
35
|
log "install cypress"
|
31
|
36
|
npm install cypress --save-dev
|
|
37
|
+ loggood "cypress is now installed"
|
32
|
38
|
)
|
33
|
39
|
|
|
40
|
+# modify cypress.json
|
|
41
|
+
|
|
42
|
+(
|
|
43
|
+ log "check if cypress.json exist"
|
|
44
|
+ if [ ! -f cypress.json ]; then
|
|
45
|
+ log "cypress.json not exist => copy from cypress.json.sample"
|
|
46
|
+ cp cypress.json.sample cypress.json
|
|
47
|
+ loggood "cypress.json is now available"
|
|
48
|
+ log "write path in cypress.json"
|
|
49
|
+ SUBDIR=$(pwd)
|
|
50
|
+ sed -i "s|{path_test_file}|$SUBDIR|g" cypress.json
|
|
51
|
+ loggood "path is now configured"
|
|
52
|
+ else
|
|
53
|
+ log "cypress.json exist => check if integrationFolder have path"
|
|
54
|
+ if grep -q "\"integrationFolder\"\:\s\"{path_test_file}\"" cypress.json ; then
|
|
55
|
+ log "no path => write path in cypress.json"
|
|
56
|
+ SUBDIR=$(pwd)
|
|
57
|
+ sed -i "s|{path_test_file}|$SUBDIR|g" cypress.json
|
|
58
|
+ loggood "path is now configured"
|
|
59
|
+ else
|
|
60
|
+ loggood "path exist. Modify manualy if necessary"
|
|
61
|
+ fi
|
|
62
|
+ fi
|
|
63
|
+)
|