From cb183433a0a88a0793b180093825c6d131baa9bc Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 12 Aug 2014 16:47:17 +0100 Subject: [PATCH] chore(doc-gen): move e2e tests into docs folder These tests didn't really fit in the test folder as the docs app is mostly a separate entity from the AngularJS codebase. --- {test => docs/app}/e2e/docsAppE2E.js | 10 ++++++++++ protractor-conf.js | 2 +- protractor-jenkins-conf.js | 2 +- scripts/travis/build.sh | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) rename {test => docs/app}/e2e/docsAppE2E.js (82%) diff --git a/test/e2e/docsAppE2E.js b/docs/app/e2e/docsAppE2E.js similarity index 82% rename from test/e2e/docsAppE2E.js rename to docs/app/e2e/docsAppE2E.js index 91d84746e..d8733f7c0 100644 --- a/test/e2e/docsAppE2E.js +++ b/docs/app/e2e/docsAppE2E.js @@ -75,4 +75,14 @@ describe('docs.angularjs.org', function () { expect(element.all(by.css('.input-arguments p em')).first().getText()).toContain('(default: 0)'); }); }); + + describe("API pages", function() { + it("should display links to code on GitHub", function() { + browser.get('index-debug.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'); + expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/); + }); + }); }); diff --git a/protractor-conf.js b/protractor-conf.js index a3c5e9377..d2a204b11 100644 --- a/protractor-conf.js +++ b/protractor-conf.js @@ -4,7 +4,7 @@ var config = require('./protractor-shared-conf').config; config.specs = [ 'build/docs/ptore2e/**/*.js', - 'test/e2e/docsAppE2E.js' + 'docs/app/e2e/docsAppE2E.js' ]; config.capabilities = { diff --git a/protractor-jenkins-conf.js b/protractor-jenkins-conf.js index 8b65a30a9..09d6bc114 100644 --- a/protractor-jenkins-conf.js +++ b/protractor-jenkins-conf.js @@ -5,7 +5,7 @@ exports.config = { specs: [ 'build/docs/ptore2e/**/*.js', - 'test/e2e/docsAppE2E.js' + 'docs/app/e2e/docsAppE2E.js' ], capabilities: { diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index 62817414b..bb29c5cd5 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -14,7 +14,7 @@ elif [ $JOB = "e2e" ]; then if [ $TEST_TARGET = "jquery" ]; then TARGET_SPECS="build/docs/ptore2e/**/*jquery_test.js" elif [ $TEST_TARGET = "doce2e" ]; then - TARGET_SPECS="test/e2e/docsAppE2E.js" + TARGET_SPECS="docs/app/e2e/docsAppE2E.js" fi grunt test:travis-protractor --specs "$TARGET_SPECS" else