Nightwatch: Inconsistent docs for browser vs client

Created on 22 Sep 2016  路  11Comments  路  Source: nightwatchjs/nightwatch

I don't believe that there is any difference between using browser vs client for the asserts, expects, commands but it seems like it would be confusing for newer users to pickup on.

Should be a simple fix and I can open a PR for this.
The only thing I would need to know is which one is preferred between browser and client

stale

Most helpful comment

I see, it doesn't make it easier. I guess we should go with browser then, seem to be used in more places in the examples.

All 11 comments

You would also want to update the other docs over at https://github.com/nightwatchjs/nightwatch-docs

Ah I did not see that repo thank you for pointing that out @senocular

I didn't mean you should close this one. The command API docs is built from the source comments here (example) so you'll still need changes in this repo ;)

Oh ok gotcha, thanks

@senocular Do you know if there is a preference between browser and client, I have been trying to discern it from other references in the documentation but do not want to assume.

@LoganArnett thats a good question. I kind of assumed client is the more up to date variation because it represents a more ambiguous (and therefore more correct) name for the api which potentially works against non-browsers. But I personally like browser because it helps keep a separation between the api and other client properties that exist in nightwatch. Checking out some of the checkins doesn't provide much help; some docs code for v0.9 includes examples using both. Will need to consult the master.

@beatfactor Preferred for documentation: function (browser) {... or function (client) {... ?

related nightwatchjs/nightwatch-docs#51

I don't really have a preference, but I guess if we need to pick one it should be client because there is already the this.client property available for custom commands (that inherit from event emitter). browser sounds a little closer to reality, whereas client is more ambiguous.

@beatfactor so client because there's a this.client in custom commands? - the one that references nightwatch instead of the browser/client object?

To be fair, this.client == browser in test cases. this.client == nightwatch in custom commands and page objects. So there's already some confusion there. And from that, this.client.api == browser so api is another term for the same object (also a direct property from custom commands and page object instances, i.e. this.api).

I see, it doesn't make it easier. I guess we should go with browser then, seem to be used in more places in the examples.

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

Was this page helpful?
0 / 5 - 0 ratings