nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.78k stars 1.31k forks source link

Add context commands #486

Closed 5hai closed 9 years ago

5hai commented 9 years ago

While using Nightwatch and Appium to test hybrid apps on mobile, i needed to add support for "context" command in protocol.js :

// * @jsonWire GET /session/:sessionId/contexts

  Actions.currentContext = function(callback) {
    return getRequest('/contexts', callback);
  };

// * @jsonWire POST /session/:sessionId/context

 Actions.setContext = function(contextRef, callback) {
    var data = { name: contextRef };
    return postRequest('/context', data, callback);
 };

Other nightwatch users need it so i think it would be nice to add this to next Nightwatch version as well as other commands needed for testing mobile apps with Appium (e.g. context, Touch...)

Thanks 5hai

beatfactor commented 9 years ago

Sure, I can add that to the new major release (0.7). I think it would be very helpful to have a small walkthrough on how to setup Nightwatch with Appium and what the challenges would be. Would you mind writing something for the docs website here: https://github.com/nightwatchjs/nightwatch-docs/tree/master/guide or maybe the Wiki: https://github.com/beatfactor/nightwatch/wiki?

5hai commented 9 years ago

Yes i will write a short walkthrough on how to use Nightwatch with Appium Thanks

isao commented 9 years ago

I made a pull request #517 on behalf of Viacheslav Kapustin, for this issue. Thanks for Nightwatch @beatfactor

beatfactor commented 9 years ago

These are now implemented.

HLarul commented 8 years ago

Hi,

Can anyone please share how to setup Nightwatch with Appium?