mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
make snapshot e2e tests work, except main.js/main.html only
This commit is contained in:
@ -4,7 +4,7 @@ module.exports = {
|
||||
src: {
|
||||
test: ['src/**/test/*.spec.js'],
|
||||
js: ['src/**/*.js', '!src/**/test/**/*.js'],
|
||||
e2e: ['src/**/test/*/**/*'],
|
||||
e2e: ['src/components/*/test/*/**/*'],
|
||||
html: 'src/**/*.html',
|
||||
scss: 'src/components/**/*.scss',
|
||||
},
|
||||
|
9
scripts/e2e/e2e.template.js
Normal file
9
scripts/e2e/e2e.template.js
Normal file
@ -0,0 +1,9 @@
|
||||
describe('<%= relativePath %>', function() {
|
||||
|
||||
it('should init', function() {
|
||||
browser.get('http://localhost:<%= buildConfig.protractorPort %>/<%= relativePath %>');
|
||||
});
|
||||
|
||||
<%= contents %>
|
||||
|
||||
});
|
@ -21,7 +21,6 @@
|
||||
</script>
|
||||
</head>
|
||||
<body ion-app>
|
||||
<%= contents %>
|
||||
</body>
|
||||
<script>
|
||||
System.import('app/main');
|
||||
|
@ -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.
|
||||
@ -21,9 +21,27 @@ exports.config = {
|
||||
baseUrl: 'http://localhost:' + buildConfig.protractorPort,
|
||||
|
||||
onPrepare: function() {
|
||||
beforeEach(function() {
|
||||
patchProtractorWait(global.browser);
|
||||
});
|
||||
|
||||
var snapshotConfig = require('./snapshot.config').config;
|
||||
var ionicSnapshot = require('./ionic.snapshot');
|
||||
ionicSnapshot(snapshotConfig);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// From https://github.com/angular/angular/blob/master/protractor-shared.js
|
||||
// Disable waiting for Angular as we don't have an integration layer yet...
|
||||
// TODO remove this once protractor supports angular2
|
||||
function patchProtractorWait(browser) {
|
||||
browser.ignoreSynchronization = true;
|
||||
var _get = browser.get;
|
||||
var sleepInterval = process.env.TRAVIS || process.env.JENKINS_URL ? 7000 : 3000;
|
||||
browser.get = function() {
|
||||
var result = _get.apply(this, arguments);
|
||||
browser.sleep(sleepInterval);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user