mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
chore(e2e): update protractor to 1.0.0-rc2 and add more logging
Use the new options from the reporter to add more logging to end to end tests, and increase the Jasmine test timeout from 30 seconds to 60 seconds to allow for legitimately long-lasting tests.
This commit is contained in:
@@ -82,7 +82,7 @@ You can try evaluating different expressions here:
|
||||
<file name="protractor.js" type="protractor">
|
||||
it('should allow user expression testing', function() {
|
||||
element(by.css('.expressions button')).click();
|
||||
var lis = element(by.css('.expressions ul')).element.all(by.repeater('expr in exprs'));
|
||||
var lis = element(by.css('.expressions ul')).all(by.repeater('expr in exprs'));
|
||||
expect(lis.count()).toBe(1);
|
||||
expect(lis.get(0).getText()).toEqual('[ X ] 3*10|currency => $30.00');
|
||||
});
|
||||
|
||||
30
npm-shrinkwrap.json
generated
30
npm-shrinkwrap.json
generated
@@ -912,7 +912,7 @@
|
||||
},
|
||||
"grunt-jasmine-node": {
|
||||
"version": "0.1.0",
|
||||
"from": "grunt-jasmine-node@git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code",
|
||||
"from": "grunt-jasmine-node@git://github.com/vojtajina/grunt-jasmine-node.git#ced17cbe52c1412b2ada53160432a5b681f37cd7",
|
||||
"resolved": "git://github.com/vojtajina/grunt-jasmine-node.git#ced17cbe52c1412b2ada53160432a5b681f37cd7"
|
||||
},
|
||||
"grunt-jscs-checker": {
|
||||
@@ -2690,7 +2690,7 @@
|
||||
}
|
||||
},
|
||||
"protractor": {
|
||||
"version": "0.23.1",
|
||||
"version": "1.0.0-rc2",
|
||||
"dependencies": {
|
||||
"request": {
|
||||
"version": "2.36.0",
|
||||
@@ -2719,10 +2719,10 @@
|
||||
}
|
||||
},
|
||||
"form-data": {
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.4",
|
||||
"dependencies": {
|
||||
"combined-stream": {
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"dependencies": {
|
||||
"delayed-stream": {
|
||||
"version": "0.0.5"
|
||||
@@ -2730,7 +2730,7 @@
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"version": "0.2.10"
|
||||
"version": "0.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2777,10 +2777,13 @@
|
||||
}
|
||||
},
|
||||
"selenium-webdriver": {
|
||||
"version": "2.41.0"
|
||||
"version": "2.42.1"
|
||||
},
|
||||
"minijasminenode": {
|
||||
"version": "0.4.0"
|
||||
"version": "1.1.1"
|
||||
},
|
||||
"jasminewd": {
|
||||
"version": "1.0.3"
|
||||
},
|
||||
"saucelabs": {
|
||||
"version": "0.1.1"
|
||||
@@ -2820,6 +2823,19 @@
|
||||
},
|
||||
"lodash": {
|
||||
"version": "2.4.1"
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.2.6",
|
||||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.1.32",
|
||||
"dependencies": {
|
||||
"amdefine": {
|
||||
"version": "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"karma-sauce-launcher": "0.2.0",
|
||||
"karma-script-launcher": "0.1.0",
|
||||
"karma-browserstack-launcher": "0.0.7",
|
||||
"protractor": "~0.23.1",
|
||||
"protractor": "1.0.0-rc2",
|
||||
"yaml-js": "~0.0.8",
|
||||
"rewire": "1.1.3",
|
||||
"promises-aplus-tests": "~1.3.2",
|
||||
|
||||
@@ -22,6 +22,7 @@ exports.config = {
|
||||
},
|
||||
|
||||
jasmineNodeOpts: {
|
||||
defaultTimeoutInterval: 30000
|
||||
defaultTimeoutInterval: 60000,
|
||||
showTiming: true
|
||||
}
|
||||
};
|
||||
|
||||
@@ -103,29 +103,29 @@
|
||||
* <file name="protractor.js" type="protractor">
|
||||
* it('should check controller as', function() {
|
||||
* var container = element(by.id('ctrl-as-exmpl'));
|
||||
* expect(container.findElement(by.model('settings.name'))
|
||||
* expect(container.element(by.model('settings.name'))
|
||||
* .getAttribute('value')).toBe('John Smith');
|
||||
*
|
||||
* var firstRepeat =
|
||||
* container.findElement(by.repeater('contact in settings.contacts').row(0));
|
||||
* container.element(by.repeater('contact in settings.contacts').row(0));
|
||||
* var secondRepeat =
|
||||
* container.findElement(by.repeater('contact in settings.contacts').row(1));
|
||||
* container.element(by.repeater('contact in settings.contacts').row(1));
|
||||
*
|
||||
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('408 555 1212');
|
||||
*
|
||||
* expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('john.smith@example.org');
|
||||
*
|
||||
* firstRepeat.findElement(by.linkText('clear')).click();
|
||||
* firstRepeat.element(by.linkText('clear')).click();
|
||||
*
|
||||
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('');
|
||||
*
|
||||
* container.findElement(by.linkText('add')).click();
|
||||
* container.element(by.linkText('add')).click();
|
||||
*
|
||||
* expect(container.findElement(by.repeater('contact in settings.contacts').row(2))
|
||||
* .findElement(by.model('contact.value'))
|
||||
* expect(container.element(by.repeater('contact in settings.contacts').row(2))
|
||||
* .element(by.model('contact.value'))
|
||||
* .getAttribute('value'))
|
||||
* .toBe('yourname@example.org');
|
||||
* });
|
||||
@@ -184,28 +184,28 @@
|
||||
* it('should check controller', function() {
|
||||
* var container = element(by.id('ctrl-exmpl'));
|
||||
*
|
||||
* expect(container.findElement(by.model('name'))
|
||||
* expect(container.element(by.model('name'))
|
||||
* .getAttribute('value')).toBe('John Smith');
|
||||
*
|
||||
* var firstRepeat =
|
||||
* container.findElement(by.repeater('contact in contacts').row(0));
|
||||
* container.element(by.repeater('contact in contacts').row(0));
|
||||
* var secondRepeat =
|
||||
* container.findElement(by.repeater('contact in contacts').row(1));
|
||||
* container.element(by.repeater('contact in contacts').row(1));
|
||||
*
|
||||
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('408 555 1212');
|
||||
* expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('john.smith@example.org');
|
||||
*
|
||||
* firstRepeat.findElement(by.linkText('clear')).click();
|
||||
* firstRepeat.element(by.linkText('clear')).click();
|
||||
*
|
||||
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
|
||||
* .toBe('');
|
||||
*
|
||||
* container.findElement(by.linkText('add')).click();
|
||||
* container.element(by.linkText('add')).click();
|
||||
*
|
||||
* expect(container.findElement(by.repeater('contact in contacts').row(2))
|
||||
* .findElement(by.model('contact.value'))
|
||||
* expect(container.element(by.repeater('contact in contacts').row(2))
|
||||
* .element(by.model('contact.value'))
|
||||
* .getAttribute('value'))
|
||||
* .toBe('yourname@example.org');
|
||||
* });
|
||||
|
||||
@@ -339,7 +339,7 @@ forEach(
|
||||
expect(element(by.binding('list')).getText()).toBe('list=[]');
|
||||
element(by.css('#submit')).click();
|
||||
expect(element(by.binding('list')).getText()).toContain('hello');
|
||||
expect(element(by.input('text')).getAttribute('value')).toBe('');
|
||||
expect(element(by.model('text')).getAttribute('value')).toBe('');
|
||||
});
|
||||
it('should ignore empty strings', function() {
|
||||
expect(element(by.binding('list')).getText()).toBe('list=[]');
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
return;
|
||||
}
|
||||
templateSelect.click();
|
||||
templateSelect.element.all(by.css('option')).get(2).click();
|
||||
templateSelect.all(by.css('option')).get(2).click();
|
||||
expect(includeElem.getText()).toMatch(/Content of template2.html/);
|
||||
});
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
return;
|
||||
}
|
||||
templateSelect.click();
|
||||
templateSelect.element.all(by.css('option')).get(0).click();
|
||||
templateSelect.all(by.css('option')).get(0).click();
|
||||
expect(includeElem.isPresent()).toBe(false);
|
||||
});
|
||||
</file>
|
||||
|
||||
@@ -117,11 +117,11 @@
|
||||
expect(switchElem.getText()).toMatch(/Settings Div/);
|
||||
});
|
||||
it('should change to home', function() {
|
||||
select.element.all(by.css('option')).get(1).click();
|
||||
select.all(by.css('option')).get(1).click();
|
||||
expect(switchElem.getText()).toMatch(/Home Span/);
|
||||
});
|
||||
it('should select default', function() {
|
||||
select.element.all(by.css('option')).get(2).click();
|
||||
select.all(by.css('option')).get(2).click();
|
||||
expect(switchElem.getText()).toMatch(/default/);
|
||||
});
|
||||
</file>
|
||||
|
||||
@@ -123,7 +123,7 @@ var ngOptionsMinErr = minErr('ngOptions');
|
||||
<file name="protractor.js" type="protractor">
|
||||
it('should check ng-options', function() {
|
||||
expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');
|
||||
element.all(by.select('myColor')).first().click();
|
||||
element.all(by.model('myColor')).first().click();
|
||||
element.all(by.css('select[ng-model="myColor"] option')).first().click();
|
||||
expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');
|
||||
element(by.css('.nullable select[ng-model="myColor"]')).click();
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('docs.angularjs.org', function () {
|
||||
// browser.get();
|
||||
// browser.waitForAngular();
|
||||
|
||||
// var search = element(by.input('q'));
|
||||
// var search = element(by.model('q'));
|
||||
// search.clear();
|
||||
// search.sendKeys('ngBind');
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('docs.angularjs.org', function () {
|
||||
|
||||
browser.switchTo().frame('example-input-directive');
|
||||
|
||||
var nameInput = element(by.input('user.name'));
|
||||
var nameInput = element(by.model('user.name'));
|
||||
nameInput.sendKeys('!!!');
|
||||
|
||||
var code = element(by.css('tt'));
|
||||
|
||||
Reference in New Issue
Block a user