From 5fa54a92bcae2487206fdd795cee055fdf031af0 Mon Sep 17 00:00:00 2001 From: Hank Duan Date: Mon, 1 Jun 2015 16:17:28 -0700 Subject: [PATCH] chore(benchpress): add ff extension test to ci Closes #2229 --- .../benchpress/test/firefox_extension/conf.ts | 2 -- .../benchpress/test/firefox_extension/spec.ts | 16 ++++++---------- scripts/ci/test_e2e_js.sh | 2 ++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/benchpress/test/firefox_extension/conf.ts b/modules/benchpress/test/firefox_extension/conf.ts index d267fe4c30..d53cab1737 100644 --- a/modules/benchpress/test/firefox_extension/conf.ts +++ b/modules/benchpress/test/firefox_extension/conf.ts @@ -5,8 +5,6 @@ var testHelper = require('../../src/firefox_extension/lib/test_helper.js'); var PROFILE_SAVE_PATH = './perfProfile.json'; exports.config = { - seleniumAddress: 'http://127.0.0.1:4444/wd/hub', - specs: ['spec.js'], getMultiCapabilities: function() { return testHelper.getFirefoxProfileWithExtension(); }, diff --git a/modules/benchpress/test/firefox_extension/spec.ts b/modules/benchpress/test/firefox_extension/spec.ts index c817880c87..921a810753 100644 --- a/modules/benchpress/test/firefox_extension/spec.ts +++ b/modules/benchpress/test/firefox_extension/spec.ts @@ -7,9 +7,9 @@ var fs = require('fs'); var validateFile = function() { try { var content = fs.readFileSync(browser.params.profileSavePath, 'utf8'); - // TODO(hankduan): This check not very useful. Ideally we want to validate - // that the file contains all the events that we are looking for. Pending - // on data transformer. + // TODO(hankduan): This check is not very useful. Ideally we want to + // validate that the file contains all the events that we are looking for. + // Pending on data transformer. expect(content).toContain('forceGC'); // Delete file fs.unlinkSync(browser.params.profileSavePath); @@ -25,22 +25,18 @@ var validateFile = function() { }; describe('firefox extension', function() { + var TEST_URL = 'http://localhost:8001/examples/src/hello_world/index.html'; + it('should measure performance', function() { browser.sleep(3000); // wait for extension to load - browser.driver.get('http://www.angularjs.org'); + browser.driver.get(TEST_URL); browser.executeScript('window.startProfiler()') .then(function() { console.log('started measuring perf'); }); browser.executeScript('window.forceGC()'); - // Run some commands - element(by.model('yourName')).sendKeys('Hank'); - expect(element(by.binding('yourName')).getText()).toEqual('Hello Hank!'); - - browser.executeScript('window.forceGC()'); - var script = 'window.stopAndRecord("' + browser.params.profileSavePath + '")'; browser.executeScript(script).then(function() { console.log('stopped measuring perf'); }); diff --git a/scripts/ci/test_e2e_js.sh b/scripts/ci/test_e2e_js.sh index 222295e07a..ba0f3b8a70 100755 --- a/scripts/ci/test_e2e_js.sh +++ b/scripts/ci/test_e2e_js.sh @@ -30,3 +30,5 @@ fi ./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS ./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS --benchmark --dryrun +./node_modules/.bin/protractor dist/js/cjs/benchpress/test/firefox_extension/conf.js +