cucumberjs

How to debug Cucumber in Visual Studio Code (VSCode)?

人盡茶涼 提交于 2020-01-12 18:35:43
问题 I was trying to debug Cucumber scenarios in Visual Studio code and made below changes in the launch.json . { "name": "e2e", "type": "node", "request": "launch", "program": "${workspaceRoot}\\node_modules\\.bin\\cucumber-js", "stopOnEntry": false, "args": ["--no-timeouts", "--colors"], "cwd": "${workspaceRoot}", "runtimeExecutable": null, "outFiles": [ "${workspaceRoot}\\features\\step_definitions\\*.js" ] }, However, I am not able run a debug session using the above configuration. The step

cucumber-js and Chai how to expect if element with given selector exist in DOM

可紊 提交于 2020-01-11 04:53:12
问题 I have a problem with cucumberjs. I cannot find a way to ensure that element with given selector is presented into DOM. I'm using cucumberjs with Chai. https://github.com/cucumber/cucumber-js isPresent returns object - no matter if the element exists or not. So the question is how to check if element is present in DOM. I will edit the question to share one learned lesson. I read the documentation also want to thanks to Nathan Thompson. isPresent() returns a promise that will resolve to

webdriverio Set getText string to variable

a 夏天 提交于 2020-01-04 17:54:59
问题 I'm currently trying to instantiate a variable with the contents of the getText method using webdriverio. a = String(browser.getText('.field_notice')); When I attempt to print the variable this is the output: [object Object] Thanks for the help! 回答1: browser.getText() is an asynchronous call so you will need to provide a callback to instantiate your variable. Try this : browser .getText('.field_notice').then(function(text) { a = text; }); A similar example can be found on the Webdriverio

webdriverio Set getText string to variable

人走茶凉 提交于 2020-01-04 17:53:27
问题 I'm currently trying to instantiate a variable with the contents of the getText method using webdriverio. a = String(browser.getText('.field_notice')); When I attempt to print the variable this is the output: [object Object] Thanks for the help! 回答1: browser.getText() is an asynchronous call so you will need to provide a callback to instantiate your variable. Try this : browser .getText('.field_notice').then(function(text) { a = text; }); A similar example can be found on the Webdriverio

How can I use WebStorm to create a Cucumber step definition file in TypeScript instead of JavaScript?

岁酱吖の 提交于 2020-01-02 12:16:46
问题 I'm building a new e2e test suite using Cucumber.js and I'd like to use TypeScript for my step files. When I create a new step and I press Alt+Enter to have WebStorm generate a new step file the only option I am presented with is to create a JavaScript file. Does anyone know how I can make this create a new step file in TypeScript? 回答1: Webstorm doesn't seem to provide a wizard for file type "TypeScript" so you might want to create your step definition file manually. For the Simple Math

protractor config file is not picking up the cucumber step definitions

≡放荡痞女 提交于 2019-12-30 07:33:09
问题 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 = {

Cannot add new Given/When/Then, getting error `SyntaxError: Invalid regular expression: missing /`

て烟熏妆下的殇ゞ 提交于 2019-12-25 16:56:16
问题 I had configured cucumber + protractor, and I firstly was splitting stepDefinitions into different files like this: When I created new features files, and started running, cucumber/protractor did not recognized these new steps I was adding to the other files. So I decided to move all the new steps into the same file. But when I run, although they are well written (checked and compared thousands of times) I getting this error: [launcher] Error: /Users/brunosoko/Documents/Dev/Personal/test2

Multiple Step Definitions match error in Cucumber

霸气de小男生 提交于 2019-12-25 11:05:47
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

Multiple Step Definitions match error in Cucumber

只谈情不闲聊 提交于 2019-12-25 11:05:22
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

cucumber webdriverio datatable

旧时模样 提交于 2019-12-25 02:34:06
问题 FeatureFile Feature: Shopper can add an item to their Grocery List @kk Scenario: Mutate multiple User Skills at the same time Then If I click the row "Summary" then I should the following nested information` | Tax | 11.50 | | Gratuity | 4.50 | | Total | 26.59 | StepDefininition File Then(/^If I click the row "([^"]*)" then I should the following nested information$/, function (rowName, data){ cconsole.log("rowName-----"+rowName) console.log("data-----"+data) data = dataTable.raw(); console