Responsible Marketing for Online Content

We spend hours designing a site, and we think long and hard about what kind of things we want to sell, we make sure everything looks great, and then people come along and use adblock. It’s…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Running a Subset of Scenarios

The Cucumber Book, Second Edition — by Matt Wynne, Aslak Hellesøy, with Steve Tooke (87 / 136)

👈 Cucumber’s Command-Line Options | TOC | Changing Cucumber’s Output 👉

As the number of features and scenarios grows, we’ll frequently run into situations where we want to run only a single (or maybe a couple) of scenarios to get faster feedback. This can be if we are working on a new scenario or if we have broken an existing one. Let’s take a closer look at how this works.

The simplest way to use the — tags option is to give it a single tag to run, for example:

This would cause Cucumber to run just the scenarios tagged with @focus. It’s quite common to temporarily tag a scenario or feature with a unique tag like this to filter what to run.

In some situations, we may want a little more control over the tag filtering. Imagine that we have made some changes to a piece of our application that sends out emails. What if we want to run all scenarios tagged with @focus or @email? Here is how:

If the feature file has more than one scenario, it will run only the one on line 45. The line number can be anywhere in the feature, ranging from a comment line to the last step (including a step table or doc string).

You have probably noticed that Cucumber prints out the location of a feature file with the line number in error messages.

If you want to rerun the scenario that failed, just select the text and paste it:

This is equivalent to using the — line option. The colon notation also allows you to specify several line numbers, allowing you to specify several scenarios to run:

If you prefer, you can also do this using the — lines argument. Cucumber doesn’t mind whether you say — line or — lines.

Add a comment

Related posts:

Cylinder Mazes

Unlock the secrets to creating random mazes! Whether you're a game developer, an algorithm connoisseur, or simply in search of a new puzzle, you're about to level up. Learn algorithms to randomly generate mazes in a variety of shapes, sizes, and dimensions. Bend them into Moebius strips, fold them into cubes, and wrap them aroun

SecondLive

SecondLive.World is a virtual platform that offers its users the opportunity to participate in an online community, interact with other members, and create their own virtual experiences. The platform…

Real Conversations With Potential Landlords

Our area has a ridiculously low vacancy rate. So, tenants are desperate and landlords pretty much do what they want. Here are some highlights from our housing search: Me: We’re interested in renting…