Forum

Stay updated with latest on Boozang

Forum Navigation
You need to log in to create posts and topics.

How to write data-driven Cucumber tests

Sometimes it's great to use the Examples key-word to drive data loops. It's bad practice to over-use data in the Feature file - only put that that is relevant to the business, not developer test-data.

Also, use n-wise/pairwise testing practices to reduce the number of data rows.

@Discount

Feature: Discount Management
This feature covers the basic discount scenarios.@Smoke @Debug
Scenario Outline: Order product with different discounts

"""
Orders a product with different discounts

"""
Given I am a brewer
and I add a product
and I set inventory to price <price>, discount dollars <discount_dollars>,
percentage <discount_percentage>, and special price <special_price>
When I order <order_quantity> products
Then the order details should have subtotal <subtotal>

Examples:

|price|order_quantity|discount_dollars|discount_percentage|special_price|subtotal|
|20.00|1             |5.99            |bz-skip            |bz-skip      |14.01   |
|10.00|1             |bz-skip         |25                |bz-skip      |7.50    |
|32.99|1             |bz-skip        |bz-skip            |8.99         |8.99    |
|9.81 |10            |bz-skip        |15                 |bz-skip      |83.39  |
|7.15 |10            |bz-skip         |15                |bz-skip      |60.78   |

 

 

Try Boozang today

Codeless testing that works. No credit card or commitment required.

Boozang
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.