Giter Site home page Giter Site logo

robotest's People

Contributors

taig avatar zbsz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

robotest's Issues

Support for robolectric 3.1

Currently robotest works ok with robolectric 3.0, but not with 3.1:

java.lang.NoSuchMethodError: org.robolectric.internal.bytecode.InstrumentationConfiguration$Builder.doNotAquireClass(Ljava/lang/String;)Lorg/robolectric/internal/bytecode/InstrumentationConfiguration$Builder;
[info] at org.scalatest.RoboSuiteRunner.classLoaderConfig$lzycompute(RobolectricSuite.scala:140)
[info] at org.scalatest.RoboSuiteRunner.classLoaderConfig(RobolectricSuite.scala:138)
[info] at org.scalatest.RoboSuiteRunner.sdkEnvironment$lzycompute(RobolectricSuite.scala:149)
[info] at org.scalatest.RoboSuiteRunner.sdkEnvironment(RobolectricSuite.scala:148)
[info] at org.scalatest.RoboSuiteRunner.run(RobolectricSuite.scala:191)
[info] at org.scalatest.RobolectricSuite$class.run(RobolectricSuite.scala:41)
...

I'm confused, seems org.robolectric.internal.bycode.InstrumentationConfiguration$Builder does have method doNotAquireClass in robolectric 3.1, why NoSuchMethodError?

findLibraries override breaks project.properties

I'm unsure how to adapt to the changes in the library loading mechanism. I had been using project.properties to reference both local fs dependencies as well as exploded aars (android.support etc), which I manually placed in my project tree. You seem to be overriding robolectrics functionality completely by reading the target/aars dir.
I'm sporting a multi-project structure with several inter-project root deps, and the aars dir is only present in dep target dirs, not the test dir, which results in multiple problems.
First a NPE due to target/aars being absent. Circumventing this with if (aarsDir.isDirectory), robolectric starts up but fails to find library resources.
Removing the findLibraries override works fine, the old mechanism loads the resources as usual.

Am I missing something obvious? Seems to me it would work if we were trying to find aars in all target dirs, but I assume this would be a sort of aggregation job for android-sdk-plugin…though I'm perfectly fine with using the previously working method, in which case we would need a config flag for RobolectricSuite to choose the library loading method.

Test fails if an AppCompat theme is used in Activity

Hi @zbsz,

this is probably not directly related to robotest, but when I try to test an Activity that is styled with an AppCompat theme I get this error

[info] Scenario: Start real activity *** FAILED ***
[info]   java.lang.RuntimeException: Could not find any resource  from reference ResName{org.robotest:style/Theme_AppCompat_NoActionBar} from style StyleData{name='AppTheme', parent='@style/Theme_AppCompat_NoActionBar'} with theme null
[info]   at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getParent(ShadowAssetManager.java:517)
[info]   at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getAttrValue(ShadowAssetManager.java:455)

I've created a reproducible test case here.

This issue seems to be known for Robolectric (here the most current issue for 3.0-SNAPSHOT).
It seems that the solution requires using a specialized RobolectricGradleTestRunner, but I'm admittedly not understanding the entire discussion.

I'm thankful for any hints on how to fix this and I'll happily create a PR once I've found a solution :)

Best
Martin

Publish 2.10 artifact

Thanks for the great library! I'm currently integrating it into macroid, but it still needs to support 2.10. It looks like you have crossScalaVersions, but 2.10 artifact is not published. Would it be possible to publish it?

R is missing for aar projects

I can't manage to access the R class in an aar project.

[error] ./robotest/example/src/test/scala/org.robotest/ResourcesSpec.scala:11: not found: value R
[error]     Robolectric.application.getResources.getString(R.string.test_string) shouldEqual "test"
[error]                                                    ^
[error] one error found
[error] (test:compile) Compilation failed
[error] Total time: 8 s, completed 13.06.2015 19:27:48

To reproduce replace android.Plugin.androidBuild in ./example/build.sbt with android.Plugin.androidBuildAar. Please note that I did only manage to test this on 0.7 with Robolectric 2.4.

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.