cucumberjs

Cucumber - Data driven testing - multiple similar steps in same scenario

强颜欢笑 提交于 2019-12-25 01:14:06
问题 I am writing a feature which deals with adding multiple items to shopping cart like a typical e-commerce application. It is something like this - Scenario: Promotion is applied Given I select "Bacon" worth "$1" Given I select "Lettuce" worth "$2" Given I select "Diet Coke" worth "$5" Given I select "Bread" worth "$2" Then "$0.5" promotion should be applied for "Bacon" Then "$0.0" promotion should be applied for "Lettuce" Then "$0.5" promotion should be applied for "Diet Coke" Then "$1.0"

Pass Jenkins build number to Protractor for SauceLabs

[亡魂溺海] 提交于 2019-12-24 06:38:35
问题 I am running protractor test cases through Jenkins, and using SauceLabs as execution environment. I am using Protractor-Cucumber-Framework. I want to pass build number from Jenkins so that I can pass same to SauceLabs to organize my test execution results. I tried params as mentioned in this post https://moduscreate.com/blog/protractor_parameters_adding_flexibility_automation_tests/ in Config.js params: { buildNumber:'xyz' } for running protractor : protractor config/config.js --parameters

cucumber-js parse error when run on Jenkins

不问归期 提交于 2019-12-23 18:50:53
问题 I am trying to setup a jenkins pipeline step to runs some test scenarios using cucumber-js but I am getting an error back from the build as follows: Error: Parse error in 'e2e/definitions/login.js': (1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'const { Given, When, Then } = require('cucumber');' The command being run in the pipeline step is as follows: cucumber-js e2e/features/**/*.feature --require e2e/**/*.js The opening lines of the login.js file the

Cucumber.js debugging in IntelliJ

早过忘川 提交于 2019-12-23 12:19:26
问题 IntelliJ has a plugin for Cucumber.js. This suppose to enable running and debugging inside the IDE. The run configuration for cucumber.js works, but the debug mode is deactivated (Debug button can not be clicked). Does anybody else has the same problem and managed to solve it? Debugging is very essential to me. Thanks! 回答1: Instead of using the cucumber.js plugin, I used the run/debug configuration of node.js. I just set the run config of the node.js plugin like that -> JavaScript file: node

AssertionError: expected [ true ] to be true

巧了我就是萌 提交于 2019-12-22 14:00:32
问题 I have faced with the strange assertions problem so even successful assertions are marked as failed, like this: this.expect(this.getWidget('contacts').isNamesDisplayed()).to.eventually.be.true.and.notify(next); and in the console I have: 1 scenario (1 passed) 4 steps (4 passed) 0m03.618s [17:06:38] E/launcher - expected [ true ] to be true [17:06:38] E/launcher - AssertionError: expected [ true ] to be true As you see in this case test marked as successful despite of failed assertion, but in

Getting “is not a thenable” message while using “eventually” in protractor chai

我与影子孤独终老i 提交于 2019-12-22 11:24:02
问题 When I tried to verify the condition as below. var val1 = "ONE"; var val2 = "TWO"; expect(val1==val2).to.eventually.equal(false) I'm getting false is not a thenable message, If I removed eventually condition as below then it working fine. var val1 = "ONE"; var val2 = "TWO"; expect(val1==val2).to.equal(false) Can anyone help me to understand the difference. Also If the condition fails, It displays the error message and not executing the hooks.js . 回答1: In simple words: eventually - is a method

Message: function timed out after 5000 milliseconds - Protractor & CucumberJS

假如想象 提交于 2019-12-21 21:03:06
问题 cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm I keep getting this error after upgrading to cucumberJs version above. Failures: 1) Scenario: Get records from DB e2e\features\transac.feature:7 Step: Given I am logged in as "username" with "password"- e2e\features\transac.feature:8 Step Definition: e2e\steps\loginSteps.js:17 Message: function timed out after 5000 milliseconds 1 scenario (1 failed) 1 step (1 failed) 0m06.608s Please note I included my env

How to rerun the failed cucumber scenarios in protractor?

我们两清 提交于 2019-12-21 18:58:07
问题 As a part of testing, i was using typescript language to develop the code which will be compatible for protractor, i was using BDD framework in which i had defined some cucumber options in my config.ts as following: capabilities: { specs: "../example.feature" } cucumberOpts: { compiler: "ts:ts-node/register", format: "rerun:./reports/rerun.txt", require: "../../stepdefinations/*.ts", strict: true } onComplete: () =>{ Reporter.createHTMLReport(); } As mentioned in format, i was able to get the

How to configure Protractor to use Cucumber

蹲街弑〆低调 提交于 2019-12-21 08:06:21
问题 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

How to configure Protractor to use Cucumber

自闭症网瘾萝莉.ら 提交于 2019-12-21 08:06:13
问题 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