TestNg emailable-report is not updating? - selenium

When I am running the tesng.xml file by running it by right clicking on it ,the emailable-report.html file is showing as per the latest test result ,but While running it from terminal by "mvn test" test results are coming as per expected but emailable-report.html file is updated as per the current result .

That's because your report is probably generated in target folder when you run it with maven and in test-output when running it via testng.xml directly. So you are probably expecting it to be in different place and you are opening wrong report, while your latest report is in target folder.

I had the same problem, but the folder was ok. The problem is that the emailable-report.html generation occurs after all the execution, including the annotations #After.... What I did is using Reporter.getCurrentTestResult(); in #AfterTest before performing the email send action to have the file updated at the right time.

Related

Can't navigate to Karma test file from Tests Run tab in IntelliJ Ultimate

I have an Angular project with Karma/Jasmine tests files. I configured my IntelliJ IDEA (2022.2.4 (Ultimate Edition)) to run Karma tests, which works mostly fine.
One thing that doesn't work is opening the Tests Run tab and navigating to the source for a test by clicking on the test name.
For example on the screenshot below, I expect that clicking on the test marked in red would open the corresponding project-menu-component.spec.ts file to the corresponding it(), but nothing actually happens when I click:
I have the following settings:
Jump to source doesn't work for specs with dynamically generated names. Related ticket: WEB-26625, please vote for it to get notified on updates

Getting 'Could not find test files' Error when attempting to run TestCafe tests

I'm trying to run some TestCafe tests from our build server, but getting the following error...
"Could not find test files at the following location: "C:\Testing\TestCafe".
Check patterns for errors:
tests/my-test.ts
or launch TestCafe from a different directory."
I did have them running or able to be found on this machine previously, but others have taken over the test coding and changed the structure a bit when moving it to a Git repository. Now when I grab the tests from Git and try to run, the problem presents itself. I'm not sure if there is something in a config file that needs adjustment but don't know where to start looking.
The intention is to have it part of our CI process, but the problem is also seen when I attempt to run the tests from the command line. The build process does install TestCafe, but there is something strange around this as well.
When the build failes with the can't find tests error, if I try to run the following command in the proper location...
tescafe chrome tests/my-test.ts
... I get, 'testcafe' is not recognized as an internal or external command,
operable program or batch file.
Just can't understand why I can't get these tests running. TestCafe setup was pretty much easy previously.
ADDENDUM: I've added a screenshot of the working directory where I cd to and run the testcafe command as well as the tests subdirectory containing the test I'm trying to run.
Any help is appreciated!!
testcafe chrome tests/my-test.ts is just a template; it isn't a real path to your tests. This error means that the path that you set in CLI is wrong, and there aren't any tests. You need to:
Find out where you start CLI. Please attach a screenshot to your question.
Define an absolute path to tests or a path relative to the place where CLI was started. Please share a screenshot of your project tree where the directory with tests is open.
Also, you missed t in the tescafe chrome tests/my-test.ts command. It should be tesTcafe chrome tests/my-test.ts. That is why you get the "'tescafe' is not recognized as an internal or external command" error.
I was able to get things working by starting from scratch. I uninstalled TestCafe and cleaned the working folder. During next build it was fine. I'm sure I've tried this several times, but it just started working.
One positive that came out of it was that I discovered a typo in a test file name, which was also causing issues finding the test I was using to check testing setup.
Thanks for helping!!

Cucumber-java test steps execute twice in IntelliJ

Normally I run Cucumber-Jvm tests using Run/Debug configuration. Once I tried to run one tests using Run window by selecting the scenario (right click and run)
From that point on wards I see each time when I run test using Edit Configuration I see steps run twice.
I am using IntelliJ Community version
Anyone had this issue before could be any settings change.
Right click on the Play button on your .feature file and select the last choice 'Create Scenario ...'. On the Program arguments box you should have CucumberJvm5SMFormatter only ONCE. I had:
--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"
Simply, I deleted the second line:
--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"
and it ran perfectly!
Also depends on number of examples you have provided in cucumber
You have probably another test with the same name

Display selenese-runner results in Jenkins

As I am implementing an automated way to GUI test our webapplication with selenium I ran into some issues.
I am using selenese-runner to execute our Selenium test suites, created with Selenium IDE as a post build action in Jenkins.
This works perfeclty fine, as the build fails when something is wrong, and the build succeeds if all tests are passed. And the results are stored on a per build basis as HTML files, generated be selenese-runner.
My problem is however, that I seem to be unable to find a way, how to display these results in the respective jenkins build.
Does anyone have an idea how to solve this issue. Or maybe I am on the wrong path at all?
Your help is highly appreciated!
I believe the JUnit plugin should do what you want, but it doesn't work for me.
My config uses this shell script to run the tests (you can see the names of all my test suites):
/usr/bin/Xvfb &
export DISPLAY=localhost:0.0
cd ${WORKSPACE}
java -jar ./test/selenium/bin/selenese-runner.jar --baseurl http://${testenvironment} --screenshot-on-fail ./seleniumResults/ --html-result ./seleniumResults/ ./test/selenium/Search_TestSuite.html ./test/selenium/Admin_RegisteredUser_Suite.html ./test/selenium/Admin_InternalUser_Suite.html ./test/selenium/PortfolioAgency_Suite.html ./test/selenium/FOAdmin_Suite.html ./test/selenium/PublicWebsite_Suite.html ./test/selenium/SystemAdmin_Content_Suite.html ./test/selenium/SystemAdmin_MetaData_Suite.html
killall Xvfb
And I can see the result of the most recent test (you can see the name of my jenkins task folder)
http://<JENKINS.MY.COMPANY>/job/seleniumRegressionTest/ws/seleniumResults/index.html
Earlier tests are all saved on the Jenkins server, so I can view them if I need to.

Run a build with qa-report plugin enabled to see results here

I start a new job in jenkins ci configured as free-style. I add post-build action "qa-report" and "Publish JUnit test result report". But I dont get qa-report and test result trend chart. I dont have the prevelige to access master machine. Cases are worked restrictly on a node. I can access the node.
For qa-report, I get the information.
Run a build with qa-report plugin enabled to see results here
What should I do? Does free-style not enabled qa-report? Do I need to specify some files or paths which located on master? Is there something wrong with the edition of maven. I am using maven3X. What kind of path of the xml file should I input to get chart. Any idea and references would be appreciated.
Expected:
1 qa-report
2 test result chart