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

running screengrab #3

Closed
joreilly opened this issue Dec 12, 2016 · 3 comments
Closed

running screengrab #3

joreilly opened this issue Dec 12, 2016 · 3 comments

Comments

@joreilly
Copy link

joreilly commented Dec 12, 2016

Is it only possible to use gradle_task and shell_task when using this? Would be great for example to be able to run screengrab.

@FisherKK
Copy link
Collaborator

FisherKK commented Dec 12, 2016

Hello,

I have never used screengrab but I've just checked GitRepo of this tool. I will take a closer look at it tomorrow, yet I am quite sure that it should work.

You can start other fastlane lanes with usage of this tool. So for example you could try something like this:

     lane :assemble_apk_and_grab_screenshots do
         gradle(task: "assembleDebug assembleAndroidTest")
         Action.sh("screengrab")
     end

     lane :grab_screenshots do
     	automated_test_emulator_run(
          AVD_setup_path: "fastlane/MyConfigs/AVD_ConfigForScreengrab.json",
          shell_task: "fastlane assemble_apk_and_grab_screenshots"
        )
     end
  1. So assemble_apk_and_grab_screenshots lane builds your .apk and android-test.apk to be ready for screengrab.
  2. You wrap this lane into shell task.
  3. Plugin will start AVDs according to your JSON config. Wait for AVD to fully launch. And then run fastlane assemble_apk_and_grab_screenshots.
  4. Your AVDs will simply wait for *.apks to be built and then screengrab will launch. It should use currently available devices - AVDs which were launched by plugin and wait for shell task to finish.
  5. After shell task finishes it's job AVDs are killed and deleted.

@joreilly
Copy link
Author

joreilly commented Dec 12, 2016

Thanks @FisherKK for the quick response! Will try that out. BTW am using screengrab from fastlane (such as below)....but same approach will work of course.

    lane :screenshots do |options|
        gradle(task: 'clean')
        gradle(
              task: "assembleDebug assembleDebugAndroidTest",
              properties: {
               ....
              }
        )

        screengrab(
            locales: ['en-US'],
            clear_previous_screenshots: true,
            app_package_name: package_name,
            use_tests_in_packages: ['com.company.package.screenshots'],
            app_apk_path: "app/build/outputs/apk/app-debug.apk",
            tests_apk_path: "app/build/outputs/apk/app-debug-androidTest.apk"
        )
    end

@FisherKK
Copy link
Collaborator

Sure :) No problem!
I hope it will work.

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

2 participants