-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(protractor/runner): allow multiple browser in test #1548
Conversation
CLAs look good, thanks! |
fyi: the test is failing because I added a new 'interaction' link in the header. #1546 removes the test's dependency on the header (which can often change), and will fix the tests. |
As a minor modification to this to mitigate the concerns about confusing browser instances I raised in #1537, could we consider making the indices strings instead of numbers? This code reads much better than the 0-indexed equivalent necessary given the current patch. // ...
it('should receive email subscriptions', function(done) {
browser.switchTo('inbox');
browser.get('apps/email.html#/' + email());
browser.switchTo('compose');
browser.get('apps/email.html#/' + email() + '/compose');
element(by.model('email.to')).sendKeys(email());
element(by.id('sendEmail')).click();
browser.switchTo('inbox');
setTimeout(function() {
expect(element.all(by.repeater('email in emails')).count()).toBe(1);
done();
}, 1000);
});
// ... Also, could it be an idea to have all tests reset to |
Maybe this could be done by allowing browser.name(0, 'inbox');
// now browser.switchTo(0) is equivalent to browser.switchTo('inbox') |
@jonhoo I'm going to try a different approach that you may find easier to work with. I'll have an update soon. |
c45aa59
to
1d3e760
Compare
ok, this is kind of similar to your (@jonhoo) approach. But instead of passing runner into protractor, I added another global that allows the test to dynamically create multiple instances of protractor. The name of the global is up for discussion though (@juliemr ?). It's currently called |
1d26006
to
27a0d51
Compare
27a0d51
to
79ae1fa
Compare
Ah, yes, that seems a much better way of doing it. The only comments I have are:
|
I'd be fine with something like |
take 3:
There are some issues with automatically going to the current browser's url.
Instead |
Sure, that makes sense. |
@@ -37,6 +37,6 @@ DriverProvider.prototype.updateJob | |||
Requirements | |||
------------ | |||
|
|||
- `setupEnv` and `getDriver` will be called before the test framework is loaded, so any pre-work which might cause timeouts on the first test should be done there. | |||
- `setupEnv` and `getNewDriver` will be called before the test framework is loaded, so any pre-work which might cause timeouts on the first test should be done there. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note that getNewDriver
may be called in the middle of a test.
Added some nits, but overall looks good! Example is super thorough and useful. |
Added some comments on the comments. |
Hi, I was just looking for exactly this end 2 end feature and now i see that you are already done. Do you have an estimation when it should be part of the protractor package? can i just merge it as it is locally? I am an angular/protractor newbie so sorry if my questions are out of place. Thanks! |
283f749
to
fc7cc0a
Compare
Addressed all comments |
fc7cc0a
to
5284615
Compare
merged with 0bbfd2b |
continuation of #1537