Skip to content

Commit 6e3d21b

Browse files
committed
Fix automation tests
1 parent 510c5d8 commit 6e3d21b

19 files changed

+139
-248
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ node_js:
55
before_script:
66
- npm install -g grunt-cli
77
- npm install -g bower
8+
- npm install -g protractor
9+
- npm update
810
- bower update
11+
- node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update
912
before_install:
1013
- "export DISPLAY=:99.0"
1114
- "sh -e /etc/init.d/xvfb start"
@@ -19,7 +22,7 @@ after_success:
1922
- ssh ${ACCEPTANCE_USER}@${ACCEPTANCE_HOST} mkdir -p ${DIST_DIR}
2023
- scp -r dist/* ${ACCEPTANCE_USER}@${ACCEPTANCE_HOST}:${DIST_DIR}/
2124
addons:
22-
firefox: "27.0"
25+
firefox: "36.0"
2326
env:
2427
global:
2528
- secure: M7tZ5uMFAPBNkzNuD0HF9PxeoH3Q9gMsvOCheQd5WCxxcSQwGsw8naErJshXYdAvFLsuTYT0MfHYt/TfcoEHfrykK5GiGaaSQB0MQtDWokQPHUl3S8Cjjh8+Aj3V/J+yyEFZ7AY9PvoSnHdeEuZfAYO/tuj9IBmC9tsbV5K5hX4=

Gruntfile.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,27 @@ module.exports = function (grunt) {
4949

5050
livereload: {
5151
options: {
52-
livereload: true,
53-
open: true,
52+
livereload: true,
53+
open: true,
5454
middleware: function (connect) {
5555
return [
5656
connect.static('dist')
5757
];
5858
}
5959
}
60+
},
61+
62+
regression: {
63+
options: {
64+
livereload: true,
65+
open: false,
66+
middleware: function (connect) {
67+
return [
68+
connect.static('dist'),
69+
connect.static('test/regression/assets'),
70+
];
71+
}
72+
}
6073
}
6174
},
6275

@@ -273,14 +286,7 @@ module.exports = function (grunt) {
273286

274287
protractor: {
275288
options: {
276-
configFile: 'test/regression/protractor.conf.js',
277-
keepAlive: false,
278-
args: {
279-
browser: process.env.TRAVIS ? 'firefox' : 'chrome'
280-
}
281-
},
282-
283-
regression: {
289+
keepAlive: false
284290
},
285291

286292
local: {
@@ -315,7 +321,7 @@ module.exports = function (grunt) {
315321
]);
316322

317323
grunt.registerTask('regression', [
318-
'build',
324+
'connect:regression',
319325
'protractor:local'
320326
]);
321327
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Api-Console for RAML based app",
55
"main": "index.js",
66
"scripts": {
7-
"test": "grunt test"
7+
"test": "grunt regression"
88
},
99
"repository": {
1010
"type": "git",

test/regression/assertions/resource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Resource (poName) {
4646

4747
securitySchemesCount.then(function (count) {
4848
for (var i = 0; i < count; i++) {
49-
expect(schemes.get(i).getText()).toBe(expectedSchemes[i]);
49+
expect(schemes.get(i).getInnerHtml()).toBe(expectedSchemes[i]);
5050
}
5151
});
5252
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>API Console</title>
7+
<link href="styles/api-console-light-theme.css" rel="stylesheet" class="theme">
8+
</head>
9+
<body ng-app="ramlConsoleApp" ng-cloak class="raml-console-body">
10+
<raml-console src="raml/all-methods.raml"></raml-console>
11+
<script src="scripts/api-console-vendor.js"></script>
12+
<script src="scripts/api-console.js"></script>
13+
<script type="text/javascript">
14+
$.noConflict();
15+
</script>
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>API Console</title>
7+
<link href="styles/api-console-light-theme.css" rel="stylesheet" class="theme">
8+
</head>
9+
<body ng-app="ramlConsoleApp" ng-cloak class="raml-console-body">
10+
<raml-console src="raml/minimum.raml"></raml-console>
11+
<script src="scripts/api-console-vendor.js"></script>
12+
<script src="scripts/api-console.js"></script>
13+
<script type="text/javascript">
14+
$.noConflict();
15+
</script>
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>API Console</title>
7+
<link href="styles/api-console-light-theme.css" rel="stylesheet" class="theme">
8+
</head>
9+
<body ng-app="ramlConsoleApp" ng-cloak class="raml-console-body">
10+
<raml-console src="raml/resources.raml"></raml-console>
11+
<script src="scripts/api-console-vendor.js"></script>
12+
<script src="scripts/api-console.js"></script>
13+
<script type="text/javascript">
14+
$.noConflict();
15+
</script>
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>API Console</title>
7+
<link href="styles/api-console-light-theme.css" rel="stylesheet" class="theme">
8+
</head>
9+
<body ng-app="ramlConsoleApp" ng-cloak class="raml-console-body">
10+
<raml-console src="raml/security-schemes.raml"></raml-console>
11+
<script src="scripts/api-console-vendor.js"></script>
12+
<script src="scripts/api-console.js"></script>
13+
<script type="text/javascript">
14+
$.noConflict();
15+
</script>
16+
</body>
17+
</html>

test/regression/assets/directive.tpl.html

Lines changed: 0 additions & 36 deletions
This file was deleted.

test/regression/assets/raml/security-schemes.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ securitySchemes:
1818
authorizationUri: https://acme.com/login/oauth/authorize
1919
accessTokenUri: https://acme.com/login/oauth/access_token
2020
authorizationGrants: [ code ]
21-
securedBy: [ oauth_2_0 ]
21+
securedBy: [ null, oauth_2_0 ]
2222
/resources:
2323
get:

0 commit comments

Comments
 (0)