data:
# language: en
@checkout @smoke
Feature: Checkout totals
  As a shopper
  I want the cart total to include tax and discounts
  So that I am never surprised at the payment step

  Background:
    Given the catalogue contains:
      | sku     | name             | price |
      | NX-1042 | Sample desk lamp | 12.99 |
      | NX-2087 | Sample notebook  |  4.50 |
    And the tax rate is 20 percent

  @pricing
  Scenario: A single-item cart shows tax separately
    Given my cart is empty
    When I add 1 of "NX-1042"
    Then the subtotal is "12.99"
    And the tax is "2.60"
    And the total is "15.59"

  @pricing @outline
  Scenario Outline: Quantity multiplies the subtotal
    Given my cart is empty
    When I add <quantity> of "<sku>"
    Then the subtotal is "<subtotal>"

    Examples: whole units
      | sku     | quantity | subtotal |
      | NX-1042 |        1 |    12.99 |
      | NX-1042 |        3 |    38.97 |
      | NX-2087 |        2 |     9.00 |

    @edge
    Examples: boundary quantities
      | sku     | quantity | subtotal |
      | NX-1042 |        0 |     0.00 |

  @receipt
  Scenario: The receipt renders as plain text
    Given my cart contains 1 of "NX-1042"
    When I request the receipt
    Then the receipt reads:
      """
      Novus Checkout SAMPLE receipt
      1 x Sample desk lamp        12.99
      Tax (20 percent)             2.60
      Total                       15.59
      """


Checkout totals

keyword: Feature

description:
  As a shopper
  I want the cart total to include tax and discounts
  So that I am never surprised at the payment step

keyword: Background

keyword: Given

keywordType: Context

text: the catalogue contains:

keyword: And

keywordType: Conjunction

text: the tax rate is 20 percent

A single-item cart shows tax separately

keyword: Scenario

Quantity multiplies the subtotal

keyword: Scenario Outline

whole units

keyword: Examples


A single-item cart shows tax separately

type: Context

text: step 1 of A single-item cart shows tax separately

text: step 2 of A single-item cart shows tax separately

type: Action

text: step 3 of A single-item cart shows tax separately

text: step 4 of A single-item cart shows tax separately

text: step 5 of A single-item cart shows tax separately

text: step 6 of A single-item cart shows tax separately

text: step 7 of A single-item cart shows tax separately


Quantity multiplies the subtotal

text: step 1 of Quantity multiplies the subtotal

text: step 2 of Quantity multiplies the subtotal

text: step 3 of Quantity multiplies the subtotal

text: step 4 of Quantity multiplies the subtotal

text: step 5 of Quantity multiplies the subtotal


The receipt renders as plain text

text: step 1 of The receipt renders as plain text

text: step 2 of The receipt renders as plain text

text: step 3 of The receipt renders as plain text

text: step 4 of The receipt renders as plain text

text: step 5 of The receipt renders as plain text