make protractor tests work

This commit is contained in:
Andrew
2015-03-30 08:52:49 -06:00
parent bedbe8b489
commit df9ef592f5
13 changed files with 101 additions and 124 deletions

View File

@@ -4,7 +4,6 @@ module.exports = {
src: {
spec: ['src/**/test/*.spec.js'],
js: ['src/**/*.js', '!src/**/test/**/*.js'],
e2eTest: ['src/components/*/test/*/'],
e2e: ['src/components/*/test/*/**/*'],
html: 'src/**/*.html',
scss: 'src/components/**/*.scss',

View File

@@ -1,7 +1,7 @@
describe('<%= relativePath %>', function() {
describe('<%= relativePath %>: <%= platform %>', function() {
it('should init', function() {
browser.get('http://localhost:<%= buildConfig.protractorPort %>/<%= relativePath %>');
browser.get('http://localhost:<%= buildConfig.protractorPort %>/e2e/<%= relativePath %>?ionic-platform=<%= platform %>');
});
<%= contents %>

View File

@@ -18,14 +18,9 @@
'rx/dist/rx.all': 'rx.all',
}
})
System.import('app/main');
</script>
<script src="platform.js"></script>
</head>
<body ion-app>
</body>
<script>
System.import('app/main');
</script>
</body>
</html>

View File

@@ -1,2 +0,0 @@
//TODO find a better override than window
window.IONIC_PLATFORM = '<%= platform %>';

View File

@@ -8,7 +8,7 @@ exports.config = {
// Spec patterns are relative to the location of the spec file. They may
// include glob patterns.
specs: [
path.resolve(projectRoot, 'dist/e2e/**/*.e2e.js'),
path.resolve(projectRoot, 'dist/e2e/**/*e2e.js'),
],
// Options to be passed to Jasmine-node.

View File

@@ -18,7 +18,7 @@ module.exports = function(gulp, argv, buildConfig) {
console.log('Serving `dist` on http://localhost:' + buildConfig.protractorPort);
});
gulp.task('snapshot', ['e2e', 'protractor-server'], function(done) {
gulp.task('snapshot', ['build', 'protractor-server'], function(done) {
var protractorConfigFile = path.resolve(projectRoot, 'scripts/snapshot/protractor.config.js');
snapshot(done, protractorConfigFile);
});