Cucumber Features

Expand All

Collapse All

Feature: Making a basic request to the Expungement Generator api

features/api_features/a_basic_request.feature:3

Scenario: Making a simple request

  1. Given I have an empty set of parameters for my request
    features/step_definitions/basic_request_steps.rb:2
  2. And a person's first name and last name
    features/step_definitions/basic_request_steps.rb:6
  3. And the person's date of birth
    features/step_definitions/basic_request_steps.rb:11
  4. And my Expungement Generator username
    features/step_definitions/basic_request_steps.rb:15
  5. And my organization's Expungement generator api key
    features/step_definitions/basic_request_steps.rb:19
  6. And I have set cpcmsSearch to "false"
    features/step_definitions/basic_request_steps.rb:23
  7. And I have a list of docket numbers to search
    features/step_definitions/basic_request_steps.rb:27
  8. And I have set createPetitions to 1
    features/step_definitions/basic_request_steps.rb:35
  9. And I have set emailPetitions to "T"
    features/step_definitions/basic_request_steps.rb:31
  10. And I have set a social security number of "111223333"
    features/step_definitions/basic_request_steps.rb:39
  11. And I have set a street of "123 Apt. 4b Blue St."
    features/step_definitions/basic_request_steps.rb:43
  12. And I have set a city of "Rainbow City"
    features/step_definitions/basic_request_steps.rb:47
  13. And I have set a state of "AA"
    features/step_definitions/basic_request_steps.rb:51
  14. And I have set a zip of "12345"
    features/step_definitions/basic_request_steps.rb:55
  15. When I submit my request to the expungement Generator
    features/step_definitions/basic_request_steps.rb:59
  16. Then the api returns an object that validates against the schema
    features/step_definitions/steps.rb:50
    {
    	"$schema": "http://json-schema.org/draft-04/schema#",
        "type":"object",
        "properties": {
          "personFirst":{"type":"string"},
          "personLast":{"type":"string"},
          "dob":{"type":"string"},
          "results":{
              "type":"object",
              "properties": {
                  "dockets":{"type":"array"},
                  "arrestCount":{"type":"intager"},
                  "sealing": {"type":"array"},
                  "expungementZip":{"type":"string"},
                  "expungements_redactions":{
                        "oneOf":[
                          {"type":"string"},
                          {"type":"array"}
                        ]
                  }
              },
              "required":["dockets","arrestCount","expungements_redactions"]
          }
        },
        "required":["personFirst","personLast","dob","results"]
    }
  17. And the response code is 200
    features/step_definitions/steps.rb:58

Feature: Collect expungeable arrests by conducting a search of the CPCMS database

features/api_features/cpcms_search.feature:3

Scenario: Generate a petition from a list of dockets

  1. Given (SKIP THIS) I have an otherwise valid request
    features/step_definitions/skip_scenario.rb:1
  2. And createPetitions=1
    features/step_definitions/steps.rb:19
  3. When the user makes a request from the api for a CPCMS search
    features/step_definitions/cpcms_search_steps.rb:1
  4. Then the api returns an object that validates against the schema
    features/step_definitions/steps.rb:50
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
        "type":"object",
        "properties": {
          "personFirst":{"type":"string"},
          "personLast":{"type":"string"},
          "dob":{"type":"string"},
          "results":{
              "type":"object",
              "properties": {
                  "dockets":{"type":"array"},
                  "arrestCount":{"type":"intager"},
                  "sealing": {"type":"array"},
                  "expungementZip":{"type":"string"},
                  "expungements_redactions":{
                        "oneOf":[
                          {"type":"string"},
                          {"type":"array"}
                        ]
                  }
              },
              "required":["dockets","arrestCount","expungements_redactions"]
          }
        },
        "required":["personFirst","personLast","dob","results"]
    }
  5. And the response code is 200
    features/step_definitions/steps.rb:58
features/api_features/cpcms_search.feature:38

Scenario: Generate a list of expungeable arrests from a list of dockets, but do not generate a petition.

  1. Given (SKIP THIS) I have an otherwise valid request
    features/step_definitions/skip_scenario.rb:1
  2. And createPetitions=0
    features/step_definitions/steps.rb:19
  3. When the user makes a request from the api for a CPCMS search
    features/step_definitions/cpcms_search_steps.rb:1
  4. Then the api returns an object that validates against the schema
    features/step_definitions/steps.rb:50
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
        "type":"object",
        "properties": {
          "personFirst":{"type":"string"},
          "personLast":{"type":"string"},
          "dob":{"type":"string"},
          "results":{
              "type":"object",
              "properties": {
                  "dockets":{"type":"array"},
                  "arrestCount":{"type":"intager"},
                  "sealing": {"type":"array"},
                  "expungementZip":{"type":"string"},
                  "expungements_redactions":{
                        "oneOf":[
                          {"type":"string"},
                          {"type":"array"}
                        ]
                  }
              },
              "required":["dockets","arrestCount","expungements_redactions"]
          }
        },
        "required":["personFirst","personLast","dob","results"]
    }
  5. And the response code is 200
    features/step_definitions/steps.rb:58

Feature: Collect expungeable arrests for a person from a list of docket numbers

features/api_features/docket_only_search.feature:3

Scenario: Generate a petition from a list of dockets

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. And createPetitions=1
    features/step_definitions/steps.rb:19
  3. When the user makes a request from the api for a nonCPCMS search
    features/step_definitions/docket_only_search_steps.rb:24
  4. Then the api returns an object that validates against the schema
    features/step_definitions/steps.rb:50
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
        "type":"object",
        "properties": {
          "personFirst":{"type":"string"},
          "personLast":{"type":"string"},
          "dob":{"type":"string"},
          "results":{
              "type":"object",
              "properties": {
                  "dockets":{"type":"array"},
                  "arrestCount":{"type":"intager"},
                  "sealing": {"type":"array"},
                  "expungementZip":{"type":"string"},
                  "expungements_redactions":{
                        "oneOf":[
                          {"type":"string"},
                          {"type":"array"}
                        ]
                  }
              },
              "required":["dockets","arrestCount","expungements_redactions"]
          }
        },
        "required":["personFirst","personLast","dob","results"]
    }
  5. And the response code is 200
    features/step_definitions/steps.rb:58
features/api_features/docket_only_search.feature:38

Scenario: Generate a list of expungable arrests but do not generate a petition.

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. And createPetitions=0
    features/step_definitions/steps.rb:19
  3. When the user makes a request from the api for a nonCPCMS search
    features/step_definitions/docket_only_search_steps.rb:24
  4. Then the api returns an object that validates against the schema
    features/step_definitions/steps.rb:50
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
        "type":"object",
        "properties": {
          "personFirst":{"type":"string"},
          "personLast":{"type":"string"},
          "dob":{"type":"string"},
          "results":{
              "type":"object",
              "properties": {
                  "dockets":{"type":"array"},
                  "arrestCount":{"type":"intager"},
                  "sealing": {"type":"array"},
                  "expungementZip":{"type":"string"},
                  "expungements_redactions":{
                        "oneOf":[
                          {"type":"string"},
                          {"type":"array"}
                        ]
                  }
              },
              "required":["dockets","arrestCount","expungements_redactions"]
          }
        },
        "required":["personFirst","personLast","dob","results"]
    }
  5. And the response code is 200
    features/step_definitions/steps.rb:58

Feature: Define the email address that should receive generated Petitions

features/api_features/email_builder.feature:4

Scenario: Email generated petitions to a legalserver caseid.

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. And I have set emailAddressField to "id"
    features/step_definitions/steps.rb:62
  3. And I have set id to a case number
    features/step_definitions/steps.rb:66
  4. And I have set emailDomain to the domain I want to email to
    features/step_definitions/steps.rb:70
  5. And I have set cpcmsSearch to "False"
    features/step_definitions/basic_request_steps.rb:23
  6. And I have set createPetitions to 1
    features/step_definitions/basic_request_steps.rb:35
  7. And I have set emailPetitions to "True"
    features/step_definitions/basic_request_steps.rb:31
  8. When I submit my request to the expungement Generator
    features/step_definitions/basic_request_steps.rb:59
  9. Then the generator sends an email to an address made from the value of "id" at the value of "emailDomain"
    features/step_definitions/steps.rb:75

Feature: Return helpful error messages when request data is missing or invalid.

# Missing required parameters.
features/api_features/invalid_request.feature:6

Scenario: Missing API key

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I do not provide the api key
    features/step_definitions/steps.rb:15
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results":{
        "status": "Key missing from request."
      }
    }
  5. And the response code is 400
    features/step_definitions/steps.rb:58
features/api_features/invalid_request.feature:20

Scenario: Missing user email

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I have not provided an email address
    features/step_definitions/bad_request_steps.rb:10
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results": {
        "status": "User email missing from request."
        }
    }
  5. And the response code is 400
    features/step_definitions/steps.rb:58
features/api_features/invalid_request.feature:34

Scenario: Missing createPetitions flag

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I have not included the createPetitions flag in my request
    features/step_definitions/steps.rb:23
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results":{
        "status": "Should I create petitions? Please include createPetitions=[0|1] in your request."
      }
    }
  5. And the response code is 400
    features/step_definitions/steps.rb:58
# Invalid parameters
features/api_features/invalid_request.feature:50

Scenario: Invalid api key

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I have an invalid api key
    features/step_definitions/bad_request_steps.rb:3
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results": {
        "status": "Invalid request."
        }
    }
  5. And the response code is 401
    features/step_definitions/steps.rb:58
features/api_features/invalid_request.feature:65

Scenario: User email not in database

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I am using an email that has no account in the database
    features/step_definitions/steps.rb:27
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results": {
        "status": "Invalid request."
      }
    }
  5. And the response code is 401
    features/step_definitions/steps.rb:58
features/api_features/invalid_request.feature:79

Scenario: CPCMS search set to false but no dockets provided.

  1. Given I have an otherwise valid request
    features/step_definitions/steps.rb:2
  2. But I have set CPCMS to false and have not provided any docket numbers
    features/step_definitions/steps.rb:31
  3. When I submit my request
    features/step_definitions/steps.rb:40
  4. Then the api returns
    features/step_definitions/steps.rb:36
    {
      "results": {
        "status": "If you do not wish to do a CPCMS search, then you must supply docket numbers."
      }
    }
  5. And the response code is 400
    features/step_definitions/steps.rb:58

Feature: Request a file from the api

features/api_features/request_file.feature:3

Scenario: Make a valid request to download an expungement petition.

  1. Given I know a particular petition has been generated
    features/step_definitions/file_request_steps.rb:1
  2. And I request that petition using the right apikey and username
    features/step_definitions/file_request_steps.rb:24
  3. Then I receive the file in respose
    features/step_definitions/file_request_steps.rb:36
  4. And the response code is "200"
    features/api_features/request_file.feature:7
    Then("the response code is {string}") do |string|
      pending # Write code here that turns the phrase above into concrete actions
    end

Feature: Use a browser to find expungeable arrests and generate an expungement petition.

features/browser_features/browser_interface.feature:3

Scenario: Visit the EG webpage

  1. When I visit the expungement generator site
    features/step_definitions/browser_steps.rb:1
  2. Then I see "Login by clicking here."
    features/step_definitions/browser_steps.rb:5
  3. And I see a link to help information
    features/step_definitions/browser_steps.rb:9
features/browser_features/browser_interface.feature:8

Scenario: Visit Log in page

  1. When I visit the expungement generator site
    features/step_definitions/browser_steps.rb:1
  2. And I click the link "Login by clicking here"
    features/step_definitions/browser_steps.rb:65
  3. Then I see a login page
    features/step_definitions/browser_steps.rb:17
  4. And I see an email address box
    features/step_definitions/browser_steps.rb:21
  5. And I see a password box
    features/step_definitions/browser_steps.rb:25
features/browser_features/browser_interface.feature:15

Scenario: Log in as a valid user

  1. When I visit the expungement generator site
    features/step_definitions/browser_steps.rb:1
  2. And I click the link "Login by clicking here"
    features/step_definitions/browser_steps.rb:65
  3. And I enter a valid user login
    features/step_definitions/browser_steps.rb:30
  4. And I enter a valid user password
    features/step_definitions/browser_steps.rb:35
  5. And I click login
    features/step_definitions/browser_steps.rb:39
  6. Then I see "You are logged in as" and my username
    features/step_definitions/browser_steps.rb:43
features/browser_features/browser_interface.feature:23

Scenario: Start a search for dockets

  1. Given I have logged into the Expungement Generator as a user
    features/step_definitions/browser_steps.rb:48
  2. When I click the link "Click here to start preparing expungement petitions"
    features/step_definitions/browser_steps.rb:65
  3. Then I see a form for entering information about a person.
    features/step_definitions/browser_steps.rb:56
features/browser_features/browser_interface.feature:28

Scenario: (SKIP THIS) Search for arrests with a CPCM searach

  1. Given I have logged into the Expungement Generator as a user
    features/step_definitions/browser_steps.rb:48
  2. When I click the link "Click here to start preparing expungement petitions"
    features/step_definitions/browser_steps.rb:65
  3. And I fill in a person's name, date of birth, address, and ssn
    features/step_definitions/browser_steps.rb:69
  4. And I select the radio button "Search CPCMS for me"
    features/step_definitions/browser_steps.rb:80
  5. And I click the button "Start Expunging"
    features/step_definitions/browser_steps.rb:84
  6. Then I see a table of docket numbers with links to the dockets
    features/step_definitions/browser_steps.rb:88
  7. And I see a disclaimer about the limitations of the Generator
    features/step_definitions/browser_steps.rb:93
  8. And I see a link to the Summary Docket and MDJ Summary Docket
    features/step_definitions/browser_steps.rb:98
  9. And I see a button to redo the cpcms search
    features/step_definitions/browser_steps.rb:103
  10. And I see a button to expunge records
    features/step_definitions/browser_steps.rb:107
features/browser_features/browser_interface.feature:40

Scenario: Generate Expungements after a CPCMS search

  1. Given I have logged into the Expungement Generator as a user
    features/step_definitions/browser_steps.rb:48
  2. When I click the link "Click here to start preparing expungement petitions"
    features/step_definitions/browser_steps.rb:65
  3. And I fill in a person's name, date of birth, address, and ssn
    features/step_definitions/browser_steps.rb:69
  4. And I select the radio button "Search CPCMS for me"
    features/step_definitions/browser_steps.rb:80
  5. And I click the button "Start Expunging"
    features/step_definitions/browser_steps.rb:84
  6. And I click the button "Expunge"
    features/step_definitions/browser_steps.rb:84
  7. Then I see "EXPUNGEMENT INFORMATION"
    features/step_definitions/browser_steps.rb:5
  8. And I see a table listing possible expungements
    features/step_definitions/browser_steps.rb:111
  9. And I see a link to download an expungement petition
    features/step_definitions/browser_steps.rb:115