I want to run my karate tests using karate.jar.
Currently am using maven for execution. I have a runner class which handles cucumber reporting as mentioned in karate documentation.
java -jar karate.jar -T 5 -t ~#ignore -o /mydirectory/all.feature
When I change the test execution as above, is there a way I can get cucumber reports generated same as I was getting for maven?
my current execution is like this: mvn clean test -Dtest=TestRunner.java -Dkarate.env=UAT
when running the features using karate standalone jar, cucumber-html-reports will be generated default on target directory inside you karate.jar's directory
look for target\cucumber-html-reports in the directory where you have you karate.jar
java -jar karate.jar -T 5 -t ~#ignore /mydirectory/all.feature
karate also provides a -o flag in which the provided directory will be used to save reports
java -jar karate.jar -T 5 -t ~#ignore -o /mydirectory /mydirectory/all.feature
Related
I'm trying to run tests using the --select-directory option in junit-platform-console-standalone but tests aren't being discovered. The docs don't have examples for this so I'm a bit lost.
My project looks like this
/home/me/
source/com/mypackage/MyClass.java
unit-tests/com/mypackage/MyClassTest.java
integ-tests/com/mypackage/MyClassIntegTest.java
eclipse-bin/com/mypackage/
MyClass.class
MyClassTest.class
MyClassIntegTest.class
I can run tests with java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -c com.mypackage.MyClassTest succesfully.
I'm trying to run just the tests under unit-tests only. So far I've tried:
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -d /home/me/unit-tests
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -d /home/me/eclipse-bin
I even tried to discover them by file
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -f /home/me/eclipse-bin/com/mypackage/MyClassTest.class
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -f file:///home/me/eclipse-bin/com/mypackage/MyClassTest.class
But none of those discover any tests. How are we supposed to use the -d and -f switches?
Try
java -jar junit-platform-console-standalone.jar --class-path unit-tests:eclipse-bin --scan-class-path
after getting rid of all *Test.class files under eclipse-bin/.
I'm in the process of moving all my projects to individual modules in IntelliJ rather than having one module in the entire git repo, and my IntelliJ builds stopped working. I notice it uses lime builds even though my module is set to openfl (and always has as far as I know)
openfl test flash -debug
this works
lime build GassyRickAstley.xml flash -debug -verbose
this does not. Full gist of both -v
Lime Command-Line Tools (2.9.1)
Initializing project...
Using project file: GassyRickAstley.xml
Warning: Could not read HXCPP config: /Users/booboo/.hxcpp_config.xml
Using target platform: FLASH
Running command: UPDATE
- Embedding asset: removed for brevity
- Copying template file: removed for brevity
Running command: BUILD
- Running command: haxe -main ApplicationMain -cp /usr/local/lib/haxe/lib/flixel/git -D flixel=4.3.0 -cp /usr/local/lib/haxe/lib/openfl/3,6,1 -D openfl=3.6.1 -cp /usr/local/lib/haxe/lib/lime/2,9,1 -D lime=2.9.1 -cp /usr/local/lib/haxe/lib/actuate/1,8,7 -D actuate=1.8.7 -cp /usr/local/lib/haxe/lib/ash/1,5,4/src -D ash=1.5.4 -cp source -cp lib -cp /usr/local/lib/haxe/lib/openfl/3,6,1/extern -cp ../Krakel/source -cp ../../lib/HxAssert/src -D native-trace -D HXCPP_QUIET -D openfl-next -D tools=2.9.1 -D flash-use-stage -D no-compilation -D openfl-flash -D verbose=1 -D web --macro flixel.system.macros.FlxDefines.run() -swf-lib export/flash/obj/assets.swf -swf-version 11.8 -swf export/flash/bin/GassyRickAstley.swf -cp export/flash/haxe -debug
georges-mbp:Gassy Rick Astley booboo$
It doesn't seem like anything went wrong, but I'm pretty shit with analyzing terminal output.
For now I can just build manually, but not having breakpoints is gonna get pretty lame, pretty fast. Any help is appreciated.
Bonus question. When I run/test the project in open fl and close the game's window the active terminal process never ends. I have to close the terminal, reopen and cd my directory again. is there a way around this?
It looks like it may have worked. openfl test flash is similar to running openfl build flash && openfl run flash, which in turn should behave practically the same as lime build flash && lime run flash.
I think your lime build flash command is working properly, but is exiting because the application has finished building. If you use lime test flash instead, it might build-and-run for you, as the other command does?
When trying to trigger a Selenium test thru Jenkins, I face the following issue:
Error: Could not find or load main class org.testng.TestNG
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I do have the testNG jar file in my classpath which is shown below:
My Execute Shell command looks like the following:
set classpath="${WORKSPACE}/bin;${WORKSPACE}/lib/*"
chmod a+x ${WORKSPACE}/lib/*.jar
java -cp "${WORKSPACE}/out/production/Test;${WORKSPACE}/lib/*" org.testng.TestNG ${WORKSPACE}/TestNG.xml
This project is triggered from Bitbucket and is locally built on IntelliJ.
Any help here, would be appreciated.
It looks you are trying to run on a Linux OS.
On Linux, the classpath separator is : and not ;.
http://daviditnotes.blogspot.fr/2007/12/java-classpath-separator.html
Try:
set classpath="${WORKSPACE}/bin:${WORKSPACE}/lib/*"
chmod a+x ${WORKSPACE}/lib/*.jar
java -cp "${WORKSPACE}/out/production/Test:${WORKSPACE}/lib/*" org.testng.TestNG ${WORKSPACE}/TestNG.xml
I'm using Codeception and I want to do Selenium tests.
Obviously, I need Selenium server running and I can spin it up with:
java -jar ./path/to/selenium/binary
However, I've used another testing framework in past which allowed me to specify this path in config file. Then, whenever I did something like codecept run, the framework automatically started selenium server and also shutted it down after all tests were completed.
Can I do this with Codeception? I tried to put exec() in _bootstrap file but it didn't work..
I'm using phantomjs - headless alternative to selenium. This extension starts phantomjs automatically with codecept run. Also phantomjs is faster than selenium.
You can write your own extension for running selenium - have a look at this file.
I start my tests with a bash script and then start and stop selenium via screen:
#!/usr/bin/env bash
# Start selenium in detached screen
screen -d -m -S "selenium" java -Dwebdriver.chrome.driver=./path/to/chromedriver -jar ./path/to/selenium/binary || true
./vendor/bin/codecept run -c codeception.yml --fail-fast --coverage --steps --coverage-html --html || error=true
# quit selenium
screen -S selenium -X quit || true
This might not fit the use-case but I can execute my code in my bash on Windows and Ubuntu as well as via my jenkins build process.
I finally figured out how to output failing tests to a rerun.text
cucumber -p headless --format rerun --out rerun.txt 'path of feature files'
We get the output file of rerun.txt but when we try to do
cucumber -p headless rerun.txt it gets a lexing error because gherkin can't take this input. How do we run the file in cucumber? We tried also just running:
cucumber -p headless --format rerun --out rerun.txt
with no path listed, but it will just run all the feature files. The rerun.txt does contain our failing features.
From the cucumber help text (cucumber -h):
Use --format rerun --out features.txt to write out failing
features. You can rerun them with cucumber #rerun.txt.
So you'd probably want to use:
cucumber -p headless #rerun.txt