-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Syntax reboot #156
Comments
Exposing WebElement finders on the protractor instance like so would be nice. Also, in this happy future mocha/chai is supported. describe('api/ng.$http', function() {
beforeEach(function() {
client.get('index-jq-nocache.html#!/api/ng.$http');
});
it('should make a JSONP request to angularjs.org', function() {
client.find.css(':button:contains("Sample JSONP")').click();
client.find.css(':button:contains("fetch")')).click();
client.find.binding('status').text().should.eventually.eql('200');
client.find.binding('data').text().should.eventually.match(/Super Hero!/);
});
}); |
Here's the design for this, based on the following goals:
Protractor will expose a limited set of global variables
Protractor will expose a new type: enhanced element locators. This will be available via the element function.
This element locator can either be used directly
or it can be used via one of the methods that enhanced element locators expose - these generally correspond to actions taken over the webdriver wire protocol.
Some helper functions will be added, such as a count() function for repeaters.
in that case, A Page Object DSL could be created like this:
Tests would look like:
The underlying webdriver instance can be accessed with
A complicated action, e.g. something with an action sequence, would look like:
Sending a global key press would look like:
|
Need a shorter syntax for finding elements, and a migration path from angular scenario tests.
Consider something like:
The text was updated successfully, but these errors were encountered: