Giter Site home page Giter Site logo

square / spoon Goto Github PK

View Code? Open in Web Editor NEW
2.7K 135.0 477.0 40.93 MB

Distributing instrumentation tests to all your Androids.

Home Page: https://square.github.io/spoon/

License: Apache License 2.0

Shell 0.12% Java 8.23% HTML 89.76% CSS 0.59% Kotlin 1.01% Less 0.29%

spoon's Introduction

Spoon

Distributing instrumentation tests to all your Androids.

Introduction

Android's ever-expanding ecosystem of devices creates a unique challenge to testing applications. Spoon aims to simplify this task by distributing instrumentation test execution and displaying the results in a meaningful way.

Instead of attempting to be a new form of testing, Spoon makes existing instrumentation tests more useful. Using the application APK and instrumentation APK, Spoon runs the tests on multiple devices simultaneously. Once all tests have completed a static HTML summary is generated with detailed information about each device and test.

High-level output

Spoon will run on all targets which are visible to adb devices. Plug in multiple different phones and tablets, start different configurations of emulators, or use some combination of both!

The greater diversity of the targets in use, the more useful the output will be in visualizing your applications.

Screenshots

In addition to simply running instrumentation tests, Spoon has the ability to snap screenshots at key points during your tests which are then included in the output. This allows for visual inspection of test executions across different devices.

Taking screenshots requires that you include the spoon-client JAR in your instrumentation app. For Spoon to save screenshots your app must have the WRITE_EXTERNAL_STORAGE permission. In your tests call the screenshot method with a human-readable tag.

Spoon.screenshot(activity, "initial_state");
/* Normal test code... */
Spoon.screenshot(activity, "after_login");

The tag specified will be used to identify and compare screenshots taken across multiple test runs.

Results with screenshots

You can also view each test's screenshots as an animated GIF to gauge the actual sequence of interaction.

Files

If you have files that will help you in debugging or auditing a test run, for example a log file or a SQLite database you can save these files easily and have them attached to your test report. This will let you easily drill down any issues that occurred in your test run.

Attaching files to your report requires that you include the spoon-client jar and that you have WRITE_EXTERNAL_STORAGE permission.

// by absolute path string
Spoon.save(context, "/data/data/com.yourapp/your.file");
// or with File
Spoon.save(context, new File(context.getCacheDir(), "my-database.db"));

Device Results with files

You download the files by clicking on the filename in the device report.

Download

Download the latest runner JAR or the latest client JAR, or just add to your dependencies:

Maven:

<dependency>
  <groupId>com.squareup.spoon</groupId>
  <artifactId>spoon-client</artifactId>
  <version>1.3.1</version>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

Gradle:

There are two Gradle plugins maintained by the community which provide integration with the Android Gradle plugin (AGP):

Execution

Spoon was designed to be run both as a standalone tool or directly as part of your build system.

You can run Spoon as a standalone tool with your application and instrumentation APKs.

java -jar spoon-runner-1.3.1-jar-with-dependencies.jar \
    --apk ExampleApp-debug.apk \
    --test-apk ExampleApp-debug-androidTest-unaligned.apk

By default the output will be placed in a spoon-output/ folder of the current directory. You can control additional parameters of the execution using other flags.

Options:
    --apk               Application APK
    --output            Output path
    --sdk               Path to Android SDK
    --test-apk          Test application APK
    --title             Execution title
    --class-name        Test class name to run (fully-qualified)
    --method-name       Test method name to run (must also use --class-name)
    --no-animations     Disable animated gif generation
    --size              Only run test methods annotated by testSize (small, medium, large)
    --adb-timeout       Set maximum execution time per test in seconds (10min default)
    --fail-on-failure   Non-zero exit code on failure
    --coverage          Code coverage flag. For Spoon to calculate coverage file your app must have the `WRITE_EXTERNAL_STORAGE` permission.
                        (This option pulls the coverage file from all devices and merge them into a single file `merged-coverage.ec`.)
    --fail-if-no-device-connected Fail if no device is connected
    --sequential        Execute the tests device by device
    --init-script       Path to a script that you want to run before each device
    --grant-all         Grant all runtime permissions during installation on Marshmallow and above devices
    --e                 Arguments to pass to the Instrumentation Runner. This can be used
                        multiple times for multiple entries. Usage: --e <NAME>=<VALUE>.
                        The supported arguments varies depending on which test runner 
                        you are using, e.g. see the API docs for AndroidJUnitRunner.

If you are using Maven for compilation, a plugin is provided for easy execution. Declare the plugin in the pom.xml for the instrumentation test module.

<plugin>
  <groupId>com.squareup.spoon</groupId>
  <artifactId>spoon-maven-plugin</artifactId>
  <version>1.3.1</version>
</plugin>

The plugin will look for an apk dependency for the corresponding application. Typically this is specified in parallel with the jar dependency on the application.

<dependency>
  <groupId>com.example</groupId>
  <artifactId>example-app</artifactId>
  <version>${project.version}</version>
  <type>jar</type>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>com.example</groupId>
  <artifactId>example-app</artifactId>
  <version>${project.version}</version>
  <type>apk</type>
  <scope>provided</scope>
</dependency>

You can invoke the plugin by running mvn spoon:run. The execution result will be placed in the target/spoon-output/ folder. If you want to specify a test class to run, add -Dspoon.test.class=fully.qualified.ClassName. If you only want to run a single test in that class, add -Dspoon.test.method=testAllTheThings.

For a working example see the sample application and instrumentation tests in the spoon-sample/ folder.

Test Sharding

The Android Instrumentation runner supports test sharding using the numShards and shardIndex arguments (documentation).

If you are specifying serials for multiple devices, you may use spoon's built in auto-sharding by specifying --shard:

java -jar spoon-runner-1.3.1-jar-with-dependencies.jar \
    --apk ExampleApp-debug.apk \
    --test-apk ExampleApp-debug-androidTest-unaligned.apk \
    -serial emulator-1 \
    -serial emulator-2 \
    --shard

This will automatically shard across all specified serials, and merge the results. When this option is running with --coverage flag. It will merge all the coverage files generated from all devices into a single file called merged-coverage.ec.

If you'd like to use a different sharding strategy, you can use the --e option with Spoon to pass those arguments through to the instrumentation runner, e.g.

java -jar spoon-runner-1.3.1-jar-with-dependencies.jar \
    --apk ExampleApp-debug.apk \
    --test-apk ExampleApp-debug-androidTest-unaligned.apk \
    --e numShards=4 \
    --e shardIndex=0

However, it will be up to you to merge the output from the shards.

If you use Jenkins, a good way to set up sharding is inside a "Multi-configuration project".

  • Add a "User-defined Axis". Choose a name for the shard index variable, and define the index values you want (starting at zero).

    User-defined Axis

  • In your "Execute shell" step, use the same execution command as above, but inject the shard index for each slave node using the variable you defined above, e.g. --e shardIndex=${shard_index}. Make sure you're passing in the correct total number of shards too, e.g. --e numShards=4.

    Execute shell

Running Specific Tests

There are numerous ways to run a specific test, or set of tests. You can use the Spoon --size, --class-name or --method-name options, or you can use the --e option to pass arguments to the instrumentation runner, e.g.

    --e package=com.mypackage.unit_tests

See the documentation for your instrumentation runner to find the full list of supported options (e.g. AndroidJUnitRunner).

License

Copyright 2013 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

spoon's People

Contributors

brnhffmnn avatar cnvandev avatar daj avatar dnkoutso avatar dweebo avatar edenman avatar eric-grab avatar f2prateek avatar gdaniels avatar gentlecat avatar holmes avatar intelradoux avatar jainsahab avatar jakewharton avatar jaredsburrows avatar kirillzh avatar lesterthetester avatar mdrabic avatar montecreasor avatar originx avatar peter-budo avatar prayagverma avatar psrajat avatar robertdolca avatar smuldr avatar softotalss avatar sorccu avatar swankjesse avatar x2on avatar xcolwell 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  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

spoon's Issues

Retain previous test results and do an incremental update

I do not have devices for all of the configurations I need to test against, and need to use AVDs. I need spoon to retain the previous test results so I can rerun it using a different AVD.

The end result will be one spoon report, that shows the results of multiple runs against several AVDs.

Kick off tests without relying on ADB

A couple options:

  • Figure out if devices have fixed IP addresses and SSH apks/commands things over?
  • Install a Spoon app on every test phone. The app calls back up to the CI box and retrieves commands?
  • Something else?

Allow Video Framebuffer Capture

On rooted phones, capture the framebuffer directly and allow for movies of animations.

Something like Spoon#startVideo(Activity, tag) and Spoon.stopVideo(tag).

Questions:

  • Convert to GIF on desktop?
  • HTML5 video player in output?

Update to ddmlib r20 (or newer)

r16 has a problem where it leaks file handles (especially on windows) due to not calling .close() in a finally block when synchronizing files from a device.

Skip spoon

Is there a way to skip spoon from execution? We have multiple jobs build setup (something along the line of job 1 compile&install, job 2 compile and analysis, job 3 matrix compile&install)

Snapshot HTML code is not generated

I ran mvn install from sample app, it works fine but html code for snapshot is not generated. Note that all snapshots are generated an saved in image directory.

If I navigate to a test case from browser following error message is displayed on top, I tried changing permision but it did not work

![spoon](https://f.cloud.github.com/assets/380876/158748/77172fea-76f2-11e2-92ce-2ec009f9754f.jpg)
java.io.IOException: Unable to delete file: C:\**\spoon\spoon-sample\tests\target\spoon-output\work\0A3C0E570B00B004\app_spoon-screenshots\com.example.spoon.ordering.tests.LoginActivityTest\testValidValues_StartsNewActivity\1360878675303_next_activity_shown.png
    at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279)
    at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653)
    at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535)
    at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270)
    at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653)
    at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535)
    at org.apache.commons.io.FileUtils.moveDirectory(FileUtils.java:2756)
    at com.squareup.spoon.SpoonDeviceRunner.run(SpoonDeviceRunner.java:217)
    at com.squareup.spoon.SpoonDeviceRunner.main(SpoonDeviceRunner.java:289)

spoon

Second instrumentation module breaks whole maven build

We are using Maven and we have big project that contains 2 applications and common libraries. Recently I decided to write instrumentation tests for both application and launch them with Spoon. At second instrumentation test whole build failed

[ERROR] Failed to execute goal com.squareup.spoon:spoon-maven-plugin:1.0.3:run (default) on project caregiver-it: Execution default of goal com.squareup.spoon:spoon-maven-plugin:1.0.3:run failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.squareup.spoon:spoon-maven-plugin:1.0.3:run (default) on project caregiver-it: Execution default of goal com.squareup.spoon:spoon-maven-plugin:1.0.3:run failed. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.squareup.spoon:spoon-maven-plugin:1.0.3:run failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.lang.NullPointerException at com.android.ddmlib.AndroidDebugBridge.stop(AndroidDebugBridge.java:691) at com.android.ddmlib.AndroidDebugBridge.createBridge(AndroidDebugBridge.java:296) at com.squareup.spoon.SpoonUtils.initAdb(SpoonUtils.java:121) at com.squareup.spoon.SpoonRunner.run(SpoonRunner.java:68) at com.squareup.spoon.SpoonMojo.execute(SpoonMojo.java:154) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more

Separately those tests work fine

Base Class Tests

If I have a base class for my tests, screenshots don't work. This is how the spoon dashboard looks.
The same test suite does work if I remove the testActivityIsCreated() method.

To try it out, you can check out this branch and run test-cli.sh (handles building the app and tests).

java.lang.NullPointerException
 at com.square.spoon.SpoonDeviceRunner.run(SpoonDeviceRunner.java:225)
 at com.square.spoon.SpoonRunner.runTests(SpoonRunner.java:110)
 at com.square.spoon.SpoonRunner.run(SpoonRunner.java:78)
 at com.square.spoon.SpoonRunner.main(SpoonRunner.java:365)

No output report being produced

I'm using v1.0.3 with the maven plugin, and when I run my tests with mvn spoon:run the tests run, and I see spoon doing stuff in the log, but when the test completes there is no report being produced.

Add javadoc comments to spoon report for class and test method.

Hello: First, Thanks for Spoon - it is awesome. Second, is there a way to add code comments for the test case class and test method to the report? Or is this already supported? The intent of this request is to have a document-once type of solution so that the test class and method code comments are self-documenting and embedded in the output report so that the test reviewer does not need to consult an external java doc, spec, or code.

Example:

/**
 * Super Fantastic Activity Test Cases Covered:
 * 1- Handles configuration change after edit text change
 * 2- Handles missing email address error on save
 * 3- etc...
 */
public void testFoo() {
    // something interesting...
}

Implement Device Timeout

Have a per-device timer of an arbitrary value (say, 5m) which gets reset on every ddmlib callback (e.g., test started, test run started, test failed, etc.) that will interrupt execution if a timeout occurs.

Supporting Screenshot comparison

It would be nice if the screeshots taken during a spoon test could be compared to a "reference" screenshot automatically.

Reference screenshots could be stored in src/test/resources

The spoon reports could offer :

  • the screenshot
  • a green check mark for screenshots that are equal to the reference
  • a red cross mark for screenshots that differ from the reference
  • if screenshots are different from reference, then offer to display both screenshot, the reference and the difference.
  • if screenshots are different from reference, offer to mark the new screenshot as the reference.

I believe this can be achieved easily via ImageMagick compare utility.

Support AVD Creation/Tear-Down and Target Modification

Based on specified and provided device configurations. Automatically tear up/down AVDs and change settings like font size, orientation, locale, etc. across all devices.

Provide desktop Swing/JavaFX app to easily create and manage these configs. Should also allow running from this app for kicks.

Maven spoon:run fails

I had no problems to do clean install from top of the project. However when trying to run spoon from spoon-sample as mvn spoon:run I got following error

 mvn spoon:run
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/jenkins-ci/tools/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/tools/maven-metadata.xml
Downloading: http://repo.jenkins-ci.org/public/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml (11 KB at 24.2 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (22 KB at 525.0 KB/sec)
Downloaded: http://repo.jenkins-ci.org/public/org/jenkins-ci/tools/maven-metadata.xml (385 B at 0.4 KB/sec)
Downloaded: http://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-metadata.xml (9 KB at 8.0 KB/sec)
Downloaded: http://repo.jenkins-ci.org/public/org/codehaus/mojo/maven-metadata.xml (22 KB at 28.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.210s
[INFO] Finished at: Thu Feb 14 14:29:26 GMT 2013
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spoon' in the current project and in the plugin groups [org.jenkins-ci.tools, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/Peter/.m2/repository), repo.jenkins-ci.org (http://repo.jenkins-ci.org/public/), central (http://repo1.maven.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

I do see spoon directory in my local repo.

Standalone execution works fine, report produced and looks great.

Add severity levels for assertions

A nice to have would be the ability to have different flavors of failure we could record, and see in the output. Not everything in life is black/white, so why should testing be black/white?

A complete failure would be visualized as RED.
A semi-passing test could be something like ORANGE or YELLOW.
A 100% passing test would be GREEN.

This could be a quick first iteration, then let the user refine the colors/levels in a later release.

An example borrowed from Dagger could be the coffee maker. The coffee maker should make coffee, so the test could be asserting that it made coffee, and it was the right type of coffee. If the coffee maker made coffee, but it was the wrong type it still made coffee so it wasn't a complete failure, so maybe visualize this partial pass with ORANGE/YELLOW.

Refactor ADB Interaction For Increased Testability

Right now the only way to verify we haven't broken anything is to actually perform a full run. We should be able to abstract most of this away so that we can verify 99% of the functionality using unit tests.

Capture logcat from the app

Should help with deciphering integration test failures. Maybe see if we can insert breaks when we kick off a test? Something like:


ClassName.testName


Use Better Screenshot Means

...to get awesome full-screen screenshots.

Socket to the host which captures using normal means through ddmlib. Could be a simple REST API or just dumb text communication. Client would block until a response was received. Fall back to decor view.

Gradle Plugin

So we can be run with almost no effort under the new build system. Maybe an example as well.

Analyze Partial Failures Based On Device Profiles

If tests fail 1<x<All devices, look at the device information (OS version, screen density, screen size, manufacturer, others?) to see if there's anything they all have in common. This would be super useful for isolating Froyo failures, for instance.

Can't take screenshot of a Dialog

I may be doing something wrong, but if a Dialog is shown in front of the Activity and I call

Spoon.screenshot(solo.getCurrentActivity(), "my_dialog");

I get a screenshot of the Activity behind the Dialog instead of the Dialog itself.

Crash when sorting devices for html generation

java.lang.NullPointerException
at com.squareup.spoon.html.HtmlIndex$Device.compareTo(HtmlIndex.java:97)
at com.squareup.spoon.html.HtmlIndex$Device.compareTo(HtmlIndex.java:72)
at java.util.Arrays.mergeSort(Arrays.java:1144)
at java.util.Arrays.sort(Arrays.java:1079)
at java.util.Collections.sort(Collections.java:115)
at com.squareup.spoon.html.HtmlIndex.from(HtmlIndex.java:36)
at com.squareup.spoon.html.HtmlRenderer.generateIndexHtml(HtmlRenderer.java:94)
at com.squareup.spoon.html.HtmlRenderer.render(HtmlRenderer.java:54)
at com.squareup.spoon.SpoonRunner.run(SpoonRunner.java:80)
at com.squareup.spoon.SpoonMojo.execute(SpoonMojo.java:148)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more

Better Handling of Nested Exceptions

Currently we indent everything but the topmost exception line. We should be unindenting nested exception messages to conform with the normal fixed-width Java output.

Spoon fails to capture a screenshot due to a difference between the actual class hierarchy, and the expected class hierarchy

We are using Spoon as part of our automated tests for an Android application.

We have code similar to:

public class TestSample extends OurOwnInstrumentationClass {

    @Override
    public void setUp() {
        // does some set up common to our tests
        // captures a screenshot here
    }

    public void testSomethingOrOther() {
        // does a test here
    }

    public void testSomethingElse() {
        // does another test
    }
}

where OurOwnInstrumentationClass extends the ActivityInstrumentationTestCase2 of Android.

When running the test, Spoon fails to capture a screenshot, throwing an IllegalArgumentException stating that it cannot find the test class.

From debugging the tests, it seems to be a case that findTestClassTraceElement in Spoon.java expects to find android.test.InstrumentationTestCase on the stack, however due to where we are capturing the screenshot, we have junit.framework.TestCase on the stack instead, thus the exception is thrown.

Is there a way to adjust the code so that findTestClassTraceElement is not dependent on the hardcoded "android.test.InstrumentationTestCase" string?

Development Maven Classpath Detection Broken

When doing actual compilation it still uses the version installed into the local repo rather than the one from the target directory. As a workaround, for now, always use install rather than verify.

The ability to have portrait and landscape results for the same device

I would like to have the results for a device in both portrait and landscape in the same report file.

One way of achieving this, is to detect if it is landscape before a device's tests are run and append _land at the end of the device id. The rest of the code should see this as a different device than when it is in portrait.

Upgrade to Bootstrap 2.3.0

...once it's finally released.

Need to move the tooltips for the icons in the headings to be attached to somewhere else (e.g., directly to <body>) so the styling isn't all screwed up.

Ant integration

Hi,

I am using CI tool Jenkins with ant build xml. As far as spoon goes I think it is supporting maven.Is there any way in which spoon can be integrated in Jenkins or with ant..

Pardon my n00bness :p

Link To Screenshots From Log Output

On master we now log when you take a screenshot. When viewing the log output, these entries should be or contain links which go to that screenshot.

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.