As you can see on the screen, userPassword variable was not updated after launching new debug session. I have to restart and invalid cashes to update my changes...
Everything is fine when I run rest assured tests ( without cucumber ) in the same project so it's look like I have problem with cucumber or selenium.
I am using junit to run
Related
I am using Visual Studio Code with the java.home setting set to the directory of my JDK 11 installation. I have a Maven project and use 3.5.4 and have it added to my path, so I can run mvn in a console. Maven works as expected, as well as running the code's main method, however when I run a JUnit 4.12 test by clicking Run Test that is shown over an annotated #Test method, the test runs, however I am unable to view any console output from the JUnit tests.
Under Output, I have the Test Output window, which is where I would expect the console to output, however nothing shows up even though the test method runs System.out.println("test");
How would I go about making JUnit 4.12 display the test console output when a test is run by clicking the Run Test button shown over a test method?
This is currently a known issue in the plugin. The workaround is to disable the Maven plugin. (You can still use the terminal within VS Code to run Maven)
I've been following along a couple of tutorials and at the point where they run the tests in the junit test view in Eclipse, mine just looks disabled, and I can see any tests to run:
Notice on the right hand side I have an empty JUnit view. None of the tutorials mention anything about this situation. You can see the JUnit library in my Package Explorer too. What do I need to do now to get my test to run in the JUnit test view?
You got the project setup right, now you need to tell eclipse to execute the test cases locate in the project, for that you need to do the following
Right click project --> run as --> Junit Test
And the Junit view of the eclipse will get populated with the test runs as below with the results of which cases failed and which passed
Just right click on AssertTest.java; then follow below--
run as > Junit Test
Since looking into your screen shot, you only have one Junit class; so it seems this will help you to run Junit.
I found this post while looking into a slightly different "empty JUnit view" issue: after upgrading to Eclipse 2022.06 from 2021.??, my JUnit view stopped working. I could see the unit tests running in the console, but no results were shown in the view.
I was able to fix it by opening the Eclipse preferences Java -> JUnit, then clicking Apply and Close.
I have a Framework built using Java Selenium Webdriver, when I compile my tests via the IDE the test runs fine but when I use Maven it does not click the login button but no errors are reported. ? My confusion is that by looking at the errors it would seem both work fine. It is when then the window is viewed it can be seen the button is not clicked. Is this expected or has anyone seen this issue before? This Maven build also worked before so I can't understand why it does not now.
I want to run JUnit tests for my Play 2.4 application within Intellij IDEA 14.1.4 to leverage full JUnit integration.
The tests are executed fine when I create a new JUnit run configuration. However on every test run a full SBT build is executed delaying the tests for around 30 seconds.
If I remove Make form the pre-launch steps in the JUnit run configuration the tests are executed directly without a full sbt build but then any code changes in test and application code are not picked up by IDEA. Even when the play is running with auto-compile on file changes IDEA doesn't pick them up for the tests.
Edit 07/09/2015
I've also exchanged Make with an SBT Action test:compile which only opens up a SBT console loading the project and stops with a prompt. It's not executing the action test:compile and therefore not starting the test at all.
What do I have to change in run configuration and/or project settings to get a fast and seamless JUnit integration for Play projects in IDEA?
Finally found the answer myself when digging through issue tickets of idea-sbt-plugin.
Exchanging Pre launch Step Make with SBT Action test:compile was the right way to go. However the SBT Plugin expects the default sbt shellPromt >. Play projects however define their own custom promt as [projectname] $.
I had to add the following line to build.sbt to get the SBT action to work.
shellPrompt := (_ => "> ")
Getting back into Java coding after being away for a while, downloaded the latest Maven (3.1.1), the latest Eclipse (Kepler), the latest JDK (1.7.0_45), created a new Maven project in Eclipse (using the quickstart archetype, which looks like it defaulted to JUnit 3.8.1), opened AppTest.java, selected "Run As JUnit Test" (not JUnit Plug-in Test), and nothing shows up in the JUnit view.
Shouldn't it at least say something like "Runs: 1/1"? If I change the code in testApp() to "assertTrue( false)", then I don't see a failure (although if I debug, sure enough, an exception gets thrown). If I put a println() in the test, I see its output in the console view. If I run mvn test from the command line, I get a lovely stacktrace and the word "FAILURE!" (and my println() output).
So. Something basic is wrong somewhere, but what?
Maybe you checked the "Show Failures Only" option? (on the same bar as "Rerun Test"). It happened to me :)
I think I repeat your problem. It happens when the JUnit window is opened initially in eclipse (for example I detached the view as separate window and it shows when eclipse starts).
With fresh start (window/view shown) I run tests and don't see anything in it, when I close it and run unit tests (via 'run as') window reopens but now results are shown.