Skip to content

Commit 63e8952

Browse files
committed
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.
1 parent c90cefe commit 63e8952

File tree

10 files changed

+55
-38
lines changed

10 files changed

+55
-38
lines changed

docs/content/guide/expression.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ You can try evaluating different expressions here:
8282
<file name="protractor.js" type="protractor">
8383
it('should allow user expression testing', function() {
8484
element(by.css('.expressions button')).click();
85-
var lis = element(by.css('.expressions ul')).element.all(by.repeater('expr in exprs'));
85+
var lis = element(by.css('.expressions ul')).all(by.repeater('expr in exprs'));
8686
expect(lis.count()).toBe(1);
8787
expect(lis.get(0).getText()).toEqual('[ X ] 3*10|currency => $30.00');
8888
});

npm-shrinkwrap.json

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"karma-sauce-launcher": "0.2.0",
3434
"karma-script-launcher": "0.1.0",
3535
"karma-browserstack-launcher": "0.0.7",
36-
"protractor": "~0.23.1",
36+
"protractor": "1.0.0-rc2",
3737
"yaml-js": "~0.0.8",
3838
"rewire": "1.1.3",
3939
"promises-aplus-tests": "~1.3.2",

protractor-shared-conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exports.config = {
2222
},
2323

2424
jasmineNodeOpts: {
25-
defaultTimeoutInterval: 30000
25+
defaultTimeoutInterval: 60000,
26+
showTiming: true
2627
}
2728
};

src/ng/directive/ngController.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,29 @@
103103
* <file name="protractor.js" type="protractor">
104104
* it('should check controller as', function() {
105105
* var container = element(by.id('ctrl-as-exmpl'));
106-
* expect(container.findElement(by.model('settings.name'))
106+
* expect(container.element(by.model('settings.name'))
107107
* .getAttribute('value')).toBe('John Smith');
108108
*
109109
* var firstRepeat =
110-
* container.findElement(by.repeater('contact in settings.contacts').row(0));
110+
* container.element(by.repeater('contact in settings.contacts').row(0));
111111
* var secondRepeat =
112-
* container.findElement(by.repeater('contact in settings.contacts').row(1));
112+
* container.element(by.repeater('contact in settings.contacts').row(1));
113113
*
114-
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
114+
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
115115
* .toBe('408 555 1212');
116116
*
117-
* expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
117+
* expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
118118
* .toBe('john.smith@example.org');
119119
*
120-
* firstRepeat.findElement(by.linkText('clear')).click();
120+
* firstRepeat.element(by.linkText('clear')).click();
121121
*
122-
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
122+
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
123123
* .toBe('');
124124
*
125-
* container.findElement(by.linkText('add')).click();
125+
* container.element(by.linkText('add')).click();
126126
*
127-
* expect(container.findElement(by.repeater('contact in settings.contacts').row(2))
128-
* .findElement(by.model('contact.value'))
127+
* expect(container.element(by.repeater('contact in settings.contacts').row(2))
128+
* .element(by.model('contact.value'))
129129
* .getAttribute('value'))
130130
* .toBe('[email protected]');
131131
* });
@@ -184,28 +184,28 @@
184184
* it('should check controller', function() {
185185
* var container = element(by.id('ctrl-exmpl'));
186186
*
187-
* expect(container.findElement(by.model('name'))
187+
* expect(container.element(by.model('name'))
188188
* .getAttribute('value')).toBe('John Smith');
189189
*
190190
* var firstRepeat =
191-
* container.findElement(by.repeater('contact in contacts').row(0));
191+
* container.element(by.repeater('contact in contacts').row(0));
192192
* var secondRepeat =
193-
* container.findElement(by.repeater('contact in contacts').row(1));
193+
* container.element(by.repeater('contact in contacts').row(1));
194194
*
195-
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
195+
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
196196
* .toBe('408 555 1212');
197-
* expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
197+
* expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
198198
* .toBe('john.smith@example.org');
199199
*
200-
* firstRepeat.findElement(by.linkText('clear')).click();
200+
* firstRepeat.element(by.linkText('clear')).click();
201201
*
202-
* expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
202+
* expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
203203
* .toBe('');
204204
*
205-
* container.findElement(by.linkText('add')).click();
205+
* container.element(by.linkText('add')).click();
206206
*
207-
* expect(container.findElement(by.repeater('contact in contacts').row(2))
208-
* .findElement(by.model('contact.value'))
207+
* expect(container.element(by.repeater('contact in contacts').row(2))
208+
* .element(by.model('contact.value'))
209209
* .getAttribute('value'))
210210
* .toBe('[email protected]');
211211
* });

src/ng/directive/ngEventDirs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ forEach(
339339
expect(element(by.binding('list')).getText()).toBe('list=[]');
340340
element(by.css('#submit')).click();
341341
expect(element(by.binding('list')).getText()).toContain('hello');
342-
expect(element(by.input('text')).getAttribute('value')).toBe('');
342+
expect(element(by.model('text')).getAttribute('value')).toBe('');
343343
});
344344
it('should ignore empty strings', function() {
345345
expect(element(by.binding('list')).getText()).toBe('list=[]');

src/ng/directive/ngInclude.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
return;
126126
}
127127
templateSelect.click();
128-
templateSelect.element.all(by.css('option')).get(2).click();
128+
templateSelect.all(by.css('option')).get(2).click();
129129
expect(includeElem.getText()).toMatch(/Content of template2.html/);
130130
});
131131
@@ -135,7 +135,7 @@
135135
return;
136136
}
137137
templateSelect.click();
138-
templateSelect.element.all(by.css('option')).get(0).click();
138+
templateSelect.all(by.css('option')).get(0).click();
139139
expect(includeElem.isPresent()).toBe(false);
140140
});
141141
</file>

src/ng/directive/ngSwitch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@
117117
expect(switchElem.getText()).toMatch(/Settings Div/);
118118
});
119119
it('should change to home', function() {
120-
select.element.all(by.css('option')).get(1).click();
120+
select.all(by.css('option')).get(1).click();
121121
expect(switchElem.getText()).toMatch(/Home Span/);
122122
});
123123
it('should select default', function() {
124-
select.element.all(by.css('option')).get(2).click();
124+
select.all(by.css('option')).get(2).click();
125125
expect(switchElem.getText()).toMatch(/default/);
126126
});
127127
</file>

src/ng/directive/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var ngOptionsMinErr = minErr('ngOptions');
123123
<file name="protractor.js" type="protractor">
124124
it('should check ng-options', function() {
125125
expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');
126-
element.all(by.select('myColor')).first().click();
126+
element.all(by.model('myColor')).first().click();
127127
element.all(by.css('select[ng-model="myColor"] option')).first().click();
128128
expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');
129129
element(by.css('.nullable select[ng-model="myColor"]')).click();

test/e2e/docsAppE2E.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('docs.angularjs.org', function () {
66
// browser.get();
77
// browser.waitForAngular();
88

9-
// var search = element(by.input('q'));
9+
// var search = element(by.model('q'));
1010
// search.clear();
1111
// search.sendKeys('ngBind');
1212

@@ -34,7 +34,7 @@ describe('docs.angularjs.org', function () {
3434

3535
browser.switchTo().frame('example-input-directive');
3636

37-
var nameInput = element(by.input('user.name'));
37+
var nameInput = element(by.model('user.name'));
3838
nameInput.sendKeys('!!!');
3939

4040
var code = element(by.css('tt'));

0 commit comments

Comments
 (0)