Skip to content

Commit

Permalink
Merge branch 'main' of github.com:IllinoisLegalAidOnline/docassemble-…
Browse files Browse the repository at this point in the history
…USCISApplications into feature-217-add-haiti-addendum
  • Loading branch information
ll-jgraszer committed Sep 21, 2024
2 parents 5ba7066 + faecdd6 commit 0708cff
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 62 deletions.
61 changes: 51 additions & 10 deletions .github/workflows/github_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ jobs:
matrix:
node-version: [20.x]

#env:
# SECRET_VAR1: secret-var1-value
# SECRET_VAR2: secret-var2-value
# SECRET_FOR_MISSING_FIELD: secret for missing field
env:
NORMAL_USER_EMAIL: alkiln@example.com
NORMAL_USER_PASSWORD: User123^

steps:
#### Developer note: You probably don't need this
# Place the root directory in this branch to access
# relative paths to action files
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: ALKiln - Start the isolated temporary docassemble server on GitHub
id: github_server
Expand All @@ -54,11 +53,53 @@ jobs:
- run: echo "ALKiln finished starting the isolated GitHub docassemble server"
shell: bash

# #### Developer note: You probably don't need this
# # Optional debugging to explore things like config issues
# - name: Docker debug tmate session
# if: ${{ github.event.inputs.enable_tmate }}
# uses: mxschmitt/action-tmate@v3
#### Developer note: You can probably leave this out
- name: "Add a low-level user and their API key (in an env var)"
env:
SERVER_URL: "${{ steps.github_server.outputs.SERVER_URL }}"
KEY: ${{ steps.github_server.outputs.DOCASSEMBLE_DEVELOPER_API_KEY }}
run: |
# Create user and their API key
# Install json processor
sudo apt-get install jq
# https://docassemble.org/docs/api.html#user_new
user_data=$(curl -X POST \
${{ env.SERVER_URL }}/api/user/new \
-H 'Content-Type: application/json' \
-d '{
"key": "${{ env.KEY }}",
"username": "${{ env.NORMAL_USER_EMAIL }}",
"password": "${{ env.NORMAL_USER_PASSWORD }}"
}')
echo "User data:"
echo "$user_data"
user_id=$(echo "$user_data" | jq '.user_id' -r)
# https://docassemble.org/docs/api.html#api_user_user_id_api_post
new_key_with_quotes=$(curl -X POST \
${{ env.SERVER_URL }}/api/user/"$user_id"/api \
-H 'Content-Type: application/json' \
-d '{
"key": "${{ env.KEY }}",
"name": "alkiln_key",
"method": "none"
}')
echo "new key (watch out, this contains actual quotation marks): $new_key_with_quotes"
no_end_quote="${new_key_with_quotes%\"}"
unquoted="${no_end_quote#\"}"
echo "unquoted: $unquoted"
echo "NORMAL_USER_API_KEY=$unquoted" >> "$GITHUB_ENV"
#### Developer note: You can probably leave this out
## Optional debugging to explore things like docker issues
#- name: Docker debug tmate session
# #if: ${{ failure() && github.event.inputs.enable_tmate == 'true' }}
# uses: mxschmitt/action-tmate@v3

#### Developer note: You can probably leave this out
- name: "Create other env vars for our own tests from server output"
run: |
echo "USER1_EMAIL=${{ steps.github_server.outputs.DA_ADMIN_EMAIL }}" >> $GITHUB_ENV
echo "USER1_PASSWORD=${{ steps.github_server.outputs.DA_ADMIN_PASSWORD }}" >> $GITHUB_ENV
#### Developer note: You probably don't need this
### Mia: may need this if tests log in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fields:
code: |
users[i].alternate_birthdates.there_is_another = False
---
id: your address
id: your address first
question: |
${ users[0] }'s address
subquestion: |
Expand All @@ -55,16 +55,10 @@ fields:
- ZIP: users[0].address.zip
- Daytime Phone Number (optional): users[0].phone_number
required: false
default: |
${ showifdef("users[i].parent.phone_number") if users[i].age_in_years() < 14 else '' }
- Mobile Telephone Number (optional): users[0].mobile_number
required: false
default: |
${ showifdef("users[i].parent.mobile_number") if users[i].age_in_years() < 14 else '' }
- Email address (optional): users[0].email
required: false
default: |
${ showifdef("users[i].parent.email") if users[i].age_in_years() < 14 else '' }
---
code: |
address_choices = []
Expand Down
102 changes: 58 additions & 44 deletions docassemble/USCISApplications/data/sources/automatedTests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ Scenario: EAD only, 2 applicants
| users[1].country_of_birth | Venezuela | users[0].country_of_birth |
| users[1].birthdate | 11/11/1111 | |
| users[1].last_country_of_residence | Haiti | users[0].last_country_of_residence |
| users[i].signature | | users[0].signature |
| users[i].signature | | users[1].signature |
| users[0].signature | | users[0].signature |
| users[1].signature | | users[1].signature |
| application_kind | ead_only | |

| users[i].ead_required_documents['National ID'] | True | |
| users[i].ead_required_documents['National ID'] | True | users[0].ead_required_documents |
| users[i].ead_required_documents['National ID'] | True | users[1].ead_required_documents |
| users[i].has_additional_citizenship | False | |
| users[i].number_children_applying | 2 | |
| users[i].applied_for_other_immigration_benefit | False | |
Expand All @@ -50,8 +51,11 @@ Scenario: EAD only, 2 applicants
| users[i].in_removal_proceedings | False| |
| users[i].ever_ordered_removed | True | |
| users[i].ever_arrested | False | |
| supervisor_overall_approval_status | approved | |
| supervisor_overall_approval_status | approved | |
| supervisor_name | Supervisor | |
| users[0].addenda['ead_interim_parole'] | True | |
| users[1].addenda['ead_interim_parole'] | True | |
| users[i].is_first_TPS_application | First TPS Application | |
| users[i].user_reads_english | False | |
| users[i].sex | male | |
| users[i].ethnicity | hispanic | |
Expand All @@ -61,6 +65,7 @@ Scenario: EAD only, 2 applicants
| users[i].hair_color | brown | |
| users[i].eye_color | hazel | |
| users[i].marital_status | married | |
| users[i].marriage_date | 11/11/1111 | |
| users[i].alternate_birthdates.there_are_any | False | |
| users[0].address.address | Newbury Street | |
| users[0].address.address_type | apt | |
Expand Down Expand Up @@ -150,9 +155,9 @@ Scenario: EAD, 3 applicants, some are screened
| users[2].country_of_birth | Bahamas | users[2].country_of_birth |
| users[2].birthdate | 11/11/1111 | |
| users[2].last_country_of_residence | Haiti | users[2].last_country_of_residence |
| users[i].signature | | users[0].signature |
| users[i].signature | | users[1].signature |
| users[i].signature | | users[2].signature |
| users[0].signature | | users[0].signature |
| users[1].signature | | users[1].signature |
| users[2].signature | | users[2].signature |
| application_kind | ead_only | |
| users[i].ead_required_documents['National ID'] | True | |
| users[i].has_additional_citizenship | False | |
Expand All @@ -168,6 +173,10 @@ Scenario: EAD, 3 applicants, some are screened
| approved_applications['users[0]']| True | supervisor_overall_approval_status |
| approved_applications['users[1]'] | True | supervisor_overall_approval_status |
| supervisor_name | Supervisor | |
| users[0].addenda['ead_interim_parole'] | True | |
| users[1].addenda['ead_interim_parole'] | True | |
| users[2].addenda['ead_interim_parole'] | True | |
| users[i].is_first_TPS_application | First TPS Application | |
| users[i].user_reads_english | True | |
| users[i].sex | male | |
| users[i].ethnicity | hispanic | |
Expand All @@ -177,6 +186,7 @@ Scenario: EAD, 3 applicants, some are screened
| users[i].hair_color | brown | |
| users[i].eye_color | hazel | |
| users[i].marital_status | married | |
| users[i].marriage_date | 11/11/1111 | |
| users[i].alternate_birthdates.there_are_any | False | |
| users[0].address.address | Newbury Street | |
| users[0].address.address_type | apt | |
Expand Down Expand Up @@ -216,50 +226,52 @@ Scenario: EAD, 1 applicant, some are screened
| users[0].country_of_birth | Bahamas | users[0].country_of_birth |
| users[0].birthdate | 11/11/1111 | |
| users[0].last_country_of_residence | United States | users[0].last_country_of_residence |
| users[i].signature | | users[0].signature |
| users[0].signature | | users[0].signature |

| application_kind | ead_only | |
| users[i].ead_required_documents['National ID'] | True | |
| users[i].has_additional_citizenship | False | |
| users[i].number_children_applying | 0 | |
| users[i].applied_for_other_immigration_benefit | False | |
| users[i].date_of_last_entry | 11/11/1111 | |
| users[i].proof_of_parole | area | |
| users[i].proof_of_parole_valid_for_90_days | True | |
| users[i].in_removal_proceedings | False| |
| users[i].ever_ordered_removed | False | |
| users[i].ever_arrested | False | |
| users[0].ead_required_documents['National ID'] | True | |
| users[0].has_additional_citizenship | False | |
| users[0].number_children_applying | 0 | |
| users[0].applied_for_other_immigration_benefit | False | |
| users[0].date_of_last_entry | 11/11/1111 | |
| users[0].proof_of_parole | area | |
| users[0].proof_of_parole_valid_for_90_days | True | |
| users[0].in_removal_proceedings | False| |
| users[0].ever_ordered_removed | False | |
| users[0].ever_arrested | False | |
| supervisor_overall_approval_status | approved | |
| approved_applications['users[0]']| True | supervisor_overall_approval_status |
| approved_applications['users[1]'] | True | supervisor_overall_approval_status |
| supervisor_name | Supervisor | |
| users[i].user_reads_english | True | |
| users[i].sex | male | |
| users[i].ethnicity | hispanic | |
| users[i].race['white'] | True | |
| users[i].height_cm | 150 | |
| users[i].weight_kg | 150 | |
| users[i].hair_color | brown | |
| users[i].eye_color | hazel | |
| users[i].marital_status | married | |
| users[i].alternate_birthdates.there_are_any | False | |
| users[0].addenda['ead_interim_parole'] | True | |
| users[i].is_first_TPS_application | First TPS Application | |
| users[0].user_reads_english | True | |
| users[0].sex | male | |
| users[0].ethnicity | hispanic | |
| users[0].race['white'] | True | |
| users[0].height_cm | 150 | |
| users[0].weight_kg | 150 | |
| users[0].hair_color | brown | |
| users[0].eye_color | hazel | |
| users[0].marital_status | married | |
| users[0].marriage_date | 11/11/1111 | |
| users[0].alternate_birthdates.there_are_any | False | |
| users[0].address.address | Newbury Street | |
| users[0].address.address_type | apt | |
| users[0].address.city | Boston | |
| users[0].address.state | MA | |
| users[0].address.zip | 02135 | |
| users[i].countries_of_residence.there_are_any | False | |
| users[i].has_passport | True | |
| users[i].date_started_us_residence | 11/11/1111 | |
| users[i].state_of_entry | MA | |
| users[i].immigration_status_last_entry | Parolee | |
| users[i].current_immigration_status | Visitor | |
| users[i].father_first_name | FatherName | |
| users[i].father_last_name | Last | |
| users[i].mother_first_name | MotherName | |
| users[i].mother_last_name | Last | |
| users[i].previously_filed_I765 | True | |
| users[i].has_ssn | False | |
| users[0].countries_of_residence.there_are_any | False | |
| users[0].has_passport | True | |
| users[0].date_started_us_residence | 11/11/1111 | |
| users[0].state_of_entry | MA | |
| users[0].immigration_status_last_entry | Parolee | |
| users[0].current_immigration_status | Visitor | |
| users[0].father_first_name | FatherName | |
| users[0].father_last_name | Last | |
| users[0].mother_first_name | MotherName | |
| users[0].mother_last_name | Last | |
| users[0].previously_filed_I765 | True | |
| users[0].has_ssn | False | |



Expand Down Expand Up @@ -290,11 +302,10 @@ Scenario: TPS, 2 applicants, 1 adult from Venezuela, 1 minor from another countr
| users[1].country_of_birth | Haiti | users[1].country_of_birth |
| users[1].birthdate | 11/11/1111 | |
| users[1].last_country_of_residence | Haiti | users[1].last_country_of_residence |
| users[i].signature | | users[0].signature |
| users[i].signature | | users[1].signature |
| users[0].signature | | users[0].signature |
| users[1].signature | | users[1].signature |
| application_kind | ead_and_tps | |
| users[i].proof_of_birthplace['Birth certificate'] | True | |
| users[i].proof_of_birthplace['Birth certificate'| True | |
| users[i].method_of_entry | Presented at a port of entry | |
| users[i].parents_from_venezuela | False | |
| users[i].one_parent_from_venezuela | False | |
Expand Down Expand Up @@ -338,6 +349,7 @@ Scenario: TPS, 2 applicants, 1 adult from Venezuela, 1 minor from another countr
| approved_applications['users[0]']| True | supervisor_overall_approval_status |
| approved_applications['users[1]'] | True | supervisor_overall_approval_status |
| supervisor_name | Supervisor | |
| users[i].is_first_TPS_application | First TPS Application | |
| users[i].user_reads_english | True | |
| users[i].sex | male | |
| users[i].ethnicity | hispanic | |
Expand All @@ -347,6 +359,7 @@ Scenario: TPS, 2 applicants, 1 adult from Venezuela, 1 minor from another countr
| users[i].hair_color | brown | |
| users[i].eye_color | hazel | |
| users[i].marital_status | married | |
| users[i].marriage_date | 11/11/1111 | |
| users[i].alternate_birthdates.there_are_any | False | |
| users[0].address.address | Newbury Street | |
| users[0].address.address_type | apt | |
Expand All @@ -369,6 +382,7 @@ Scenario: TPS, 2 applicants, 1 adult from Venezuela, 1 minor from another countr
| users[i].date_entered_first_country_year | 1111 | |
| users[i].date_left_last_country_month | 11 | |
| users[i].date_left_last_country_year | 1111 | |
| users[i].lived_in_countries_traveled_through | False | |
| users[i].has_immigration_status_in_countries_traveled_through | False | |
| users[i].other_country_immigration_status_offered | False | |
| users[i].q8a | False | |
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def find_package_data(where='.', package='', exclude=standard_exclude, exclude_d
url='https://docassemble.org',
packages=find_packages(),
namespace_packages=['docassemble'],
install_requires=[],
install_requires=['docassemble.ILAO', 'docassemble.AssemblyLine'],
zip_safe=False,
package_data=find_package_data(where='docassemble/USCISApplications/', package='docassemble.USCISApplications'),
)
Expand Down

0 comments on commit 0708cff

Please sign in to comment.