mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-06 22:35:22 +08:00
dgeni-packages 0.10.0-rc.5 has a fix for this problem, so this commit updates to that version. Adds a new e2e test to prove this is fixed. Closes #8963
51 lines
1.8 KiB
JavaScript
51 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
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');
|
|
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+/);
|
|
});
|
|
|
|
it('should change the page content when clicking a link to a service', function () {
|
|
browser.get('');
|
|
|
|
var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]'));
|
|
ngBindLink.click();
|
|
|
|
var pageBody = element(by.css('h1'));
|
|
expect(pageBody.getText()).toEqual('ngClick');
|
|
});
|
|
|
|
|
|
it('should show the functioning input directive example', function () {
|
|
browser.get('index-debug.html#!/api/ng/directive/input');
|
|
|
|
// Ensure that the page is loaded before trying to switch frames.
|
|
browser.waitForAngular();
|
|
|
|
browser.switchTo().frame('example-input-directive');
|
|
|
|
var nameInput = element(by.model('user.name'));
|
|
nameInput.sendKeys('!!!');
|
|
|
|
var code = element.all(by.css('tt')).first();
|
|
expect(code.getText()).toContain('guest!!!');
|
|
});
|
|
|
|
it("should trim indentation from code blocks", function() {
|
|
browser.get('index-debug.html#!/api/ng/type/$rootScope.Scope');
|
|
|
|
var codeBlocks = element.all(by.css('pre > code.lang-js'));
|
|
codeBlocks.each(function(codeBlock) {
|
|
var firstSpan = codeBlock.all(by.css('span')).first();
|
|
expect(firstSpan.getText()).not.toMatch(/^\W+$/);
|
|
});
|
|
});
|
|
});
|
|
}); |