aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-10-01 13:40:21 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-10-01 13:40:28 +0200
commit9e3e248109ffe5fc208c23081cbcffdb9a682ff4 (patch)
tree951223299727201fc5bbddd6c595725c3919a372
parent8c202ae8d4e0ee17f804b4977ea9ce37057cd023 (diff)
downloadPeerTube-9e3e248109ffe5fc208c23081cbcffdb9a682ff4.tar.gz
PeerTube-9e3e248109ffe5fc208c23081cbcffdb9a682ff4.tar.zst
PeerTube-9e3e248109ffe5fc208c23081cbcffdb9a682ff4.zip
add protractor profile for local tests
-rw-r--r--client/angular.json5
-rw-r--r--client/e2e/local-protractor.conf.js37
-rw-r--r--package.json1
-rwxr-xr-xscripts/e2e/index.sh (renamed from scripts/e2e.sh)1
-rwxr-xr-xscripts/e2e/local.sh16
5 files changed, 59 insertions, 1 deletions
diff --git a/client/angular.json b/client/angular.json
index 2cf2ecd62..bd3c7216e 100644
--- a/client/angular.json
+++ b/client/angular.json
@@ -133,6 +133,11 @@
133 "options": { 133 "options": {
134 "protractorConfig": "e2e/protractor.conf.js", 134 "protractorConfig": "e2e/protractor.conf.js",
135 "devServerTarget": "PeerTube:serve:e2e" 135 "devServerTarget": "PeerTube:serve:e2e"
136 },
137 "configurations": {
138 "local": {
139 "protractorConfig": "e2e/local-protractor.conf.js"
140 }
136 } 141 }
137 }, 142 },
138 "lint": { 143 "lint": {
diff --git a/client/e2e/local-protractor.conf.js b/client/e2e/local-protractor.conf.js
new file mode 100644
index 000000000..53edf26f2
--- /dev/null
+++ b/client/e2e/local-protractor.conf.js
@@ -0,0 +1,37 @@
1// Protractor configuration file, see link for more information
2// https://github.com/angular/protractor/blob/master/lib/config.ts
3
4const {SpecReporter} = require('jasmine-spec-reporter')
5
6exports.config = {
7 allScriptsTimeout: 25000,
8 specs: ['./src/**/*.e2e-spec.ts'],
9
10 seleniumAddress: 'http://localhost:4444/wd/hub',
11
12 capabilities: {
13 'browserName': 'firefox',
14 'moz:firefoxOptions': {
15 'args': ["-headless"],
16 "log": {
17 "level": "info" // default is "info"
18 }
19 }
20 },
21
22 // maxSessions: 1,
23 baseUrl: 'http://localhost:3333/',
24 framework: 'jasmine',
25 jasmineNodeOpts: {
26 showColors: true,
27 defaultTimeoutInterval: 45000,
28 print: function() {}
29 },
30
31 onPrepare() {
32 require('ts-node').register({
33 project: require('path').join(__dirname, './tsconfig.e2e.json')
34 })
35 jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }))
36 }
37}
diff --git a/package.json b/package.json
index c091aeab7..06434f89d 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
22 "typings": "*.d.ts", 22 "typings": "*.d.ts",
23 "scripts": { 23 "scripts": {
24 "e2e": "scripty", 24 "e2e": "scripty",
25 "e2e:local": "scripty",
25 "build": "SCRIPTY_PARALLEL=true scripty", 26 "build": "SCRIPTY_PARALLEL=true scripty",
26 "build:server": "scripty", 27 "build:server": "scripty",
27 "build:client": "scripty", 28 "build:client": "scripty",
diff --git a/scripts/e2e.sh b/scripts/e2e/index.sh
index 1e31cd57c..cf2e04356 100755
--- a/scripts/e2e.sh
+++ b/scripts/e2e/index.sh
@@ -13,4 +13,3 @@ npm run clean:server:test
13npm run concurrently -- -k -s first \ 13npm run concurrently -- -k -s first \
14 "cd client && npm run ng -- e2e --port 3333" \ 14 "cd client && npm run ng -- e2e --port 3333" \
15 "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start" 15 "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start"
16
diff --git a/scripts/e2e/local.sh b/scripts/e2e/local.sh
new file mode 100755
index 000000000..65ec653dc
--- /dev/null
+++ b/scripts/e2e/local.sh
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -eu
4
5npm run clean:server:test
6
7(
8 cd client
9 npm run webdriver-manager update
10 npm run webpack -- --config webpack/webpack.video-embed.js --mode development
11)
12
13npm run concurrently -- -k -s first \
14 "cd client && npm run webdriver-manager start" \
15 "cd client && npm run ng -- e2e --port 3333 -c local" \
16 "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start"