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

Junit DataProvider tests are skipped when run via spoon plugin #538

Open
manoj897 opened this issue Jun 12, 2018 · 1 comment
Open

Junit DataProvider tests are skipped when run via spoon plugin #538

manoj897 opened this issue Jun 12, 2018 · 1 comment

Comments

@manoj897
Copy link

manoj897 commented Jun 12, 2018

My tests uses Junit DataProvider. I have given the sample class below which uses Junit Dataprovider.
The below tests are running when run via Android studio but when used via spoon the below cases are not running. please help me identify if I am missing something

@RunWith(DataProviderRunner.class)
public class TestScenario {

    @DataProvider
    public static String[] dataSetValues() {
        return new String[]{
                "1907020001",
                "1907020002",
                "1907020003",
                "1907020004",
                "1907020005",
                "1907020006",
                "1907020007"
                "1907020008",
                "1907020009"
            };
    }


    @Test
    @UseDataProvider("dataSetValues")
    public void testMethod(String testId) {
        validateFunction1(testId);//The testId is the string from dataSetValues when used with Junit DataProvider
     }

}

while running, the following log was printed

2018-06-12 02:14:11 [SDR.run] Running com.xxx.automation.xxxx.test.Regression.yyy.TestScenario#testMethod[0: 1907020001] on [emulator-5554]
Running am instrument -w -r -e class com.xxx.automation.xxxx.test.Regression.yyy.TestScenario#testMethod[0: 1907020001] com.xxx.automation.xxxx.test/com.xxx.automation.xxx.test.Helper.Utils.CustomTestRunner on Nexus_5x [emulator-5554]
02:14:11 D/InstrumentationResultParser: unrecognized line usage: am [subcommand] [options]
02:14:11 D/InstrumentationResultParser: unrecognized line usage: am start [-D] [-N] [-W] [-P ] [--start-profiler ]
02:14:11 D/InstrumentationResultParser: unrecognized line [--sampling INTERVAL] [-R COUNT] [-S]
.
.
.
02:14:11 D/InstrumentationResultParser: unrecognized line Error: No instrumentation found for: 1907020001]

Looks like the above command is not recognised.

@manoj897
Copy link
Author

manoj897 commented Jun 12, 2018

If the same command is used with a simple change then it works

In the above case while running the adb shell am instrument command there is a space between the test and testId

testMethod[0: 1907020001]

Instead when used as

testMethod[0:\\ 1907020001] it worked.

Is there any workaround to do these changes

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

1 participant