mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
chore(gulp): update e2e and snapshot (#8846)
* chore(e2e): add livereload server and clean task for e2e * chore(e2e): refactor to use gulp connect and open * chore(e2e): WIP remove open, add formatting, add reload task * wip(e2e): use SystemJS for faster dev e2e rebuilds * chore(e2e): wip removing old gulp file, old e2e task update template for e2e and port number * chore(e2e): wip add SystemJS for dev build of e2e, use those tasks instead * chore(e2e): uncomment out range components * chore(e2e): wip fix paths for the e2e tempate * chore(scripts): update README back to the old way * chore(e2e): code cleanup * chore(e2e): split tasks into dev and prod, put common tasks in e2e * chore(e2e): rename e2e templates and add to readme * chore(e2e): fix dev build so it will work with snapshot * chore(snapshot): get snapshot working with dev and prod builds
This commit is contained in:
committed by
Manu Mtz.-Almeida
parent
981e95d034
commit
d93070a7d5
83
scripts/e2e/e2e.template.dev.html
Normal file
83
scripts/e2e/e2e.template.dev.html
Normal file
@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
|
||||
<head>
|
||||
<title>Ionic E2E</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<link id="ionicLink" href="../../css/ionic.css" rel="stylesheet">
|
||||
<link href="../../css/e2e.shared.css" rel="stylesheet">
|
||||
|
||||
<script>
|
||||
var port;
|
||||
if (location.href.indexOf('snapshot=true') > -1) {
|
||||
port = 8876;
|
||||
document.documentElement.classList.add('snapshot');
|
||||
} else {
|
||||
port = 8000;
|
||||
document.documentElement.classList.remove('snapshot');
|
||||
}
|
||||
|
||||
if (location.href.indexOf('cordova=true') > -1) {
|
||||
window.cordova = {};
|
||||
}
|
||||
|
||||
if (location.href.indexOf('rtl=true') > -1) {
|
||||
document.dir = 'rtl';
|
||||
} else {
|
||||
document.dir = 'ltr';
|
||||
}
|
||||
|
||||
if (location.href.indexOf('theme=dark') > -1) {
|
||||
var link = document.getElementById('ionicLink');
|
||||
link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script>
|
||||
System.config({
|
||||
map: {
|
||||
'@angular/core': '/node_modules/@angular/core/bundles/core.umd.js',
|
||||
'@angular/compiler': '/node_modules/@angular/compiler/bundles/compiler.umd.js',
|
||||
'@angular/common': '/node_modules/@angular/common/bundles/common.umd.js',
|
||||
'@angular/forms': '/node_modules/@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/http': '/node_modules/@angular/http/bundles/http.umd.js',
|
||||
'@angular/platform-browser': '/node_modules/@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic': '/node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'ionic-angular': 'http://localhost:' + port,
|
||||
'rxjs': '/node_modules/rxjs'
|
||||
},
|
||||
packages: {
|
||||
'ionic-angular': {
|
||||
main: 'index',
|
||||
defaultExtension: false
|
||||
},
|
||||
'rxjs': {
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="../../polyfills/polyfills.ng.js"></script>
|
||||
<script src="../../../bundles/ionic.system.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<ion-app></ion-app>
|
||||
|
||||
<script>
|
||||
System.import('@angular/platform-browser-dynamic').then(function(platformBrowserDynamic) {
|
||||
System.import('app-module.js').then(function(appModule) {
|
||||
platformBrowserDynamic.platformBrowserDynamic().bootstrapModule(appModule.AppModule);
|
||||
}, console.error.bind(console));
|
||||
}, console.error.bind(console));
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,7 +1,7 @@
|
||||
describe('<%= relativePath %>: <%= platform %>', function() {
|
||||
|
||||
it('should init', function() {
|
||||
browser.get('http://localhost:<%= buildConfig.protractorPort %>/dist/e2e/components/<%= relativePath %>/index.html?ionicplatform=<%= platform %>&ionicOverlayCreatedDiff=0&ionicanimate=false&snapshot=true');
|
||||
browser.get('http://localhost:<%= buildConfig.protractorPort %>/dist/e2e/<%= relativePath %>/index.html?ionicplatform=<%= platform %>&ionicOverlayCreatedDiff=0&ionicanimate=false&snapshot=true');
|
||||
});
|
||||
|
||||
<%= contents %>
|
||||
|
||||
Reference in New Issue
Block a user