<commit_before>Feature: As Charlie
  In order to have an issue discussed in parliament
  I want to be able to create a petition and verify my email address.

@search
Scenario: Charlie has to search for a petition before creating one
  Given a petition "Rioters should loose benefits"
  Given I am on the home page
  When I follow "Start a petition"
  Then I should be asked to search for a new petition
  When I check for similar petitions
  Then I should see a list of existing petitions I can sign
  When I choose to create a petition anyway
  Then I should be on the new petition page
  And I should see my search query already filled in as the action of the petition

@search
Scenario: Charlie cannot craft an xss attack when searching for petitions
  Given I am on the home page
  When I follow "Start a petition"
  Then I fill in "q" with "'onmouseover='alert(1)'"
  When I press "Check for similar petitions"
  Then the markup should be valid

Scenario: Charlie creates a petition
  Given I start a new petition
  And I fill in the petition details
  And I press "Preview petition"
  And I press "This looks good"
  And I fill in my details
  When I press "Sign this petition"
  Then the markup should be valid
  And I am asked to review my email address
  When I press "Yes - this is my email address"
  Then a petition should exist with action: "The wombats of wimbledon rock.", state: "pending"
  And there should be a "pending" signature with email "<EMAIL>" and name "<NAME>"
  And "<NAME>" wants to be notified about the petition's progress
  And "<EMAIL>" should be emailed a link for gathering support from sponsors

Scenario: First person sponsors a petition
  When I have created a petition and told people to sponsor it
  And a sponsor supports my petition
  Then my petition should be validated
  And the petition creator signature should be validated<commit_msg>Defining the location of the start button<commit_after>Feature: As Charlie
  In order to have an issue discussed in parliament
  I want to be able to create a petition and verify my email address.

@search
Scenario: Charlie has to search for a petition before creating one
  Given a petition "Rioters should loose benefits"
  Given I am on the home page
  When I follow "Start a petition" within ".//main"
  Then I should be asked to search for a new petition
  When I check for similar petitions
  Then I should see a list of existing petitions I can sign
  When I choose to create a petition anyway
  Then I should be on the new petition page
  And I should see my search query already filled in as the action of the petition

@search
Scenario: Charlie cannot craft an xss attack when searching for petitions
  Given I am on the home page
  When I follow "Start a petition" within ".//main"
  Then I fill in "q" with "'onmouseover='alert(1)'"
  When I press "Check for similar petitions"
  Then the markup should be valid

Scenario: Charlie creates a petition
  Given I start a new petition
  And I fill in the petition details
  And I press "Preview petition"
  And I press "This looks good"
  And I fill in my details
  When I press "Sign this petition"
  Then the markup should be valid
  And I am asked to review my email address
  When I press "Yes - this is my email address"
  Then a petition should exist with action: "The wombats of wimbledon rock.", state: "pending"
  And there should be a "pending" signature with email "<EMAIL>" and name "<NAME>"
  And "<NAME>" wants to be notified about the petition's progress
  And "<EMAIL>" should be emailed a link for gathering support from sponsors

Scenario: First person sponsors a petition
  When I have created a petition and told people to sponsor it
  And a sponsor supports my petition
  Then my petition should be validated
  And the petition creator signature should be validated
{'fraction_non_alphanumeric': 0.03659174072138003, 'fraction_numerical': 0.0005227391531625719, 'mean_word_length': 3.8017565872020076, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6122841', 'n_tokens_mistral': 984, 'n_tokens_neox': 951, 'n_words': 645}