diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-16 19:59:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-17 10:55:50 +0200 |
commit | 74af5a8361f4ccb460001706ce249d50c747f361 (patch) | |
tree | 4e077f14a6c604799b15fdbea98a2d8c8bdc7576 /client/e2e | |
parent | 6200d8d91710b03a72a27e35cbe6eed1e6cc8c62 (diff) | |
download | PeerTube-74af5a8361f4ccb460001706ce249d50c747f361.tar.gz PeerTube-74af5a8361f4ccb460001706ce249d50c747f361.tar.zst PeerTube-74af5a8361f4ccb460001706ce249d50c747f361.zip |
Client E2E tests first step
Diffstat (limited to 'client/e2e')
-rw-r--r-- | client/e2e/protractor.conf.js | 29 | ||||
-rw-r--r-- | client/e2e/src/app.e2e-spec.ts | 14 | ||||
-rw-r--r-- | client/e2e/src/app.po.ts | 12 | ||||
-rw-r--r-- | client/e2e/src/video-upload.e2e-spec.ts | 9 | ||||
-rw-r--r-- | client/e2e/src/video-upload.po.ts | 7 | ||||
-rw-r--r-- | client/e2e/src/video-watch.e2e-spec.ts | 9 | ||||
-rw-r--r-- | client/e2e/src/video-watch.po.ts | 8 | ||||
-rw-r--r-- | client/e2e/tsconfig.e2e.json | 13 |
8 files changed, 101 insertions, 0 deletions
diff --git a/client/e2e/protractor.conf.js b/client/e2e/protractor.conf.js new file mode 100644 index 000000000..30705cb72 --- /dev/null +++ b/client/e2e/protractor.conf.js | |||
@@ -0,0 +1,29 @@ | |||
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: 11000, | ||
8 | specs: [ | ||
9 | './src/**/*.e2e-spec.ts' | ||
10 | ], | ||
11 | capabilities: { | ||
12 | 'browserName': 'chrome' | ||
13 | }, | ||
14 | directConnect: true, | ||
15 | baseUrl: 'http://localhost:4200/', | ||
16 | framework: 'jasmine', | ||
17 | jasmineNodeOpts: { | ||
18 | showColors: true, | ||
19 | defaultTimeoutInterval: 30000, | ||
20 | print: function () {} | ||
21 | }, | ||
22 | |||
23 | onPrepare () { | ||
24 | require('ts-node').register({ | ||
25 | project: require('path').join(__dirname, './tsconfig.e2e.json') | ||
26 | }) | ||
27 | jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}})) | ||
28 | } | ||
29 | } | ||
diff --git a/client/e2e/src/app.e2e-spec.ts b/client/e2e/src/app.e2e-spec.ts new file mode 100644 index 000000000..cdfd01f67 --- /dev/null +++ b/client/e2e/src/app.e2e-spec.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { AppPage } from './app.po' | ||
2 | |||
3 | describe('PeerTube app', () => { | ||
4 | let page: AppPage | ||
5 | |||
6 | beforeEach(() => { | ||
7 | page = new AppPage() | ||
8 | }) | ||
9 | |||
10 | it('should display the app title', () => { | ||
11 | page.navigateTo() | ||
12 | expect(page.getHeaderTitle()).toEqual('PeerTube') | ||
13 | }) | ||
14 | }) | ||
diff --git a/client/e2e/src/app.po.ts b/client/e2e/src/app.po.ts new file mode 100644 index 000000000..e3e293d7b --- /dev/null +++ b/client/e2e/src/app.po.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import { browser, by, element } from 'protractor' | ||
2 | |||
3 | export class AppPage { | ||
4 | navigateTo () { | ||
5 | browser.waitForAngularEnabled(false) | ||
6 | return browser.get('/') | ||
7 | } | ||
8 | |||
9 | getHeaderTitle () { | ||
10 | return element(by.css('.instance-name')).getText() | ||
11 | } | ||
12 | } | ||
diff --git a/client/e2e/src/video-upload.e2e-spec.ts b/client/e2e/src/video-upload.e2e-spec.ts new file mode 100644 index 000000000..45d8ae2c9 --- /dev/null +++ b/client/e2e/src/video-upload.e2e-spec.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | import { VideoUploadPage } from './video-upload.po' | ||
2 | |||
3 | describe('Video upload', () => { | ||
4 | let page: VideoUploadPage | ||
5 | |||
6 | beforeEach(() => { | ||
7 | page = new VideoUploadPage() | ||
8 | }) | ||
9 | }) | ||
diff --git a/client/e2e/src/video-upload.po.ts b/client/e2e/src/video-upload.po.ts new file mode 100644 index 000000000..df358e44b --- /dev/null +++ b/client/e2e/src/video-upload.po.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | import { browser } from 'protractor' | ||
2 | |||
3 | export class VideoUploadPage { | ||
4 | navigateTo () { | ||
5 | return browser.get('/videos/upload') | ||
6 | } | ||
7 | } | ||
diff --git a/client/e2e/src/video-watch.e2e-spec.ts b/client/e2e/src/video-watch.e2e-spec.ts new file mode 100644 index 000000000..be3552d59 --- /dev/null +++ b/client/e2e/src/video-watch.e2e-spec.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | import { VideoWatchPage } from './video-watch.po' | ||
2 | |||
3 | describe('Video watch', () => { | ||
4 | let page: VideoWatchPage | ||
5 | |||
6 | beforeEach(() => { | ||
7 | page = new VideoWatchPage() | ||
8 | }) | ||
9 | }) | ||
diff --git a/client/e2e/src/video-watch.po.ts b/client/e2e/src/video-watch.po.ts new file mode 100644 index 000000000..3b5454ba1 --- /dev/null +++ b/client/e2e/src/video-watch.po.ts | |||
@@ -0,0 +1,8 @@ | |||
1 | import { browser } from 'protractor' | ||
2 | |||
3 | export class VideoWatchPage { | ||
4 | navigateTo () { | ||
5 | browser.waitForAngularEnabled(false) | ||
6 | return browser.get('/') | ||
7 | } | ||
8 | } | ||
diff --git a/client/e2e/tsconfig.e2e.json b/client/e2e/tsconfig.e2e.json new file mode 100644 index 000000000..a6dd62202 --- /dev/null +++ b/client/e2e/tsconfig.e2e.json | |||
@@ -0,0 +1,13 @@ | |||
1 | { | ||
2 | "extends": "../tsconfig.json", | ||
3 | "compilerOptions": { | ||
4 | "outDir": "../out-tsc/app", | ||
5 | "module": "commonjs", | ||
6 | "target": "es5", | ||
7 | "types": [ | ||
8 | "jasmine", | ||
9 | "jasminewd2", | ||
10 | "node" | ||
11 | ] | ||
12 | } | ||
13 | } \ No newline at end of file | ||