<commit_before>@buy
Feature: Returning user cancels order
  As a returning user of blinkbox books
  I want to the ability to cancel order
  So that I can cancel unwanted order.

  Background:
    Given I am returning user with saved payment details

  Scenario Outline: Returning user paying with saved card, user cancels order
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  Scenario Outline: Returning user paying with new payment, user cancels order
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And I choose to pay with a new card
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  @CWA-980
  Scenario Outline: Returning user's new payment has failed, user cancels order
    Given PENDING: CWA-980 Buy Process - Cancel Option - No Buttons
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And my payment failed at Braintree for not matching CVV
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  Scenario Outline: Returning user has validation errors for new payment details, user cancels orders
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And I choose to pay with a new card
    And I have validation error messages on the page
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page
<commit_msg>Marking a scenario pending for CWA-980<commit_after>@buy
Feature: Returning user cancels order
  As a returning user of blinkbox books
  I want to the ability to cancel order
  So that I can cancel unwanted order.

  Background:
    Given I am returning user with saved payment details

  Scenario Outline: Returning user paying with saved card, user cancels order
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  Scenario Outline: Returning user paying with new payment, user cancels order
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And I choose to pay with a new card
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  @CWA-980
  Scenario Outline: Returning user's new payment has failed, user cancels order
    #Given PENDING: CWA-980 Buy Process - Cancel Option - No Buttons
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And my payment failed at Braintree for not matching CVV
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

  Examples:
    | page_name      | book_type |
    | Home           | pay for   |
    | Search results | pay for   |
    | Book details   | pay for   |
    | Category       | pay for   |
    | Bestsellers   | pay for   |
    | New releases   | pay for   |

  Scenario Outline: Returning user has validation errors for new payment details, user cancels orders
    Given I have selected to buy a <book_type> book from <page_name> page
    And I sign in to proceed with purchase
    And I choose to pay with a new card
    And I have validation error messages on the page
    When I cancel order
    And confirm cancel order
    Then I am redirected to <page_name> page

{'fraction_non_alphanumeric': 0.04484126984126984, 'fraction_numerical': 0.002976190476190476, 'mean_word_length': 2.340622929092114, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1396, 'n_words': 693}