cucumber-jvm

Android Unit Testing: Cucumber-jvm + Android Instrumentation

…衆ロ難τιáo~ 提交于 2019-12-04 15:56:46
问题 Using: Cucumber-JVM with Android Instrumentation + Espresso). Reference Github link : https://github.com/mfellner/cucumber-android for this. The simple sample works fine. Problem with cucumber-jvm + android instrumentation: But in the sample in link, it uses ActivityInstrumentationTestCase2 which is deprecated. I would like to use @Rule - ActivityTestRule class as said by Google. Here my question is: For using cucumber-jvm, I am using the CucumberInstrumentationCore instead of

Tests on test(AVD) - failed: Instrumentation run failed due to 'java.io.IOException'

人走茶凉 提交于 2019-12-04 12:01:24
I get this error when running my Cucumber-jvm tests with Gradle on an Android emulator . The exact same tests run perfectly on a device but I need to run them on emulator to perform the tests on Travis CI The debug error: Executing task ':app:connectedDebugAndroidTest' (up-to-date check took 0.0 secs) due to: Task has not declared any outputs. deleteDir(/home/travis/build/neoranga55/Experiment-CI/app/build/outputs/androidTest-results/connected) returned: true deleteDir(/home/travis/build/neoranga55/Experiment-CI/app/build/outputs/code-coverage/connected) returned: true Starting 0 tests on test

Unable to run cucumber feature feature

旧街凉风 提交于 2019-12-04 09:47:43
I am unable to run the feature file. whenever i tried to run the file i am getting the below stack trace Exception in thread "main" Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified. Built-in FORMAT types: junit, html, pretty, progress, json. FORMAT can also be a fully qualified class name. -t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION. -n, -

Cucumber how to find if a feature file has executed? Any Java method?

穿精又带淫゛_ 提交于 2019-12-04 05:03:00
问题 @Before public void quit_if_tagged_scenario_failed(Scenario scenario) { if (!isTagged(scenario) && prevScenarioFailed) throw new IllegalStateException("An important scenario has failed! Cucumber wants to quit."); } I'm using this method to check if the previuos scenario failed. If failed I want to skip all the scenarios in that feature file.So the problem here is if I’m running two feature files the last scenario in the feature file failed and the first step of next feature will also fails

How to get an ActionContext from Struts 2 during acceptance tests?

情到浓时终转凉″ 提交于 2019-12-03 21:13:38
问题 I am writing acceptance tests (testing the behavior) using cucumber-jvm, on an application with Struts 2 and Tomcat as my Servlet Container. At some point in my code, I need to fetch the user from the Struts 2 HttpSession , created by an HttpServletRequest . Since I'm doing tests and not running Tomcat, I don't have an active session and I get a NullPointerException . Here's the code I need to call: public final static getActiveUser() { return (User) getSession().getAttribute("ACTIVE_USER");

Cucumber with Spring Boot 1.4: Dependencies not injected when using @SpringBootTest and @RunWith(SpringRunner.class)

倾然丶 夕夏残阳落幕 提交于 2019-12-03 17:23:10
问题 I am writing a new app and trying to do BDD using cucumber and Spring Boot 1.4. Working code is as shown below: @SpringBootApplication public class Application { @Bean MyService myService() { return new MyService(); } public static void main(String[] args) { SpringApplication.run(Application.class, args); } } public class MyService {} Test code is as shown below: @RunWith(Cucumber.class) public class RunFeatures {} @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes =

Is there a way to directly generate Step Definitions in Eclipse without Running Cucumber?

岁酱吖の 提交于 2019-12-03 10:57:30
Im doing integration testing with cucumber and Gradle in Eclipse. For now my workflow is Write a feature file Run it to generate step skeletons Copy and implement them This works good for new features and so on, but becomes quite bothersome if you have a large feature and implement new steps in the middle or towards the end. To get the new step skeletons I need to run the whole feature. Even with the dryRun = true option this takes up a long time. I have heard that IntellyJ can generate these step skeletons directly and I would like to know if something like this is possible in Eclipse? Not

Reusing Cucumber-JVM step definitions in other projects

让人想犯罪 __ 提交于 2019-12-03 10:03:52
问题 How can I reuse Cucumber-JVM Step Definitions in other projects to test some typical web actions. The point is that I've created some java project just with Step Definition Implementations of the typical scenario actions like: When I follow the link "*some_link*" Then I should see following content "*some_content*" on page And I want to reuse these definitions in other projects (include in classpath), just to write their own simple scenarios. But when I run the scenario (as JUnit test),

Android Unit Testing: Cucumber-jvm + Android Instrumentation

血红的双手。 提交于 2019-12-03 09:12:28
Using: Cucumber-JVM with Android Instrumentation + Espresso). Reference Github link : https://github.com/mfellner/cucumber-android for this. The simple sample works fine. Problem with cucumber-jvm + android instrumentation: But in the sample in link, it uses ActivityInstrumentationTestCase2 which is deprecated. I would like to use @Rule - ActivityTestRule class as said by Google. Here my question is: For using cucumber-jvm, I am using the CucumberInstrumentationCore instead of testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner". So Android junit annotations like @Rule

Can I use spring to autowire controller in cucumber test?

﹥>﹥吖頭↗ 提交于 2019-12-03 07:13:20
问题 I am using Cucumber to automate the testing of services and controllers in my app. In addition, I am using the Cucumber Junit runner @RunWith(Cucumber.class) in the test steps. I need to instantiate my controller and was wondering if I could use Spring to autowire this. The code below shows what I want to do. public class MvcTestSteps { //is it possible to do this ???? @Autowired private UserSkillsController userSkillsController; /* * Opens the target browser and page objects */ @Before