|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | | -describe('doc.angularjs.org', function() { |
| 3 | +describe('API pages', function() { |
4 | 4 |
|
5 | | - describe('API pages', function() { |
| 5 | + it('should display links to code on GitHub', function() { |
| 6 | + browser.get('build/docs/index.html#!/api/ng/service/$http'); |
| 7 | + expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/); |
6 | 8 |
|
7 | | - it('should display links to code on GitHub', function() { |
8 | | - browser.get('build/docs/index.html#!/api/ng/service/$http'); |
9 | | - expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/); |
10 | | - |
11 | | - browser.get('build/docs/index.html#!/api/ng/service/$http'); |
12 | | - expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/); |
13 | | - }); |
| 9 | + browser.get('build/docs/index.html#!/api/ng/service/$http'); |
| 10 | + expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/); |
| 11 | + }); |
14 | 12 |
|
15 | | - it('should change the page content when clicking a link to a service', function() { |
16 | | - browser.get('build/docs/index.html'); |
| 13 | + it('should change the page content when clicking a link to a service', function() { |
| 14 | + browser.get('build/docs/index.html'); |
17 | 15 |
|
18 | | - var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]')); |
19 | | - ngBindLink.click(); |
| 16 | + var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]')); |
| 17 | + ngBindLink.click(); |
20 | 18 |
|
21 | | - var mainHeader = element(by.css('.main-body h1 ')); |
22 | | - expect(mainHeader.getText()).toEqual('ngClick'); |
23 | | - }); |
| 19 | + var mainHeader = element(by.css('.main-body h1 ')); |
| 20 | + expect(mainHeader.getText()).toEqual('ngClick'); |
| 21 | + }); |
24 | 22 |
|
25 | 23 |
|
26 | | - it('should show the functioning input directive example', function() { |
27 | | - browser.get('build/docs/index.html#!/api/ng/directive/input'); |
| 24 | + it('should show the functioning input directive example', function() { |
| 25 | + browser.get('build/docs/index.html#!/api/ng/directive/input'); |
28 | 26 |
|
29 | | - // Ensure that the page is loaded before trying to switch frames. |
30 | | - browser.waitForAngular(); |
| 27 | + // Ensure that the page is loaded before trying to switch frames. |
| 28 | + browser.waitForAngular(); |
31 | 29 |
|
32 | | - browser.switchTo().frame('example-input-directive'); |
| 30 | + browser.switchTo().frame('example-input-directive'); |
33 | 31 |
|
34 | | - var nameInput = element(by.model('user.name')); |
35 | | - nameInput.sendKeys('!!!'); |
| 32 | + var nameInput = element(by.model('user.name')); |
| 33 | + nameInput.sendKeys('!!!'); |
36 | 34 |
|
37 | | - var code = element.all(by.css('tt')).first(); |
38 | | - expect(code.getText()).toContain('guest!!!'); |
39 | | - }); |
| 35 | + var code = element.all(by.css('tt')).first(); |
| 36 | + expect(code.getText()).toContain('guest!!!'); |
| 37 | + }); |
40 | 38 |
|
41 | | - it('should trim indentation from code blocks', function() { |
42 | | - browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope'); |
| 39 | + it('should trim indentation from code blocks', function() { |
| 40 | + browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope'); |
43 | 41 |
|
44 | | - var codeBlocks = element.all(by.css('pre > code.lang-js')); |
45 | | - codeBlocks.each(function(codeBlock) { |
46 | | - var firstSpan = codeBlock.all(by.css('span')).first(); |
47 | | - expect(firstSpan.getText()).not.toMatch(/^\W+$/); |
48 | | - }); |
| 42 | + var codeBlocks = element.all(by.css('pre > code.lang-js')); |
| 43 | + codeBlocks.each(function(codeBlock) { |
| 44 | + var firstSpan = codeBlock.all(by.css('span')).first(); |
| 45 | + expect(firstSpan.getText()).not.toMatch(/^\W+$/); |
49 | 46 | }); |
50 | 47 | }); |
51 | 48 | }); |
0 commit comments