GithubHelp home page GithubHelp logo

dropshots's People

Contributors

devpalacio avatar jayshortway avatar josealcerreca avatar rharter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropshots's Issues

pullDefaultDebugAndroidTestScreenshots FAILED

I made a basic test

@RunWith(Parameterized::class)
class NotificationActivitySmokeTests(val activityUnderTest: Class<out Activity>) {
    @get:Rule
    val sandboxRule = LoggedInFakeUserTestRule(activityUnderTest, true)

    @get:Rule
    val dropshots = com.dropbox.dropshots.Dropshots()

    companion object {
        @JvmStatic
        @Parameterized.Parameters(name = "Notification Payload Batch: {index}")
        fun activitesToSmokeTest(): List<Class<*>> =
            listOf(
                EmailNotificationsSettingsActivity::class.java,
                PushNotificationsSettingsActivity::class.java,
                SmsNotificationsSettingsActivity::class.java,
            )
    }

    @Test
    fun simpleTest() {
        sandboxRule.getScenario().onActivity {
            dropshots.assertSnapshot(it, "MatchesActivityScreenshot")
//            assertThat(it).isInstanceOf(activityUnderTest)
        }
    }
}

I then ran ./gradlew myModule:CAT

I then got error

> Task :subsystem:tfa:notifications:sandboxes:app:pullDefaultDebugAndroidTestScreenshots FAILED
adb: error: failed to stat remote object '/storage/emulated/0/screenshots/com.twitter.sandbox.notifications.debug/.': No such file or directory

> Task :subsystem:tfa:notifications:sandboxes:app:clearDefaultDebugAndroidTestScreenshots FAILED
rm: /storage/emulated/0/screenshots/com.twitter.sandbox.notifications.debug: No such file or directory

I think its unexpected that tasks get added to cAT without some flag. Maybe have an explicit flag or don't fail if directory for deletion doesn't exist

Missing Custom Validation

Hey,

there's a section in README about custom validation with objects like ResultValidator, CountValidator and ThresholdValidator. But it seems that the Dropshots API is missing those elements in my project (ver 0.3.0), could you please add a sample or small snippet on how to use that feature?

depend on android.library?

My gradle fu is not great but was wondering if it is possible to not have to apply android.library/android.app plugin before dropshots. Maybe there is an api that can check if it is on path rather than requiring ordering?

Can't sync gradle on a fresh project with the plugin added (KotlinJvmAndroidCompilation with name 'debug' not found.)

๐Ÿ‘‹

I wanted to try out this library, but as soon as I add plugin:

plugins {
    id("com.android.application")
    id 'org.jetbrains.kotlin.android'
    id("com.dropbox.dropshots") version "0.2.0"
}

(plus mavenCentral() in the repos, I already had it) the project can't sync gradle with an error:

A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > org/gradle/configurationcache/extensions/CharSequenceExtensionsKt
   > KotlinJvmAndroidCompilation with name 'debug' not found.

Zrzut ekranu 2022-06-30 o 12 29 21

Tried and can't make it run in three projects:

  • my main work project
  • fresh sample project
  • fresh sample project at my colleague's

with the same result

Am I missing something? ๐Ÿค”

Environment:
a) macbook with m1 pro chip, Android Studio Chipmunk | 2021.2.1 Patch 1
b) my colleague's macbook with intel

Thanks for new lightweight library, sounds like something that I'd need ๐Ÿ‘

Storage permission fix for API 29

Hi,

Thanks for creating this useful tool! I really appreciate the fact that assertSnapshot() accepts a direct Bitmap as well, as that's more fitting for my use case than a View or Activity.

Issue
I had some issues getting this to work with my Android 10 (API 29) device. The runtime library is unable to write to the Downloads folder.

To my understanding, Android 10 is a bit of a special case in terms of scoped storage. It's the first version with scoped storage, but it doesn't have the direct file paths feature yet, introduced in Android 11, which re-enables the use of the Java File API.

Fix
So on Android 10, if an app wants to write to a media folder such as Downloads, it has 2 options:

Accepting PRs?
I have the second option implemented in a local checkout of Dropshots and it's working well. Would you like me to create a pull request? I'd be happy to!

Allow to save screenshots in folders

On top of the file name it would be great to be able to store the screenshots into folders.
I currently end up with hundreds of view screenshots and some names get truncated because they are too long. Having folders would allow more nested structure and would avoid prefix in file names
Happy to contribute if you agree with the feature

Screenshots are pulled from the wrong directory

adb: error: failed to stat remote object '/storage/emulated/0/screenshots/com.google.samples.apps.nowinandroid.feature.topic/.': No such file or directory

Looking at the device file explorer, the screenshots are there but in a different directory:

/storage/emulated/0/screenshots/com.google.samples.apps.nowinandroid.feature.topic.test/MatchesActivityScreenshot.png

Unable to create screenshot storage directory.

I'm still investigating this, but I bumped Dropshot from 0.1.1 to 0.2.0 and everything worked great. I was able to record and run.

Then I removed the WRITE_EXTERNAL_STORAGE permission from the module's manifest as it's no longer required and I started getting the error.

I added the permission again and I still see the same error. I tried cleaning, etc.

Failed test does not store output - or wrong error message

java.lang.AssertionError: "MatchesActivityScreenshot" failed to match reference image. 18 pixels differ (8.6805556E-4 %)
Output written to: /storage/emulated/0/Download/screenshots/com.google.samples.apps.nowinandroid.feature.topic.test/MatchesActivityScreenshot.png

However the screenshots directory is empty, This might be a feature and the only bug is in the error message.

Using emulator API 30 and 28.

min api is 23

Me again :-) any reason we need api23, I was unable to use in a minapi 21 app.


> Task :subsystem:tfa:notifications:sandboxes:app:processDefaultDebugAndroidTestManifest FAILED
[androidx.test.espresso:espresso-core:3.2.0] /Users/mnakhimovich/.gradle/caches/transforms-3/baa638c28051cb16a7630d000c6f64db/transformed/espresso-core-3.2.0/AndroidManifest.xml Warning:
        Package name 'androidx.test.espresso' used in: androidx.test.espresso:espresso-core:3.2.0, androidx.test.espresso:espresso-idling-resource:3.2.0.
/Users/mnakhimovich/workspace/twitter-android/build/projects/subsystem/tfa/notifications/sandboxes/app/intermediates/tmp/manifest/androidTest/default/debug/tempFile1ProcessTestManifest5391222334560463959.xml:5:5-74 Error:
        uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [com.dropbox.dropshots:dropshots:0.1.1] /Users/mnakhimovich/.gradle/caches/transforms-3/469c2a42c974d58408744a407cefc928/transformed/dropshots-0.1.1/AndroidManifest.xml as the library might be using APIs not available in 21
        Suggestion: use a compatible library with a minSdk of at most 21,
                or increase this project's minSdk version to at least 23,
                or use tools:overrideLibrary="com.dropbox.dropshots" to force usage (may lead to runtime failures)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.