AshisRaj / cucelastic-maven-plugin

Real-time reporting of cucumber tests to Elastic Search
GNU General Public License v3.0
17 stars 9 forks source link

About to create index #7

Open alikatircio opened 4 years ago

alikatircio commented 4 years ago

Hello,

I want use your plugin when our test results to kibana and i added to your plugin add to my pom.xml and i didn't see create any index on elastic, and when try to manuelly with result sender and if don't use and of url suite its not create index(http://localhost:9200/deneme) but if i write to suite it's creating (http://localhost:9200/deneme/suite)

So am i have to add suite your in your url. Can you help for this?

AshisRaj commented 3 years ago

Please create these indexes in Kibana if not done yet. This is a prerequisite to be performed manually to start using the plugin.

feature_summary_index scenario_summary_index step_summary_index tag_summary_index

alikatircio commented 3 years ago

Hii, Yes i did but still i can't not send data this indexes. But what could be the error?

yellow open scenario_summary_index
yellow open tag_summary_index
yellow open feature_summary_index yellow open step_summary_index

AshisRaj commented 3 years ago

1) Run with mvn verify command.

2) Have you set correctly the source of Json test results files which are to be picked up by the Plugin. Please note that this plugin runs after the Cucumber tests completes so to pick the Json test results files. e.g. I have configured my src folder like below.

${project.build.directory}\cucumber-reports\json-reports

3) Do you see error starting with text like below in the console output. "Could not parse JSON in file "

4) You also need to define the json results file path in the TestRunner. e.g. @CucumberOptions(strict = true, monochrome = true,
features = "src/test/resources/features", glue = {"stepdefs"}, tags = {"~@Ignore"}, plugin = { "usage", "html:target/cucumber-reports/blog-post-pretty", "json:target/cucumber-reports/json-reports/blog-post.json", "junit:target/cucumber-reports/blog-post.xml", "com.vimalselvam.cucumber.listener.ExtentCucumberFormatter:"

5) Finally, here is the log from my local system.

[INFO] --- cucelastic-maven-plugin:1.0:load (cucumber-elastic-search) @ bdd-with-cucumber-selenium --- [INFO] ----------------------------------------------- [INFO] Cucumber Report Maven Plugin, version 1.0 [INFO] ----------------------------------------------- [INFO] - source JSON report directory : D:\Ashis Ddrive\Projects\Java\bdd-with-cucumber-selenium\target\cucumber-reports\js on-reports [INFO] - elastic Search Host Name : localhost:9200 [INFO] - feature Summary Index Name : feature_summary_index [INFO] - scenario Summary Index Name : scenario_summary_index [INFO] - step Summary Index Name : step_summary_index [INFO] - tag Summary Index Name : tag_summary_index [INFO] - feature Summary Document Type Name : feature_summary_document_type [INFO] - scenario Summary Document Type Name : scenario_summary_document_type [INFO] - step Summary Document Type Name : step_summary_document_type [INFO] - tag Summary Document Type Name : tag_summary_document_type [INFO] - send Feature Summary To Elastic Search : true [INFO] - send Scenario Summary To Elastic Search : true [INFO] - send Step Summary To Elastic Search : true [INFO] - send Tag Summary To Elastic Search : true [INFO] ------------------------------------------------------------------------ [INFO] ----------------------------------------------------------- [INFO] Sending the FeatureSummary documnets to elastic search [INFO] {"feature_index":0,"feature_name":"Login","total_scenarios":11,"passed_scenarios":0,"failed_scenarios":11,"skipped_scen arios":0,"status":"failed","date":"2021-03-24T21:08:11.154"} [INFO] {"feature_index":1,"feature_name":"Logout","total_scenarios":1,"passed_scenarios":0,"failed_scenarios":1,"skipped_scena rios":0,"status":"failed","date":"2021-03-24T21:08:11.154"} [INFO] {"feature_index":2,"feature_name":"Add Blog/Post","total_scenarios":2,"passed_scenarios":0,"failed_scenarios":2,"skippe d_scenarios":0,"status":"failed","date":"2021-03-24T21:08:11.154"} [INFO] ----------------------------------------------------------- [INFO] Sending the ScenarioSummary documents to elastic search [INFO] {"feature_index":0,"featureName":"Login","scenario_index":1,"scenarioName":"I should login successfully using valid cre dentials","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":2,"scenarioName":"I should fail to login due to wrong credent ials","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":3,"scenarioName":"I should fail to login due to wrong credent ials","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":4,"scenarioName":"I should not be able to Submit the login fo rm when one of the required fields is left blank","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":5,"scenarioName":"I should not be able to Submit the login fo rm when one of the required fields is left blank","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":6,"scenarioName":"My account should be locked after 5 consecu tive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":7,"scenarioName":"My account should be locked after 5 consecu tive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.907"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":8,"scenarioName":"My account should be locked after 5 consecu tive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":9,"scenarioName":"My account should be locked after 5 consecu tive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":10,"scenarioName":"My account should be locked after 5 consec utive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":0,"featureName":"Login","scenario_index":11,"scenarioName":"My account should be locked after 5 consec utive failed login attempts","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":1,"featureName":"Logout","scenario_index":12,"scenarioName":"Successful Logout","status":"failed","dat e":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":2,"featureName":"Add Blog/Post","scenario_index":13,"scenarioName":"Successful landing on Add a Blog/P ost","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] {"feature_index":2,"featureName":"Add Blog/Post","scenario_index":14,"scenarioName":"Successful creation of a Blog/Post ","status":"failed","date":"2021-03-24T21:08:11.908"} [INFO] ----------------------------------------------------------- [INFO] Sending the StepSummary documents to elastic search [INFO] {"scenario_index":1,"scenarioName":"I should login successfully using valid credentials","total_steps":8,"passed_steps" :0,"failed_steps":1,"skipped_steps":7,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":2,"scenarioName":"I should fail to login due to wrong credentials","total_steps":7,"passed_steps":0," failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":3,"scenarioName":"I should fail to login due to wrong credentials","total_steps":7,"passed_steps":0," failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":4,"scenarioName":"I should not be able to Submit the login form when one of the required fields is le ft blank","total_steps":8,"passed_steps":0,"failed_steps":1,"skipped_steps":7,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":5,"scenarioName":"I should not be able to Submit the login form when one of the required fields is le ft blank","total_steps":8,"passed_steps":0,"failed_steps":1,"skipped_steps":7,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":6,"scenarioName":"My account should be locked after 5 consecutive failed login attempts","total_steps ":7,"passed_steps":0,"failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":7,"scenarioName":"My account should be locked after 5 consecutive failed login attempts","total_steps ":7,"passed_steps":0,"failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":8,"scenarioName":"My account should be locked after 5 consecutive failed login attempts","total_steps ":7,"passed_steps":0,"failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"scenario_index":9,"scenarioName":"My account should be locked after 5 consecutive failed login attempts","total_steps ":7,"passed_steps":0,"failed_steps":1,"skipped_steps":6,"date":"2021-03-24T21:08:12.224"} [INFO] {"tag_name":"@DisabledLogin","total_scenarios":2,"passed_scenarios":0,"failed_scenarios":2,"skipped_scenarios":0,"date" [INFO] {"tag_name":"@SuccessfulAddBlogPost","total_scenarios":1,"passed_scenarios":0,"failed_scenarios":1,"skipped_scenarios": [INFO] {"tag_name":"@failedLoginAndAccountLockedOut","total_scenarios":6,"passed_scenarios":0,"failed_scenarios":6,"skipped_sc [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:45 min [INFO] Finished at: 2021-03-24T21:08:12+05:30 [INFO] ------------------------------------------------------------------------

alikatircio commented 3 years ago

Thank you your answer i will try again, and i asking something else too, is it possible to use it with Karate Api test tool?

AshisRaj commented 3 years ago

If it generates the identical json formatted test report, then it can be used.