Appium tests / setup

appium
#1

Hi all,
I want to run appium tests for UI testing. This framework requires to run an appium server on the same machine to run the tests. How can I do that with bitrise?

1 Like

APPIUM integration with bitrise
Appium tests with Virtual Device Testing
CI with Appium Automation Testing
How to integrate Appium(Maven) tests with Bitrise?
Appium Setup
#2

Hi @alexander.savonin,

The same way you would run it in your Terminal / Command Line. You can use a Script step to install and use any tool if there’s something you can’t find a ready made build step for.

Related docs: http://devcenter.bitrise.io/tips-and-tricks/install-additional-tools/

If you have any questions just let us know! :wink:

0 Likes

#3

Thank you! I’ll try it.

1 Like

#4

SOLUTION: Create a script step with the following code

#!/bin/bash
set -ex
npm install -g appium
appium &>/dev/null &

It will launch an appium server in the background and hide an output.
Maybe it will be helpful for someone.

1 Like

#5

It definitely will! Thank you @alexander.savonin! :blush:

0 Likes

#6

I would like more information as where I would put my java classes, as I currently run through intellij. Also, how would I be able to get the results and affect my bitrise build, so if the tests fails, the build will fail also.

0 Likes

#7

Just follow the official Appium docs (http://appium.io/getting-started.html?lang=en). As mentioned above:


I’d suggest you to use the Deploy to Bitrise.io step for that: http://devcenter.bitrise.io/tips-and-tricks/attach-any-file-to-build/


Make sure your command/script returns a non zero exit code and the Bitrise CLI will mark the step as failed. If you use a Script step this is as simple as starting the Script with:

#!/bin/bash
set -ex

This will print the commands before execution for debugging (-x flag) and the script/bash will return a non zero exit code if any command after the set -ex line fails (-e flag).

If you have any questions just let us know! :slight_smile:

0 Likes

#8

One more thing @plin, I’d suggest you to check these guides so that you can run the configuration locally on your Mac/Linux:

and debug it if needed:

0 Likes

#9

Thanks for the information viktor, I have gone very far with the resources you gave me. Everything works locally, the only thing that doesn’t work is when I run my maven tests and try to connect to the appium server opened through “#!/bin/bash
set -ex
npm install -g appium
appium &>/dev/null &” . It doesn’t seem like I can connect, even though I have the correct address. I verfied by starting an appium server without muting the logs to see the address created. Which is 0.0.0.0:4723.

Any ideas this is happening? Also any people with working appium on their apps can help me?

0 Likes

#10

@plin can you share a bit more details? The best would be if you could share the link/url of the build, feel free to do that through the onsite chat on bitrise.io, so that we can check the logs of the build & the related build config.

Did you run it with the Bitrise CLI?

0 Likes

#11

Hi,

This script does not work for me and gives this error.

(node:2981) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: EACCES: permission denied, mkdir ‘/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2017730-2981-1xiwuq4.ocj0g’
(node:2981) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info Chromedriver Install Installing Chromedriver version ‘2.28’ for platform ‘linux’ and architecture '64’
info Chromedriver Install Opening temp file to write chromedriver_linux64 to…
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2017730-2981-1450uny.5xwn’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@2.11.2 install: node install-npm.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@2.11.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

0 Likes

#12

@ankitpachouri0891 this seems to be a config issue. Can you please create a #issues:build-issues report, with the full log or a link to the build’s bitrise.io page?

0 Likes

#13

Has same problem with @ankitpachouri0891

0 Likes

#14

Just to connect the discussions, the report & fix can be found here:

Thanks @han.tran! :slight_smile:

1 Like

#15

@ankitpachouri0891 did you manage to solve the issue? If not, can you check this report and fix: Cannot install appium on Android, Ubuntu stack ?

0 Likes

#16

@viktorbenei Will try this and update you soon.

1 Like

#17

@viktorbenei Buddy, its done. Thanks alot for the support. Now, I will be writing my test cases and want those to be used to push the build via bitrise. Will surely get back to you, if I stuck somewhere. :wink:

@han.tran Thanks a ton man! And thank you so much for your efforts :slight_smile:

1 Like

#18

Glad to hear @ankitpachouri0891! :tada: :slight_smile:

0 Likes

#19

Glad to help @ankitpachouri0891 took me a day :slight_smile: By the way, I’m stuck with the android emulator, sometimes when installing the apk, it’s taking forever. @viktorbenei should I open a ticket?

0 Likes

#20

@han.tran yes, please do create a new one, but unfortunately in lots of cases the answer is to use

as the standard emulators are quite buggy…

0 Likes