Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add appium support #4

Closed
4 tasks
samhatoum opened this issue Jul 21, 2018 · 19 comments
Closed
4 tasks

Add appium support #4

samhatoum opened this issue Jul 21, 2018 · 19 comments
Labels
enhancement New feature or request

Comments

@samhatoum
Copy link
Contributor

Issue by samhatoum
Saturday Jul 11, 2015 at 21:28 GMT
Originally opened as xolvio/chimp#33


Just like Selenium but Appium

  • Should auto download Appium
  • Should auto download Android simulator (or intelligently give instructions to in console like Meteor)
  • Should auto download iOS simulator (or intelligently give instructions to in console like Meteor)
  • Should run Appium and connect cucumberjs + webdriver to it

Also see if calaba.sh can be used here

@samhatoum samhatoum added the enhancement New feature or request label Jul 21, 2018
@samhatoum
Copy link
Contributor Author

Comment by mario-ortiz
Wednesday Dec 23, 2015 at 21:54 GMT


This integration would be great. Are there any news about this?

@samhatoum
Copy link
Contributor Author

Comment by samhatoum
Wednesday Dec 23, 2015 at 23:28 GMT


If you start all the tools manually, you can connect chimp to appium using --host

This is a lot of work for us to do right now, maybe a PR though :)

@samhatoum
Copy link
Contributor Author

Comment by mario-ortiz
Tuesday Dec 29, 2015 at 22:19 GMT


thank you Sam

@samhatoum
Copy link
Contributor Author

Comment by DutchRican
Wednesday Jan 27, 2016 at 17:25 GMT


Does anyone have a working example for this?
Only specifying the host is throwing an error that the deviceName and platformName are missing. I tried to specify those over the appium CLI, but this is not working for me.

Setting these values in the CLI for Chimp is resulting in an error:
setupBrowserAndDDP -- TypeError: Cannot read property 'toLowerCase' of undefined

@samhatoum
Copy link
Contributor Author

Comment by mario-ortiz
Wednesday Jan 27, 2016 at 17:30 GMT


I actually had to make some changes to the chimp_helper.js file, but it's working great after that. Not sure if the best solution tho.

Go to node_modules\chimp\lib and open chimp_helper.js
Then, after line 110 I added this code
if (process.env['chimp.platform'] === 'Android' ||
process.env['chimp.platform'] === 'IOS') {
webdriverOptions.desiredCapabilities.platformName = webdriverOptions.desiredCapabilities.platform;
webdriverOptions.desiredCapabilities.deviceName = webdriverOptions.desiredCapabilities.name;
}
And after that I could integrate with appium perfectly.

@samhatoum
Copy link
Contributor Author

Comment by DutchRican
Wednesday Jan 27, 2016 at 19:41 GMT


Thank you Mario!

The line count is not accurate any more. Right above the log output what the webdriveroptions are should be fine.

I had to modify your suggestion to this:
if (process.env['chimp.platform']) { webdriverOptions.desiredCapabilities.platformName = webdriverOptions.desiredCapabilities.platform; webdriverOptions.desiredCapabilities.deviceName = process.env['chimp.deviceName']; }

@samhatoum
Copy link
Contributor Author

Comment by the-boletus
Tuesday Feb 16, 2016 at 15:28 GMT


Modifying the existing code does not feel right though. :) Well, it makes the deployment procedure difficult. But there is a piece of code in the same chimp_helper.js saying about "customChimpConfigPath":

if (fs.existsSync(customChimpConfigPath)) {
    var customChimpConfigurator = wrapAsync(require(customChimpConfigPath));
    global.browser = customChimpConfigurator(global.sessionManager);
    ...

I haven't found any information about the config file. What's the config's structure and could we use it for setting desired capabilities?

@samhatoum
Copy link
Contributor Author

Comment by Sanjo
Tuesday Feb 16, 2016 at 15:39 GMT


@the-boletus Yes, I think that was the purpose of the customChimpConfigPath option. To start with the file would roughly contain:

module.exports = function (sessionManager) {
  // Modified version of: https://github.com/xolvio/chimp/blob/master/src/lib/chimp-helper.js#L95-L136
};

@samhatoum
Copy link
Contributor Author

Comment by mario-ortiz
Friday Feb 19, 2016 at 22:34 GMT


Thank you @sanjo, one quick question. I already copied the lines that you mentioned to my new chimp.js file, but I'm not sure what should I return from this file for the platform to work. I tried returning the 'return remoteSession(webdriverOptions)', but doesn't seem to work. Unless I change the chimp-helper line from this

var customChimpConfigurator = wrapAsync(require(customChimpConfigPath));
global.browser = customChimpConfigurator(global.sessionManager);

to this

var customChimpConfigurator = require(customChimpConfigPath);
global.browser = customChimpConfigurator(global.sessionManager);
(this one works like a charm, but again I had to change the chimp-helper.js file).

So it seems I need to return it in a specific way, but I haven't been able to found the right way to do it.

@samhatoum
Copy link
Contributor Author

Comment by Sanjo
Friday Feb 19, 2016 at 23:16 GMT


Oh the expected custom function must be a function with a callback. The correct signature is:

module.exports = function (sessionManager, callback) {
  // Modified version of: https://github.com/xolvio/chimp/blob/master/src/lib/chimp-helper.js#L95-L136
  var remoteSession = wrapAsync(sessionManager.remote, sessionManager);
  callback(null, remoteSession(webdriverOptions))
};

Maybe we can change this to a sync style function before 1.0. (And add the documentation).

@samhatoum
Copy link
Contributor Author

Comment by mario-ortiz
Monday Feb 22, 2016 at 19:41 GMT


Thank you @sanjo, working great now. I just changed
callback(remoteSession(webdriverOptions))
for
callback(null, remoteSession(webdriverOptions))
Thank you very much.

@samhatoum
Copy link
Contributor Author

Comment by Sanjo
Thursday Feb 25, 2016 at 20:07 GMT


I have added a documentation page for the custom WebDriver configuring.

@samhatoum
Copy link
Contributor Author

Comment by andyhite
Friday Mar 18, 2016 at 23:34 GMT


Unless I'm totally misunderstanding this, the custom webdriver stuff doesn't seem to work for me. The --customChimpConfigPath CLI option does nothing - there doesn't even appear to be anything in the chimp bin file for it.

@samhatoum
Copy link
Contributor Author

Comment by samhatoum
Friday Mar 18, 2016 at 23:44 GMT


I think you might be right. Looking here:
https://github.com/xolvio/chimp/blob/master/dist/lib/chimp-helper.js#L76

It looks like that's the variable name and not the option name. Tracking bug here:
xolvio/chimp#310

@samhatoum
Copy link
Contributor Author

Comment by andyhite
Friday Mar 18, 2016 at 23:47 GMT


Good to know I'm not going crazy :-P

I was able to get around this by just dropping the file with the callback into features/chimp.js, so it's not a huge issue for now.

@samhatoum
Copy link
Contributor Author

Comment by gbhatnag
Thursday Mar 24, 2016 at 20:34 GMT


Will adding the custom WebDriver config alone add support for Appium? I don't see options related to Appium or mobile testing available in the WebDriver config docs. I'm new to the Chimp / Appium worlds and need a way to test Cordova mobile apps that we've created for a Meteor app. I've got Chimp set up, connected to my Meteor app and can run tests against the server. I'm now interested in testing the web.cordova UI (on iOS and Android) and all the Appium mobile APIs available through WebDriver here look like just what I need.

Could someone point me in the right direction (docs, tutorials, videos, other) to get this combo of Meteor + Chimp + Appium set up?

@samhatoum
Copy link
Contributor Author

Comment by gbhatnag
Thursday Mar 24, 2016 at 21:37 GMT


I should add: we don't need to test directly on an iOS or Android device just yet. Simulators are just fine.

@samhatoum
Copy link
Contributor Author

Comment by gbhatnag
Tuesday Mar 29, 2016 at 21:43 GMT


Any suggestions here? Using Chimp thus far is going well and looking forward to testing our Cordova apps.

@samhatoum
Copy link
Contributor Author

Comment by PierreCBSI
Thursday Apr 21, 2016 at 23:00 GMT


running Chimp on my desktop, would like to see more details about connecting with Appium - maybe an official page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant