summaryrefslogtreecommitdiffstats
path: root/testapi/3rd_party
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2017-11-03 01:06:59 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-03 01:06:59 +0000
commit5dba82b4e8b5560eb726603d290698ca4c22ea11 (patch)
tree823ec5c5809e031a6068311ccf898f3ebaffd0ce /testapi/3rd_party
parent426aa0231af6cb1911ac7b6fbd36062e338af05a (diff)
parent57df9b1e64b1d40d77325c942a5269cf46e0cccf (diff)
Merge "add simple e2e tests for PodsCotroller"
Diffstat (limited to 'testapi/3rd_party')
-rw-r--r--testapi/3rd_party/static/testapi-ui/Gruntfile.js155
-rw-r--r--testapi/3rd_party/static/testapi-ui/package.json18
2 files changed, 173 insertions, 0 deletions
diff --git a/testapi/3rd_party/static/testapi-ui/Gruntfile.js b/testapi/3rd_party/static/testapi-ui/Gruntfile.js
new file mode 100644
index 0000000..8ff2802
--- /dev/null
+++ b/testapi/3rd_party/static/testapi-ui/Gruntfile.js
@@ -0,0 +1,155 @@
+
+module.exports = function (grunt) {
+ require('load-grunt-tasks')(grunt);
+ require('grunt-protractor-coverage')(grunt);
+ grunt.loadNpmTasks('grunt-shell-spawn');
+ grunt.loadNpmTasks('grunt-wait');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.initConfig({
+ connect: {
+ server: {
+ options: {
+ port: 8000,
+ base: './',
+ middleware: function(connect, options, middlewares) {
+ middlewares.unshift(function(req, res, next) {
+ if (req.method.toUpperCase() == 'POST') req.method='GET';
+ return next();
+ });
+ return middlewares;
+ }
+ }
+ }
+ },
+ copy: {
+ assets: {
+ expand: true,
+ cwd: 'assets',
+ src: '**',
+ dest: 'testapi-ui/assets',
+ },
+ components: {
+ expand: true,
+ cwd: 'components',
+ src: '**',
+ dest: 'testapi-ui/components',
+ },
+ shared: {
+ expand: true,
+ cwd: 'shared',
+ src: '**',
+ dest: 'testapi-ui/shared',
+ },
+ filesPng: {
+ expand: true,
+ src: '*.png',
+ dest: 'testapi-ui/',
+ },
+ filesIco: {
+ expand: true,
+ src: '*.ico',
+ dest: 'testapi-ui/',
+ },
+ filesJs: {
+ expand: true,
+ src: 'app.js',
+ dest: 'testapi-ui/',
+ },
+ filesJson: {
+ expand: true,
+ src: 'config.json',
+ dest: 'testapi-ui/',
+ }
+ },
+ wait: {
+ default: {
+ options: {
+ delay: 3000
+ }
+ }
+ },
+ shell: {
+ updateSelenium: {
+ command: 'node_modules/protractor/bin/webdriver-manager update',
+ options: {
+ async: false
+ }
+ },
+ startSelenium: {
+ command: 'node_modules/protractor/bin/webdriver-manager start',
+ options: {
+ async: true
+ }
+ },
+ options: {
+ stdout: false,
+ stderr: false
+ }
+ },
+ instrument: {
+ files: ['components/**/*.js'],
+ options: {
+ lazy: false,
+ basePath: "./testapi-ui/"
+ }
+ },
+ karma: {
+ unit: {
+ configFile: '../../../opnfv_testapi/tests/UI/karma.conf.js'
+ }
+ },
+ protractor_coverage: {
+ options: {
+ keepAlive: true,
+ noColor: false,
+ coverageDir: '../../../opnfv_testapi/tests/UI/coverage',
+ args: {
+ specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js']
+ }
+ },
+ local: {
+ options: {
+ configFile: '../../../opnfv_testapi/tests/UI/protractor-conf.js'
+ }
+ }
+ },
+ makeReport: {
+ src: '../../../opnfv_testapi/tests/UI/coverage/*.json',
+ options: {
+ print: 'detail'
+ }
+ },
+ protractor: {
+ e2e: {
+ options: {
+ args: {
+ specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js']
+ },
+ configFile: '../../../opnfv_testapi/tests/UI/protractor-conf.js',
+ keepAlive: true
+ }
+ }
+ }
+ });
+ grunt.registerTask('test', [
+ 'karma:unit'
+ ]);
+ grunt.registerTask('e2e', [
+ 'copy:assets',
+ 'copy:components',
+ 'copy:shared',
+ 'copy:filesPng',
+ 'copy:filesIco',
+ 'copy:filesJs',
+ 'copy:filesJson',
+ 'instrument',
+ 'connect',
+ 'shell:updateSelenium',
+ 'shell:startSelenium',
+ 'wait:default',
+ 'protractor_coverage',
+ 'makeReport'
+ // 'protractor'
+ ]);
+}
diff --git a/testapi/3rd_party/static/testapi-ui/package.json b/testapi/3rd_party/static/testapi-ui/package.json
new file mode 100644
index 0000000..dc99239
--- /dev/null
+++ b/testapi/3rd_party/static/testapi-ui/package.json
@@ -0,0 +1,18 @@
+{
+ "devDependencies": {
+ "grunt": "~1.0.1",
+ "grunt-contrib-connect": "^1.0.2",
+ "grunt-contrib-copy": "^1.0.0",
+ "grunt-karma": "~2.0.0",
+ "grunt-protractor-coverage": "^0.2.18",
+ "grunt-protractor-runner": "~5.0.0",
+ "grunt-shell-spawn": "~0.3.10",
+ "grunt-wait": "~0.1.0",
+ "karma": "~1.7.1",
+ "karma-chrome-launcher": "~2.2.0",
+ "karma-coverage": "~1.1.1",
+ "karma-jasmine": "~1.1.0",
+ "load-grunt-tasks": "~3.5.2",
+ "protractor-http-mock": "^0.10.0"
+ }
+}