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

How can attach screenshots of ui test executions with android/start-emulator-and-run-tests command? #54

Closed
skychiarottoa opened this issue Jul 25, 2022 · 8 comments
Assignees

Comments

@skychiarottoa
Copy link

skychiarottoa commented Jul 25, 2022

circleci/android@2.1.2

Before adopting this orb in order to attach screenshoot of our ui tests we run the following commands:
image

Now we cannot run "adb pull" while it is still running since "adb "is started and killed inside the command: start-emulator-and-run-tests command

How can we attach screenshot images to the "CI's Artifacts" tab?
It is possible to add a parameter to start-emulator-and-run-tests ? Something like
adb_pull_destination_folder? I

@skychiarottoa skychiarottoa changed the title How to attach screenshot of ui test exections with android/start-emulator-and-run-tests command How to attach screenshot of ui test executions with android/start-emulator-and-run-tests command Jul 25, 2022
@skychiarottoa skychiarottoa changed the title How to attach screenshot of ui test executions with android/start-emulator-and-run-tests command How can attach screenshots of ui test executions with android/start-emulator-and-run-tests command Jul 25, 2022
@skychiarottoa skychiarottoa changed the title How can attach screenshots of ui test executions with android/start-emulator-and-run-tests command How can attach screenshots of ui test executions with android/start-emulator-and-run-tests command? Jul 25, 2022
@ryanbourdais
Copy link
Contributor

@skychiarottoa Have you tried adding abd pull to the parameter post-emulator-launch-assemble-command? This command will run after the emulator has been launched, and before commencing wait-for-emulator

@ryanbourdais ryanbourdais self-assigned this Jul 26, 2022
@skychiarottoa
Copy link
Author

skychiarottoa commented Jul 27, 2022

I will try, but the command should be run after ui tests are run. "adb pull" allows to copy "screen shots images" generated by the execution of tests.
This parameter "post-emulator-launch-assemble-command" can be used with "start-emulator-and-run-tests" command too or I have to use "run-ui-tests" command?

@skychiarottoa
Copy link
Author

skychiarottoa commented Jul 27, 2022

It doesn't work, this is the output:
image

and here the execution of the command in config.yml
image

@ryanbourdais
Copy link
Contributor

Hi @skychiarottoa, can you try splitting up start-emulator-and-run-tests ? All of the commands are in the orb, but you can run create-avd followed by start-emulator then run-tests, this will allow you to run any steps after run-tests that you please. The emulator will continue to run in background until kill-emulators is run.

@skychiarottoa
Copy link
Author

skychiarottoa commented Aug 1, 2022

Ok, I wanted to avoid this solution since it seem to me in contrast with the usefulness/goal of the orb. it allows me to keep config.yml as simple as possible.
It could be useful to add a parameter "adb_pull_destination_folder" to your command.
"adb pull" can be run inside you command start-emulator-and-run-tests only if the parameter "adb_pull_destination_folder" is set.

It very usefull and common to see app's screen shot attachments when a test fails.

Il will try your solution

thx

@JalexChen
Copy link
Contributor

hi @skychiarottoa - were you able to get this working with @ryanbourdais suggestion? would love to hear back and include the pull destination folder parameter if this is the case

@skychiarottoa
Copy link
Author

yes it works

@JalexChen
Copy link
Contributor

Thanks for the update @skychiarottoa. Closing this issue out and creating a new one to add a pull destination folder parameter

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

No branches or pull requests

3 participants