diff --git a/ionic/components/card/test/basic/main.html b/ionic/components/card/test/basic/main.html index 98d46203bc..09b637158d 100644 --- a/ionic/components/card/test/basic/main.html +++ b/ionic/components/card/test/basic/main.html @@ -14,7 +14,7 @@
Keep close to Nature's heart... and break clear away, once in awhile, and climb a mountain or spend a week in the woods. Wash your spirit clean.
- +
diff --git a/ionic/components/nav/test/basic/e2e.ts b/ionic/components/nav/test/basic/e2e.ts new file mode 100644 index 0000000000..e33c933135 --- /dev/null +++ b/ionic/components/nav/test/basic/e2e.ts @@ -0,0 +1,16 @@ + +it('should go from 1 to 2', function() { + element(by.css('#from1To2')).click(); +}); + +it('should go from 2 to 3', function() { + element(by.css('#from2To3')).click(); +}); + +it('should go from 3 to 2', function() { + element(by.css('#from3To2')).click(); +}); + +it('should go from 2 to 1', function() { + element(by.css('#from2To1')).click(); +}); diff --git a/ionic/components/nav/test/basic/pages/first-page.ts b/ionic/components/nav/test/basic/pages/first-page.ts index 94bd86ab5d..b43704bd6e 100644 --- a/ionic/components/nav/test/basic/pages/first-page.ts +++ b/ionic/components/nav/test/basic/pages/first-page.ts @@ -15,7 +15,7 @@ import {ThirdPage} from './third-page'; '' + '' + '

First Page: {{ val }}

' + - '

' + + '

' + '

' + '

' + '' + diff --git a/ionic/components/nav/test/basic/pages/second-page.ts b/ionic/components/nav/test/basic/pages/second-page.ts index ea797903fa..7e7d25cca0 100644 --- a/ionic/components/nav/test/basic/pages/second-page.ts +++ b/ionic/components/nav/test/basic/pages/second-page.ts @@ -8,8 +8,8 @@ import {FirstPage} from './first-page'; Second Page Header

-

-

+

+

Random: {{ val }}

diff --git a/ionic/components/nav/test/basic/pages/third-page.ts b/ionic/components/nav/test/basic/pages/third-page.ts index e989e2ae5a..af2ea67381 100644 --- a/ionic/components/nav/test/basic/pages/third-page.ts +++ b/ionic/components/nav/test/basic/pages/third-page.ts @@ -6,7 +6,7 @@ import {IonicView, NavController} from 'ionic/ionic'; Third Page Header

- +

diff --git a/ionic/components/tabs/test/advanced/e2e.ts b/ionic/components/tabs/test/advanced/e2e.ts index 8b13789179..1a8876aa6c 100644 --- a/ionic/components/tabs/test/advanced/e2e.ts +++ b/ionic/components/tabs/test/advanced/e2e.ts @@ -1 +1,20 @@ +it('should go to Tab1 Page1', function() { + element(by.css('#signIn')).click(); +}); + +it('should go to Tab1 Page2', function() { + element(by.css('#goToTab1Page2')).click(); +}); + +it('should go to Tab2 Page1', function() { + element(by.css('.tab-button:nth-of-type(2)')).click(); +}); + +it('should go back to Tab1 Page2', function() { + element(by.css('.tab-button:nth-of-type(1)')).click(); +}); + +it('should go back to Tab1 Page1', function() { + element(by.css('#backToTab1Page1')).click(); +}); diff --git a/ionic/components/tabs/test/advanced/index.ts b/ionic/components/tabs/test/advanced/index.ts index ad4bab0555..85d552cf9c 100644 --- a/ionic/components/tabs/test/advanced/index.ts +++ b/ionic/components/tabs/test/advanced/index.ts @@ -9,7 +9,7 @@ import {App, IonicView, NavController} from 'ionic/ionic'; 'Sign In' + '' + '' + - '

' + + '

' + '' + '' + '
' @@ -45,7 +45,7 @@ class TabsPage { 'Tabs 1 Page 1' + '' + '' + - '

' + + '

' + '' + '' + '
' @@ -68,7 +68,7 @@ class Tab1Page1 { '' + '' + '

' + - '

' + + '

' + '' + '' + '
' diff --git a/scripts/snapshot/ionic.snapshot.js b/scripts/snapshot/ionic.snapshot.js index 93a702d9a4..a3b351c1f5 100644 --- a/scripts/snapshot/ionic.snapshot.js +++ b/scripts/snapshot/ionic.snapshot.js @@ -17,6 +17,7 @@ var IonicSnapshot = function(options) { self.appId = options.appId || 'test_app'; self.sleepBetweenSpecs = options.sleepBetweenSpecs || 750; self.testId = browser.params.test_id || 'test_id'; + self.shouldUpload = browser.params.upload !== 'false'; self.platformId = browser.params.platform_id; self.platformIndex = browser.params.platform_index; self.platformCount = browser.params.platform_count; @@ -54,6 +55,8 @@ var IonicSnapshot = function(options) { }); }); process.on('exit', function() { + if (!self.shouldUpload) return; + if (self.highestMismatch > 1) { log(colors.red('Highest Mismatch: ' + self.highestMismatch + '%')); } else if (self.highestMismatch > 0) { @@ -102,6 +105,10 @@ var IonicSnapshot = function(options) { browser.sleep(self.sleepBetweenSpecs).then(function(){ + if (!self.shouldUpload) { + return d.fulfill(); + } + browser.takeScreenshot().then(function(pngBase64) { var specIdString = '[' + (spec.id+1) + '/' + self.testData.total_specs + ']'; @@ -109,7 +116,7 @@ var IonicSnapshot = function(options) { self.testData.description = spec.getFullName(); self.testData.highest_mismatch = self.highestMismatch; self.testData.png_base64 = pngBase64; - self.testData.url = currentUrl; + self.testData.url = currentUrl.replace('dist/', '/'); pngBase64 = null; var requestDeferred = q.defer(); @@ -166,6 +173,8 @@ var IonicSnapshot = function(options) { IonicReporter.prototype.reportRunnerResults = function() { var self = this; + if (!self.shouldUpload) return; + self.flow.execute(function() { var d = protractor.promise.defer(); log('Waiting for all screenshots to be posted...'); diff --git a/scripts/snapshot/snapshot.config.js b/scripts/snapshot/snapshot.config.js index 71cefb944c..318efb21e0 100644 --- a/scripts/snapshot/snapshot.config.js +++ b/scripts/snapshot/snapshot.config.js @@ -9,7 +9,7 @@ exports.config = { //domain: 'localhost:8080', specs: 'dist/e2e/**/*e2e.js', - //specs: 'dist/e2e/action-menu/**/*e2e.js', + //specs: 'dist/e2e/nav/basic/*e2e.js', sleepBetweenSpecs: 1200, diff --git a/scripts/snapshot/snapshot.task.js b/scripts/snapshot/snapshot.task.js index 22490d0d31..40247037d6 100644 --- a/scripts/snapshot/snapshot.task.js +++ b/scripts/snapshot/snapshot.task.js @@ -21,12 +21,18 @@ module.exports = function(gulp, argv, buildConfig) { }); gulp.task('snapshot', ['clean.build', 'protractor-server'], function(done) { - var protractorConfigFile = path.resolve(projectRoot, 'scripts/snapshot/protractor.config.js'); - snapshot(done, protractorConfigFile); + snapshot(done); }); - function snapshot(done, protractorConfigFile) { + gulp.task('snapshot-quick', ['e2e', 'protractor-server'], function(done) { + snapshot(done, true); + }); + + function snapshot(done, quickMode) { + var protractorConfigFile = path.resolve(projectRoot, 'scripts/snapshot/protractor.config.js'); + snapshotValues.params.test_id = uuid.v4().split('-')[0]; + snapshotValues.params.upload = !quickMode; var protractorArgs = [ '--browser <%= browser %>', @@ -37,11 +43,14 @@ module.exports = function(gulp, argv, buildConfig) { '--params.width=<%= params.width %>', '--params.height=<%= params.height %>', '--params.test_id=<%= params.test_id %>', + '--params.upload=<%= params.upload %>', ].map(function(argument) { return _.template(argument, snapshotValues); }); - e2ePublish(snapshotValues.params.test_id); + if (!quickMode) { + e2ePublish(snapshotValues.params.test_id); + } return protractor(done, [protractorConfigFile].concat(protractorArgs)); } @@ -65,6 +74,7 @@ module.exports = function(gulp, argv, buildConfig) { } function e2ePublish(testId) { + console.log('e2ePublish: ' + testId); snapshotConfig.testId = testId; require('../e2e/e2e-publish')(snapshotConfig); }