Chercher tech jasmine reporter is created by a team lead by Pavankumar, and the team members are:
Vikas Kumar [Test Lead]
Nagesh [Senior Test Engineer]
Pavankumar K [Project Test Engineer](other than Lead)
Rahul Kumar [Senior Test Engineer]
Rashmi
Chercher tech jasmine reporter can be used with any technology where they use the Jasmine framework for testing the code. This reporter is mostly used with JavaScript and its varieties like Typescript, Coffee Script.
For using chercher tech reporter, it is mandatory to have jasmine in your system.
You can install the chercher tech jasmine reporter by entering following command in your Command prompt/Terminal
npm install chercher-tech-jasmine-reporter
or you can install the package in global
npm install chercher-tech-jasmine-reporter -g
Subscribe to my youtube channel :
After installation go to your conf file where you have configured your jasmine add below block of code if you do not have Onprepare method
As you might aware that jasmine can be used with unit testing of javascript code and its variants; if you do not have javascript code, please use the below configuration.
// An example configuration file
var reporter = require('chercher-tech-jasmine-reporter');
exports.config = {
/*
based on your requirements
*/
onPrepare: function() {
var ChercherTechJasmineReporter = reporter.ChercherTechJasmineReporter;
jasmine.getEnv().addReporter(new ChercherTechJasmineReporter({
showSkipped:false,
showLineChart:true
}));
},
onComplete:function(exitcode){
reporter.write_consolidated()
},
afterLaunch:function(exitcode){
return new Promise(function(resolve){
reporter.processResults()
return 0
})
}
};
When you are using the jasmine with protractor, then you might need to take screenshots on fail, sometimes you might do not want to take screenshots at all. Set the values accordingly
// An example configuration file
var reporter = require('chercher-tech-jasmine-reporter');
exports.config = {
/*
based on your requirements
*/
onPrepare: function() {
var ChercherTechJasmineReporter = reporter.ChercherTechJasmineReporter;
jasmine.getEnv().addReporter(new ChercherTechJasmineReporter({
screenshotOnFail :true,
showSkipped:false,
browser:browser,
showLineChart:true
}));
},
onComplete:function(exitcode){
reporter.write_consolidated()
},
afterLaunch:function(exitcode){
return new Promise(function(resolve){
reporter.processResults()
return 0
})
}
};
Using the below parameter, you can alter the report according to your needs.
The line chart provides the detailed execution graph, from the line chart you can get to know if there are any dependency failures because of previous test cases. You can turn it off if you like
Pie charts provide calculations like how many tests are passed and how many tests are failed and skipped. It will also provide the number of steps/pass/fail/skips, along with pass percentage
In this section, you will see the details of the user stories and test cases; we will get the details of failures. [Screenshot is only applicable if you are running the test in the browser.]
Anybody can use it as long as they want to use it, but credits should go to the actual creator
Hell, NO, for organizations as well
Nope
YES, you should, get our details from About us Page
0.0.6
I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.
Error: TypeError: reporter.write_consoloudated is not a function
Showing error after updating npm
onComplete: function () {
reporter.write_consoloudated()
},Is there any way we can view network logs, like we can see in protractor beautiful report?
Error: TypeError: reporter.write_consolidated is not a function
I get an error when I try to run conf.js, running on a Mac Pro.
Error: TypeError: ChercherTechJasmineReporter is not a constructor.
Process exited with error code 100
Following is the conf.ts contents based on the demo.
import {browser} from 'protractor';
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: { browserName: 'chrome' },
specs: [ './test.js' ],
//noGlobals: true,
onPrepare: function() {
return browser.getProcessedConfig().then(function(config){
var ChercherTechJasmineReporter = require('chercher-tech-jasmine-reporter');
jasmine.getEnv().addReporter(new ChercherTechJasmineReporter({
screenshotOnFail: true,
reportName: 'Provide Report Name',
showSkipped: false,
browser: browser,
showLineChart: true
}));
});
}
}
I'm not able to generate the html file as expected. The screenshots are created as expected, but not the html page. Following the Protractor example above doesn't seem to be working with version 1.0.3 or 1.0.2.
When I use the onComplete: with the reporter.write_consolidated(), I get an exception that reporter.write_consolidated is not a function. If I remove the parenthesis, then it no longer complains about the function.
But then it will throw the following error when using the afterLaunch: with the reporter.processResults()
{ [Error: ENOENT: no such file or directory, open 'C:....ConvertedJSFilesmetareport.html']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path:
'C:\...\ConvertedJSFiles\metareport.html' }
Here is my entire config.ts
<code>
const reporter = require('chercher-tech-jasmine-reporter');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
framework: 'jasmine',
specs: ['.\specs\*.js'],
jasmineNodeOpts: {
defaultTimeoutInterval: 90000
},
onPrepare: function () {
let globals = require('protractor');
let browser = globals.browser;
browser.manage().window().maximize();
browser.manage().timeouts().implicitlyWait(5000);
var ChercherTechJasmineReporter = reporter.ChercherTechJasmineReporter;
jasmine.getEnv().addReporter(new ChercherTechJasmineReporter({
screenshotOnFail: false,
reportName: 'QA Automation',
showSkipped: true,
browser: browser,
showLineChart: true
}));
},
onComplete: function (exitcode) {
reporter.writeConsolidated
},
afterLaunch: async function (exitcode) {
return new Promise(function (resolve) {
reporter.processResults()
return 0
})
}
};
</code>I am unable to see the generated files after following steps in this article and running command "ng test --code-coverage". Could you please help me on this. Thank you.
I am unable to see the generated files after following steps in this article and running command "ng test --code-coverage". Could you please help me on this. Thank you.
Could anyone please help me on this.
There's an issue with the onComplete function - Does not create the metareport.html file. Error: ENOENT: no such file or directory, open './metareport.html' Too bad no one monitors this tread, personally like the report, but no support when issues are discovered.
After debugging the code, there was a spelling error in the method name. change the line: "reporter.writeConsolidated" in your conf.ts to "reporter.write_consoloudated". works fine. I bet it will break on the next update when they correct the spelling.
Thank You John. After trying multiple times i was not able to recognise the error. Now it is generationg the report. It was the issue of incorrect method name.
i get an error when i try to use it TypeError: Cannot read property 'replace' of undefined
Could you please help me. Looks like I miss something in configuration or there is a bug in the reporter.
I get the following error when run my protractor tests with this reporter:
TypeError: Cannot read property 'toJSON' of undefined
Stack:
at <Jasmine>
at getTimeInFormat (./node_modules/chercher-tech-jasmine-reporter/chercher-tech-jasmine-reporter.js:227:29)
at ChercherTechJasmineReporter.self.specDone (./node_modules/chercher-tech-jasmine-reporter/chercher-tech-jasmine-reporter.js:414:321)
at <Jasmine>
Versions: [email protected], [email protected], [email protected]
Reporter added in the following way in conf.js file
onPrepare: function () {
let ChercherTechJasmineReporter = require('chercher-tech-jasmine-reporter').ChercherTechJasmineReporter;
jasmine.getEnv().addReporter(new ChercherTechJasmineReporter({
screenshotOnFail: true,
reportName: 'Jabil Default Excess',
showSkipped: true,
showLineChart: true}));
},
tests are started with 'protractor conf.js' commandHow can we override the new report on the previous old report?
vkDKVklSNKDVL
The report is too good. it is excellent and nice. I will give you one suggestion when failed the scenario you need to provide log tracer along with a screenshot.
Is it possible to change report title from ChercherTech Reports to our own customized title? Kindly suggest me on this
How to pass a custom message in reports
Report Generation for Parallel execution of Specs: Hey Karthiq, I am executing specs in parallel mode using shardTestFiles concept, but after execution I am seeing only one execution report which holds details of last executed spec. Can you look in to the issue?
Yes, Vijay. We have also noticed it. It creates every describe file as new reporter. Currently We are working on this. With next release we trying to overcome it
Hi Team.
Its excellent work what you all done. I have one question how to add custom message to this report (ex: Actual result message -- Navigation to xyz page is successful vs Expected result message Navigation to xyz page should be successfulArun, Due to the asynchronous nature of protractor, we will be able create option for it.
Hey KarthiQ, Thanks for this report implementation. Wanted to check can we have all console.log statements printed into the report generated. This will help us in debugging as well. Thanks in advance.
It doenot matter Vijay, Protractor works in Asynchronous way so if you write console.logs then those will be printed whether first step of test cases executes or not. Even it is possible to get console.logs but it is of no use
1.when I use this require('chercher-tech-jasmine-reporter'); in place of (protractor-jasmine2-screenshot-reporter), it showing error like reporter.beforelaunch/AfterLaunch is not a function. if I don't use this ('chercher-tech-jasmine-reporter')… then everything runs successful.
2. And what is the use of Browser:browser,(if I skip this what would be the impact? )
Conclusion: I am not getting any report like yours :(
Hi Vivek, Please let us know where you are using Javascript or typescript as well as are youusing this report for Protractor ? browser option is required for taking screenshots. Please send me the configuration file that you are using, to [email protected]
Please check this. On email its not sending.
var HtmlScreenshotReporter = require('chercher-tech-jasmine-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'C:/Users/vivek.katare/Desktop/protractor report',
filename: 'my-report.html',
// dest: 'C:/Users/vivek.katare/eclipse-workspace/Protract/temp/TestResults',
// screenshotOnFail :true,
reportName:'Provide Report Name',
showSkipped:true,
// browser:browser,
showLineChart:true
});
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
Capabalities:{
'browserName' : 'chrome'
},
//Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
specs:["C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/AddSpec.js"],
suites: {
customerlogin: ['C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/Firstfile.js',
'C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/customerLogin.js'],
managerlogin : ['C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/managerLogin.spec.js'] ,
Calculator : ['calc.js'],
ExcelReading : ['UtilityExcelRead.js'],
SendingMail : ['Utilitysendmail.js']
},
cucumberOpts: {
format: 'pretty',
require: './step_definitions/*.js', // This is where we'll be writing our actual tests
},
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
realtimeFailure: true,
includeStackTrace: true,
defaultTimeoutInterval: 30000
},
onPrepare: function () {
browser.manage().window().maximize();
browser.manage().timeouts().implicitlyWait(5000);
jasmine.getEnv().addReporter(reporter);
},
//Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
};Hi Vivek,
Please do mind that, when you different configuration you got to set the things up for that particular report. You made simple thing as complicated, below s your modified conf file.
----------------------
var chercherTechReporter = require('chercher-tech-jasmine-reporter');
exports.config = {
chromeDriver: 'D:/Eclipse progs/driverserver/chromedriver.exe',
seleniumServerJar: 'D:/Eclipse progs/jars/selenium-server-standalone-3.11.0.jar',
// seleniumAddress: 'http://localhost:4444/wd/hub',
Capabalities:{
'browserName' : 'chrome'
},
specs:["C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/AddSpec.js"],
suites: {
customerlogin: ['C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/Firstfile.js',
'C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/customerLogin.js'],
managerlogin : ['C:/Users/vivek.katare/eclipse-workspace/Protract/TestCases/managerLogin.spec.js'] ,
Calculator : ['calc.js'],
ExcelReading : ['UtilityExcelRead.js'],
SendingMail : ['Utilitysendmail.js']
},
cucumberOpts: {
format: 'pretty',
require: './step_definitions/*.js', // This is where we'll be writing our actual tests
},
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
realtimeFailure: true,
includeStackTrace: true,
defaultTimeoutInterval: 30000
},
onPrepare: function () {
browser.manage().window().maximize();
browser.manage().timeouts().implicitlyWait(5000);
var reporter = new chercherTechReporter({
dest: 'C:/Users/vivek.katare/Desktop/protractor report',
filename: 'my-report.html',
// dest: 'C:/Users/vivek.katare/eclipse-workspace/Protract/temp/TestResults',
// screenshotOnFail :true,
reportName:'Provide Report Name',
showSkipped:true,
// browser:browser,
showLineChart:true
});
jasmine.getEnv().addReporter(reporter);
},
};
Hello . It is very beautiful report. But when I run this code. It saying " browser" is not defined. where I need to define it? if I commented this line. I am not getting neither graphical report nor bar report. I am getting only normal report(jasmine report only)
I have implemented your reporting in my project. I am unable to see the test cases in report. After the execution is done i am getting below error - TypeError: Cannot read property 'toJSON' of undefined - TypeError: Cannot read property 'toJSON' of undefined
Please let me know the combination of option on report that you are using,
Hi karthiQ, This is really fantastic reporting structure. The reporting details is really good like Pie charts, Line charts and test case details. i used the same configuration in config file which you have mentioned. >But when we execute a batch of 2 test cases ( 2 spec files ) < i am getting 2 seperate html reports. Is there any way to have it as a single html report. > The html report is created just in the root folder< is there any way to have one common folder and have the report and screenshots folder inside it. Please help and update. Once again , this is a very good report and i really enjoy it. I faced some problems while implementing it, I just used the same config file setting for
1. Let us know the combination you are using in your spec file. If you are using parallel run then it would created the reports based on the number of runs 2. For Screenshot, next version will have a option to provide path for screenshot and report. we will release the version before next monday
In continuation to my previous ques,
I am using the 2 separate .js as spec files , each have one describe block and one it block . The skeleton is as follows,
'use strict';
describe("sample") => {
it("sample 1") => {
});
});
We are sorry Vishnu, we are not able to reproduce the two report for two describe blocks. More than one report is generated only when you run the execution in Parallel mode. If possible mail the conf file and spec file with dummy data, we will have a look into it. mail us : [email protected]
Hello. First of all appreciate your work for developing such nice fancy report which management always looks. I tried this report in my current project & observe couple of issues. 1. I had skipped some of the scripts & ran only one. However in report, all the skipped cases shown as Pass. 2. It would be added advantage if we can show which verification pass in report for the Pass case. Suppose I have more than 10 assertions in one case & script fails in any of the assertion then we can at least verify which assertion Pass & which Fails
Hi Santosh, Pass expect statement does not provide any meaning full message because of which we have not included it. Please let me know the combination of your skip issue, we can focus on this and will try to solve this weekend Send me combination over [email protected]