cucumber

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

How can I test different environments (e.g. development|test|production) in Cucumber?

一笑奈何 提交于 2020-01-02 07:59:42
问题 Take this scenario. I have a Google Analytics tracking code, and I only want it to show up in Production mode. So I might have two scenarios like this: Scenario: Don't embed tracking code in development or test mode Given the app is not in production mode When I go home Then I should really not see the tracking code Scenario: Embed tracking code in production mode Given the app is in production mode When I go home Then I should really see the tracking code So although I know how to check what

How to Populate Lookup tables in Testing (Rails)

孤街醉人 提交于 2020-01-02 05:06:10
问题 I am using Cucumber, Rspec, and Factory Girl for the testing of my Rails Application. But I have several lookup tables that contain mostly static data. So I'm trying to figure out the best way to populate these when testing. Doing them individually in FactoryGirl seems tedious and I'd like to stay away from Fixtures. For development and production, I populate them in my seeds.rb file. Thanks! 回答1: Use Factory Girl .sequence, Populator and Faker and you'll never run out of lab rats! Factory

How do you run cucumber with Scala 2.11 and sbt 0.13?

拈花ヽ惹草 提交于 2020-01-02 02:24:46
问题 Does anyone have an example of a cucumber project with sbt 0.13 and Scala 2.11? Do I need both the cucumber-scala_2.11 and the sbt-cucumber-plugin" % "0.8.0" (is that plugin up to date)? Where does the plugin go now? Where do the .feature files go? Where do the cucumber tests go? How do I run the tests from sbt? (optional) How can I run the tests from IntellJ (15)? 回答1: Ok, I figured out a solution with the following caveat: I'm not using sbt. Idea We will write cucumber features and steps

Running a login step prior to scenario outline in cucumber

泄露秘密 提交于 2020-01-02 02:09:03
问题 I'm using cucumber with webrat/mechanize to test a PHP site and I'm trying to improve the speed the tests run by avoiding running unnecessary steps. I want to use a scenario outline to check a whole lot of pages are accessible/protected depending on the user who is logged in: Scenario Outline: Check page access is secure Given I am logged in as "<user>" And I am on <page> Then I should see "<message>" Examples: |user |page |message | |admin |home page |Welcome to my site | |admin |admin page

Running a login step prior to scenario outline in cucumber

亡梦爱人 提交于 2020-01-02 02:07:24
问题 I'm using cucumber with webrat/mechanize to test a PHP site and I'm trying to improve the speed the tests run by avoiding running unnecessary steps. I want to use a scenario outline to check a whole lot of pages are accessible/protected depending on the user who is logged in: Scenario Outline: Check page access is secure Given I am logged in as "<user>" And I am on <page> Then I should see "<message>" Examples: |user |page |message | |admin |home page |Welcome to my site | |admin |admin page

Cucumber errors suppressed (not displayed fully)

五迷三道 提交于 2020-01-02 02:00:09
问题 I just installed cucumber, and I tested it. I got the following error: teefcomp:cucumber-intro teef$ cucumber features/manage_users.feature Using the default profile... F----F Failing Scenarios: cucumber features/manage_users.feature:6 # Scenario: User List 1 scenario (1 failed) 4 steps (4 skipped) 0m0.029s It seems to be suppressing the error. I was expecting something like: Feature: Manage users In order to understand my user base better As an administrator I want to view a list of users

IntelliJ Shorten Command Line for Cucumber Tests [duplicate]

梦想与她 提交于 2020-01-02 01:02:51
问题 This question already has answers here : How to configure “Shorten command line” method for whole project in IntelliJ (4 answers) Closed 13 days ago . I've encountered an issue running Cucumber tests in IntelliJ. When I try to run a feature or scenario, I get the following error: "Error running 'Feature <feature>': Command line is too long. Shorten command line for Feature: <feature> or also for Cucumber java default configuration" I know as part of IntelliJ's 2017.3 release, they added

selenium grid with cucumber

大兔子大兔子 提交于 2020-01-01 18:30:17
问题 I am trying to setup selenium grid to achieve parallel execution of my tests. First, I'll explain the my current scenario. I have my fully functional test suite written in cucumber with watir webdriver I need to execute all my tests in multiple environments. I created a setup for selenium hub and node I can run my tests on a single node through hub My goal is to run my tests on multiple vm's simultaneously. I missing a part where I need to configure my tests to run in parallel. there are some

How to skip Cucumber steps?

梦想与她 提交于 2020-01-01 10:11:52
问题 I have the scenario like: Given I go to this page When I type cucumber And I click Then I should see the text And I should not see the line If I run this scenario it will execute all the 5 steps. But I want to skip the 4th step (Then I should see the text) and execute the 5th step. Please give me your suggestions. Thanks in advance. :) 回答1: TL;DR - don't do it - you're (probably) getting it wrong. And you can't (easily) do it. As Aslak wrote (one of Cucumber main creators): A step can have