Browse Source

add protractor profile for local tests

Rigel Kent 1 year ago
parent
commit
9e3e248109
No account linked to committer's email address
5 changed files with 59 additions and 1 deletions
  1. 5
    0
      client/angular.json
  2. 37
    0
      client/e2e/local-protractor.conf.js
  3. 1
    0
      package.json
  4. 0
    1
      scripts/e2e/index.sh
  5. 16
    0
      scripts/e2e/local.sh

+ 5
- 0
client/angular.json View File

@@ -133,6 +133,11 @@
133 133
           "options": {
134 134
             "protractorConfig": "e2e/protractor.conf.js",
135 135
             "devServerTarget": "PeerTube:serve:e2e"
136
+          },
137
+          "configurations": {
138
+            "local": {
139
+              "protractorConfig": "e2e/local-protractor.conf.js"
140
+            }
136 141
           }
137 142
         },
138 143
         "lint": {

+ 37
- 0
client/e2e/local-protractor.conf.js View File

@@ -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
+
4
+const {SpecReporter} = require('jasmine-spec-reporter')
5
+
6
+exports.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
+}

+ 1
- 0
package.json View File

@@ -22,6 +22,7 @@
22 22
   "typings": "*.d.ts",
23 23
   "scripts": {
24 24
     "e2e": "scripty",
25
+    "e2e:local": "scripty",
25 26
     "build": "SCRIPTY_PARALLEL=true scripty",
26 27
     "build:server": "scripty",
27 28
     "build:client": "scripty",

scripts/e2e.sh → scripts/e2e/index.sh View File

@@ -13,4 +13,3 @@ npm run clean:server:test
13 13
 npm run concurrently -- -k -s first \
14 14
     "cd client && npm run ng -- e2e --port 3333" \
15 15
     "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start"
16
-

+ 16
- 0
scripts/e2e/local.sh View File

@@ -0,0 +1,16 @@
1
+#!/bin/sh
2
+
3
+set -eu
4
+
5
+npm 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
+
13
+npm 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"

Loading…
Cancel
Save