cucumberjs

Protractor - Error Handling in Framework

旧巷老猫 提交于 2019-12-04 17:02:38
How can we handle error in a Protractor - Cucumber based framework? There are assert failures, which is a genuine fail and there are errors in javascript code (e.g. - element not found, array is empty, something undefined etc..). I wish to handle the later in a graceful manner. Currently Protractor tests fail for the said errors but the messages are not friendly and hard to comprehend. They mostly point to location of errors in protractor library files and not where the actual error occurred in the script (file name, line number etc.) e.g "NoSuchElementError: No element found using locator: By

Generate HTML report for WebdriverIO/Cucumber framework

。_饼干妹妹 提交于 2019-12-04 14:57:00
I am using WebdriverIO/Cucumber ( wdio-cucumber-framework ) for my test automation. I want to get the test execution result in a HTML file. As of now I am using Spec Reporter ( wdio-spec-reporter ). Which helps to print the results in console window. But I want all the execution reports in a HTML file. How can I get WebdriverIO test execution result in a HTML file? Thanks. OK, finally got some spare time to tackle your question @Thangakumar D . WebdriverIO reporting is a vast subject ( there are multiple ways to generate such a report ), so I'll go ahead and start with my favorite reporter:

function to take screenshots for cucumber-html-reporter generates “function timed out after 5000..” error

时光怂恿深爱的人放手 提交于 2019-12-04 10:59:51
I am using protractor-cucumber-framework and I wanted to generate html report for the tests I wrote. I decided to use cucumber-html-reporter to achieve it. In my hooks.js I wrote a this.After object to take screenshot on test failure: this.After(function(scenario, callback) { if (scenario.isFailed()) { browser.takeScreenshot().then(function(buffer) { return scenario.attach(new Buffer(buffer, 'base64'), function(err) { callback(err); }); }); } else { callback(); } }); Everything works just fine, the report is generated and the screenshots are taken and attached only on test failure. But I also

CucumberJS - Error: Step timed out after 5000 milliseconds at Timer.listOnTimeout (timers.js:92:15)

橙三吉。 提交于 2019-12-04 08:07:47
I'm new to cucumberjs and just trying out my first attempt at running a feature. I've built the feature that is on the cucumber-js github page . I get this error when trying to run it: Benjamins-MBP:Features Ben$ cucumber.js example.feature Feature: Example feature As a user of cucumber.js I want to have documentation on cucumber So that I can concentrate on building awesome applications Scenario: Reading documentation # example.feature:6 Given I am on the Cucumber.js GitHub repository # StepDefinitions/myStepDefinition.js:4 Error: Step timed out after 5000 milliseconds at Timer.listOnTimeout

How to configure Protractor to use Cucumber

别等时光非礼了梦想. 提交于 2019-12-04 01:38:32
As of 0.20.1 Cucumber is now fully supported in Protractor but I'm battling to find any documentation on how to configure it properly. Any idea how you would setup world.js? I have found this example at https://github.com/whyvez/angular-cucumber-example/blob/master/features/support/world.coffee but I'm not sure if you would still need to specify all the require modules and configuration as the protractor config file (referenceConf.js) would have all this info already. assert = require 'assert' path = require 'path' protractor = require 'protractor' webdriver = require 'selenium-webdriver'

Chimpjs and Meteor: method calls in tests without using Velocity

时光总嘲笑我的痴心妄想 提交于 2019-12-03 17:11:15
This app shows an example of testing Meteor with Cucumber: https://github.com/mhurwi/cucumber-meteor-tutorial It works well with Velocity. But my computer becomes very slow when starting an app with Velocity and I don't want it to always run when I'm developing. So I tried to use Chimp as an NPM module by using chimp --ddp=http://localhost:3000 as proposed here: https://chimp.readme.io/docs/getting-started-with-meteor-cucumber But the tests with method calls (the methods are in tests/cucumber/fixtures/) don't work: Error: Method not found [404] Does anyone have an idea of what I should do in

Selenium driver instance persists if test is aborted on Jenkins

大兔子大兔子 提交于 2019-12-02 09:19:23
问题 Ok, so I am wondering how I can get my driver/browser sessions to properly exit if a test is aborted via jenkins. Locally, if I run my tests and abort them, the browser will quit properly. Via jenkins however, this does not happen. If I abort the job during the test phase where my tests are running on the selenium grid, the browser stays open - causing the node to still show up as being used because it did not pick up that the aborted job should have killed its browser session. I have been

Selenium driver instance persists if test is aborted on Jenkins

寵の児 提交于 2019-12-02 05:59:44
Ok, so I am wondering how I can get my driver/browser sessions to properly exit if a test is aborted via jenkins. Locally, if I run my tests and abort them, the browser will quit properly. Via jenkins however, this does not happen. If I abort the job during the test phase where my tests are running on the selenium grid, the browser stays open - causing the node to still show up as being used because it did not pick up that the aborted job should have killed its browser session. I have been messing around with cucumber hooks, but the more I think about it I am not sure if I can handle this with

protractor config file is not picking up the cucumber step definitions

不羁的心 提交于 2019-12-01 01:12:29
i am new to protractor and cucumber framework. i followed the steps from protractor site and here https://semaphoreci.com/community/tutorials/getting-started-with-protractor-and-cucumber . i have a config file configured with cucumber framework options, feature file and step definition file. But when i run my cucumber-config file it does not recognize my step definitions and always throw an error. any help on this? below are my setup files. //cucumber-config.js exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', capabilities: { browserName:'chrome' }, framework: 'custom',

Cucumber HTML report with Protractor

ε祈祈猫儿з 提交于 2019-11-30 07:09:31
问题 I am using Protractor with Cucumber (js). I would like to generate report files just like with the Cucumber-JVM version. I have seen examples when using Protractor with Jasmine, but practically nothing with Cucumber. How do you generate reports when using this configuration? The final goal is to publish this report in Jenkins, or anywhere else if they are directly generated in HTML. Thanks! 回答1: With the latest version of protractor (from version 1.5.0), you can now generate a JSON report.