From a68b3fb4450b68fc478301b12517139f33256e7f Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 19 Oct 2014 10:28:03 +0100 Subject: [PATCH 1/2] chore(docs): configure the base path for protractor tests in examples Updates to dgeni-packages 0.10.5 which supports this configurability. Change the dgeni config and protractor config so that we can have protractor tests that are hosted outside the build/docs folder. Provides support for https://github.com/angular/angular.js/pull/9557#discussion_r18977324 --- docs/config/index.js | 2 ++ npm-shrinkwrap.json | 2 +- protractor-shared-conf.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/config/index.js b/docs/config/index.js index 148fdc8de679..826ba11f59ad 100644 --- a/docs/config/index.js +++ b/docs/config/index.js @@ -157,6 +157,8 @@ module.exports = new Package('angularjs', [ jqueryDeployment ]; + generateProtractorTestsProcessor.basePath = 'build/docs/'; + generateExamplesProcessor.deployments = [ debugDeployment, defaultDeployment, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2c9c9f49cd01..b2c0d12b89a3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1329,7 +1329,7 @@ } }, "dgeni-packages": { - "version": "0.10.3", + "version": "0.10.5", "dependencies": { "catharsis": { "version": "0.7.1" diff --git a/protractor-shared-conf.js b/protractor-shared-conf.js index 7bcb0264412f..917040f2134c 100644 --- a/protractor-shared-conf.js +++ b/protractor-shared-conf.js @@ -3,7 +3,7 @@ exports.config = { allScriptsTimeout: 11000, - baseUrl: 'http://localhost:8000/build/docs/', + baseUrl: 'http://localhost:8000/', framework: 'jasmine', From c249726016a6ffebc07b28fbd0d4646e5d3f5c6b Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 19 Oct 2014 10:28:52 +0100 Subject: [PATCH 2/2] chore(docs): fix path to docs-app e2e tests These tests are not generated by dgeni and so needed to have the paths to the pages updated manually. --- docs/app/e2e/api-docs/api-pages.scenario.js | 10 +++++----- docs/app/e2e/api-docs/provider-pages.scenario.js | 2 +- docs/app/e2e/api-docs/service-pages.scenario.js | 6 +++--- docs/app/e2e/app.scenario.js | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/app/e2e/api-docs/api-pages.scenario.js b/docs/app/e2e/api-docs/api-pages.scenario.js index 2695971ca483..5c026bfa4feb 100644 --- a/docs/app/e2e/api-docs/api-pages.scenario.js +++ b/docs/app/e2e/api-docs/api-pages.scenario.js @@ -5,15 +5,15 @@ describe("doc.angularjs.org", function() { describe("API pages", function() { it("should display links to code on GitHub", function() { - browser.get('index-debug.html#!/api/ng/service/$http'); + browser.get('build/docs/index.html#!/api/ng/service/$http'); expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/); - browser.get('index-debug.html#!/api/ng/service/$http'); + browser.get('build/docs/index.html#!/api/ng/service/$http'); expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/); }); it('should change the page content when clicking a link to a service', function () { - browser.get(''); + browser.get('build/docs/index.html'); var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]')); ngBindLink.click(); @@ -24,7 +24,7 @@ describe("doc.angularjs.org", function() { it('should show the functioning input directive example', function () { - browser.get('index-debug.html#!/api/ng/directive/input'); + browser.get('build/docs/index.html#!/api/ng/directive/input'); // Ensure that the page is loaded before trying to switch frames. browser.waitForAngular(); @@ -39,7 +39,7 @@ describe("doc.angularjs.org", function() { }); it("should trim indentation from code blocks", function() { - browser.get('index-debug.html#!/api/ng/type/$rootScope.Scope'); + browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope'); var codeBlocks = element.all(by.css('pre > code.lang-js')); codeBlocks.each(function(codeBlock) { diff --git a/docs/app/e2e/api-docs/provider-pages.scenario.js b/docs/app/e2e/api-docs/provider-pages.scenario.js index 24d6bfdef8b9..5b9094c019e1 100644 --- a/docs/app/e2e/api-docs/provider-pages.scenario.js +++ b/docs/app/e2e/api-docs/provider-pages.scenario.js @@ -3,7 +3,7 @@ describe("provider pages", function() { it("should show the related service", function() { - browser.get('index-debug.html#!/api/ng/provider/$compileProvider'); + browser.get('build/docs/index.html#!/api/ng/provider/$compileProvider'); var serviceLink = element.all(by.css('ol.api-profile-header-structure li a')).first(); expect(serviceLink.getText()).toEqual('- $compile'); expect(serviceLink.getAttribute('href')).toMatch(/api\/ng\/service\/\$compile/); diff --git a/docs/app/e2e/api-docs/service-pages.scenario.js b/docs/app/e2e/api-docs/service-pages.scenario.js index a26dd5ef2755..94d1ac3065c1 100644 --- a/docs/app/e2e/api-docs/service-pages.scenario.js +++ b/docs/app/e2e/api-docs/service-pages.scenario.js @@ -3,19 +3,19 @@ describe("service pages", function() { it("should show the related provider if there is one", function() { - browser.get('index-debug.html#!/api/ng/service/$compile'); + browser.get('build/docs/index.html#!/api/ng/service/$compile'); var providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first(); expect(providerLink.getText()).toEqual('- $compileProvider'); expect(providerLink.getAttribute('href')).toMatch(/api\/ng\/provider\/\$compileProvider/); - browser.get('index-debug.html#!/api/ng/service/$q'); + browser.get('build/docs/index.html#!/api/ng/service/$q'); providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first(); expect(providerLink.getText()).not.toEqual('- $qProvider'); expect(providerLink.getAttribute('href')).not.toMatch(/api\/ng\/provider\/\$compileProvider/); }); it("should show parameter defaults", function() { - browser.get('index-debug.html#!/api/ng/service/$timeout'); + browser.get('build/docs/index.html#!/api/ng/service/$timeout'); expect(element.all(by.css('.input-arguments p em')).first().getText()).toContain('(default: 0)'); }); diff --git a/docs/app/e2e/app.scenario.js b/docs/app/e2e/app.scenario.js index f0cfd71a5d9b..f25d5d8233a5 100644 --- a/docs/app/e2e/app.scenario.js +++ b/docs/app/e2e/app.scenario.js @@ -39,7 +39,7 @@ describe('docs.angularjs.org', function () { it('should change the page content when clicking a link to a service', function () { - browser.get(''); + browser.get('build/docs/index.html'); var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]')); ngBindLink.click(); @@ -51,33 +51,33 @@ describe('docs.angularjs.org', function () { it('should be resilient to trailing slashes', function() { - browser.get('index-debug.html#!/api/ng/function/angular.noop/'); + browser.get('build/docs/index.html#!/api/ng/function/angular.noop/'); var pageBody = element(by.css('h1')); expect(pageBody.getText()).toEqual('angular.noop'); }); it('should be resilient to trailing "index"', function() { - browser.get('index-debug.html#!/api/ng/function/angular.noop/index'); + browser.get('build/docs/index.html#!/api/ng/function/angular.noop/index'); var pageBody = element(by.css('h1')); expect(pageBody.getText()).toEqual('angular.noop'); }); it('should be resilient to trailing "index/"', function() { - browser.get('index-debug.html#!/api/ng/function/angular.noop/index/'); + browser.get('build/docs/index.html#!/api/ng/function/angular.noop/index/'); var pageBody = element(by.css('h1')); expect(pageBody.getText()).toEqual('angular.noop'); }); it('should display formatted error messages on error doc pages', function() { - browser.get('index-debug.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined'); + browser.get('build/docs/index.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined'); expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined"); }); it("should display an error if the page does not exist", function() { - browser.get('index-debug.html#!/api/does/not/exist'); + browser.get('build/docs/index.html#!/api/does/not/exist'); expect(element(by.css('h1')).getText()).toBe('Oops!'); });