Skip to content

Cucumber-android does not perform another project off the cucumber-android-test example #574

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
chiavegatto opened this issue Aug 27, 2013 · 2 comments
Assignees

Comments

@chiavegatto
Copy link

When you try to run the cucumber-android features the following error in the console:

----------------------------------------------------------------------------------------------------------
[INFO] --- android-maven-plugin:3.6.0:apk (default-apk) @ cucumber-android-agenda ---
[INFO] Copying local assets files to combined assets directory.
[INFO] Enabling debug build for apk.
[INFO] C:\android-sdk\build-tools\17.0.0\aapt.exe [package, -f, -M, C:\workspace\BDDAndroid\Agenda\AndroidManifest.xml, -S, C:\workspace\BDDAndroid\Agenda\res, --auto-add-overlay, -A, C:\workspace\BDDAndroid\Agenda\target\generated-sources\combined-assets\assets, -I, C:\android-sdk\platforms\android-17\android.jar, -F, C:\workspace\BDDAndroid\Agenda\target\cucumber-android-agenda-0.0.1.ap_, --debug-mode]
[INFO] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[INFO] Add native libraries from C:\workspace\BDDAndroid\Agenda\libs
[INFO] 
[INFO] --- android-maven-plugin:3.6.0:internal-pre-integration-test (default-internal-pre-integration-test) @ cucumber-android-agenda ---
[INFO] C:\android-sdk\build-tools\17.0.0\aapt.exe [dump, xmltree, C:\workspace\BDDAndroid\Agenda\target\cucumber-android-agenda-0.0.1.apk, AndroidManifest.xml]
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_4.1.2_unknown_sdk found.
[INFO] emulator-5554_4.1.2_unknown_sdk :   Successfully uninstalled br.fpf.agenda from emulator-5554_4.1.2_unknown_sdk
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_4.1.2_unknown_sdk found.
[INFO] emulator-5554_4.1.2_unknown_sdk :   Successfully installed C:\workspace\BDDAndroid\Agenda\target\cucumber-android-agenda-0.0.1.apk to emulator-5554_4.1.2_unknown_sdk
[INFO] 
[INFO] --- android-maven-plugin:3.6.0:internal-integration-test (default-internal-integration-test) @ cucumber-android-agenda ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_4.1.2_unknown_sdk found.
[INFO] emulator-5554_4.1.2_unknown_sdk :   Running instrumentation tests in br.fpf.agenda
[INFO] emulator-5554_4.1.2_unknown_sdk :     Run started: br.fpf.agenda, 1 tests:
[INFO] emulator-5554_4.1.2_unknown_sdk :       Start [1/1]: Feature Test#Scenario Testing
[INFO] emulator-5554_4.1.2_unknown_sdk :       ERROR:Feature Test#Scenario Testing
[INFO] emulator-5554_4.1.2_unknown_sdk :       Missing step-definition

@Given("^I have a test$")
public void I_have_a_test() throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}

for step 'I have a test'
Exception in thread "Thread-13" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1911)
    at com.jayway.maven.plugins.android.AbstractInstrumentationMojo$AndroidTestRunListener.parseForException(AbstractInstrumentationMojo.java:1011)
    at com.jayway.maven.plugins.android.AbstractInstrumentationMojo$AndroidTestRunListener.testFailed(AbstractInstrumentationMojo.java:875)
    at com.android.ddmlib.testrunner.InstrumentationResultParser.reportResult(InstrumentationResultParser.java:467)
    at com.android.ddmlib.testrunner.InstrumentationResultParser.parseStatusCode(InstrumentationResultParser.java:411)
    at com.android.ddmlib.testrunner.InstrumentationResultParser.parse(InstrumentationResultParser.java:272)
    at com.android.ddmlib.testrunner.InstrumentationResultParser.processNewLines(InstrumentationResultParser.java:243)
    at com.android.ddmlib.MultiLineReceiver.addOutput(MultiLineReceiver.java:99)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:419)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:444)
    at com.android.ddmlib.testrunner.RemoteAndroidTestRunner.run(RemoteAndroidTestRunner.java:211)
    at com.android.ddmlib.testrunner.RemoteAndroidTestRunner.run(RemoteAndroidTestRunner.java:196)
    at com.jayway.maven.plugins.android.AbstractInstrumentationMojo$1.doWithDevice(AbstractInstrumentationMojo.java:404)
    at com.jayway.maven.plugins.android.ScreenshotServiceWrapper.doWithDevice(ScreenshotServiceWrapper.java:56)
    at com.jayway.maven.plugins.android.AbstractAndroidMojo$2.runDo(AbstractAndroidMojo.java:764)
    at com.jayway.maven.plugins.android.AbstractAndroidMojo$DoThread.run(AbstractAndroidMojo.java:1275)
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ cucumber-android-agenda ---
[INFO] Installing C:\workspace\BDDAndroid\Agenda\target\cucumber-android-agenda-0.0.1.apk to C:\Users\rafael.chiavegatto\.m2\repository\agenda\teste\cucumber-android-agenda\0.0.1\cucumber-android-agenda-0.0.1.apk
[INFO] Installing C:\workspace\BDDAndroid\Agenda\pom.xml to C:\Users\rafael.chiavegatto\.m2\repository\agenda\teste\cucumber-android-agenda\0.0.1\cucumber-android-agenda-0.0.1.pom
[INFO] Installing C:\workspace\BDDAndroid\Agenda\target\cucumber-android-agenda-0.0.1.jar to C:\Users\rafael.chiavegatto\.m2\repository\agenda\teste\cucumber-android-agenda\0.0.1\cucumber-android-agenda-0.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.627s
[INFO] Finished at: Tue Aug 27 10:33:28 BOT 2013
[INFO] Final Memory: 25M/349M
[INFO] ------------------------------------------------------------------------
----------------------------------------------------------------------------------------

I'm using the following information in the pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>agenda.teste</groupId>
    <version>0.0.1</version>
    <artifactId>cucumber-android-agenda</artifactId>
    <packaging>apk</packaging>
    <name>Examples: Agenda Teste</name>

    <properties>
        <android-maven-plugin.version>3.6.0</android-maven-plugin.version>
        <android.version>4.1.1.4</android.version>
        <cucumber.version>1.1.5-SNAPSHOT</cucumber.version>
        <robotium.version>4.2</robotium.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>${android.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android-test</artifactId>
            <version>${android.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-android</artifactId>
            <version>1.1.5-SNAPSHOT</version>
            <type>apklib</type>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>${android-maven-plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>17</platform>
                    </sdk>
                    <undeployBeforeDeploy>true</undeployBeforeDeploy>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
@ghost ghost assigned mfellner Aug 27, 2013
@mfellner
Copy link
Contributor

Hi, cucumber-android-test (examples/android/android-test/) is intended as an integration test for cucumber-android only, not as a template.

I just updated cucumber-android on the main branch, please try it out, thank you!

mfellner added a commit that referenced this issue Sep 6, 2013
# By Aslak Hellesøy (9) and others
# Via Dmytro Chyzhykov (2) and others
* master:
  [TestNG] Java Calculator TestNG example project - #579 issue.
  [Jython] Access to scenario in Before and After hooks. Closes #582.
  Scenario Outlines: Replace tokens in the names of the generated "Example Scenario"s.
  Change some remaining Cucumber.Options to CucumberOptions
  No longer used
  No longer used
  master is SNAPSHOT
  Java Calculator TestNG example project.
  Enable Wicket example, using HtmlUnitDriver so it runs on Travis. Upgraded maven plugins.
  is deprecated in favour of . Closes #549
  Disable wicket example for now
  Updated History.md with Android improvements. Ref #547 and #574.
  Attribution. Fix broken test. Closes #568
  Enable wicket example. Removed incorrect comment about cargo requiring Java 7. It does not. (Jetty 9 does, but we're on 8 now).
  #568 Inherit Information of @Cucumber.Options
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants