Saturday, December 15Be an Automation Engineer

Jasmine

Take screenshot for every failed spec in protractor+jasmine

Jasmine, Protractor, TypeScript
Why we need screenshots?

Generally we need screenshot of the browser where the protractor got failed. It would increase our chances to quickly figure out the issue before getting into the code debug. 

How to take a screen shot in protractor?

Below is the code to take a screenshot using protractor.

browser.takeScreenshot().then(function (png) { var dirPath = './reports/screenshots/'; if (!fs.existsSync('./reports')) » Continue Reading.
Protractor with jasmine data provider – Write once test many times

Protractor with jasmine data provider – Write once test many times

Jasmine, JavaScript, Protractor
What is data provider?

When it comes to automation, data provider is an approach to pass test data to the automation tests. Each and every automation tool has it’s own way of providing test data to the automation When we take TestNG framework, it has @DataProvider annotation which will help to pass test data to the automation test.

Why we » Continue Reading.