cic-internal-integration/apps/cic-ussd/tests/integration/test_account_creation.tavern.yaml

252 lines
7.7 KiB
YAML
Raw Permalink Normal View History

2021-06-03 15:40:51 +02:00
test_name: Test the creation of accounts through the cic_user_ussd_server entrypoint.
marks:
- usefixtures:
- gift_value
- server_url
- token_symbol
- generate_session_id
- first_account_phone_number
- second_account_phone_number
- first_account_pin_number
- second_account_pin_number
- first_account_family_name
- second_account_family_name
- first_account_given_name
- second_account_given_name
- first_account_location
- second_account_location
- first_account_product
- second_account_product
- first_metadata_entry_session_id
- second_metadata_entry_session_id
- first
stages:
- name: Initiate account creation process [first account].
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{generate_session_id}"
phoneNumber: "{first_account_phone_number}"
text: ""
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
2021-08-06 18:29:01 +02:00
Content-Length: '91'
2021-06-03 15:40:51 +02:00
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
2021-08-06 18:29:01 +02:00
expected_response: "END Akaunti yako ya Sarafu inatayarishwa. Utapokea ujumbe wa SMS akaunti yako ikiwa tayari."
delay_after: 5
2021-06-03 15:40:51 +02:00
- name: Initiate account creation process [second account].
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{generate_session_id}"
phoneNumber: "{second_account_phone_number}"
text: ""
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
2021-08-06 18:29:01 +02:00
Content-Length: '91'
2021-06-03 15:40:51 +02:00
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
2021-08-06 18:29:01 +02:00
expected_response: "END Akaunti yako ya Sarafu inatayarishwa. Utapokea ujumbe wa SMS akaunti yako ikiwa tayari."
2021-06-03 15:40:51 +02:00
delay_after: 5
- name: Initaite account metadata entry [first account]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{first_metadata_entry_session_id}"
phoneNumber: "{first_account_phone_number}"
text: ""
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
2021-08-06 18:29:01 +02:00
Content-Length: '57'
2021-06-03 15:40:51 +02:00
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
2021-08-06 18:29:01 +02:00
expected_response: "CON Karibu Sarafu Network\n1. English\n2. Kiswahili\n3. Help"
2021-06-03 15:40:51 +02:00
- name: Initaite account metadata entry [second account]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{second_metadata_entry_session_id}"
phoneNumber: "{second_account_phone_number}"
text: ""
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
2021-08-06 18:29:01 +02:00
Content-Length: '57'
2021-06-03 15:40:51 +02:00
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
2021-08-06 18:29:01 +02:00
expected_response: "CON Karibu Sarafu Network\n1. English\n2. Kiswahili\n3. Help"
2021-06-03 15:40:51 +02:00
- name: Select preferred language [English]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{first_metadata_entry_session_id}"
phoneNumber: "{first_account_phone_number}"
text: "1"
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
2021-08-06 18:29:01 +02:00
Content-Length: '71'
2021-06-03 15:40:51 +02:00
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
2021-08-06 18:29:01 +02:00
expected_response: "CON Tafadhali weka pin mpya yenye nambari nne kwa akaunti yako\n0. Nyuma"
delay_after: 5
2021-06-03 15:40:51 +02:00
- name: Select preferred language [Kiswahili]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{second_metadata_entry_session_id}"
phoneNumber: "{second_account_phone_number}"
text: "2"
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
Content-Length: '71'
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
expected_response: "CON Tafadhali weka pin mpya yenye nambari nne kwa akaunti yako\n0. Nyuma"
2021-08-06 18:29:01 +02:00
delay_after: 5
2021-06-03 15:40:51 +02:00
- name: Enter pin number [{first_account_pin_number} - first account]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{first_metadata_entry_session_id}"
phoneNumber: "{first_account_phone_number}"
text: "1*{first_account_pin_number}"
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
Content-Length: '44'
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
expected_response: "CON Enter your four number PIN again\n0. Back"
2021-08-06 18:29:01 +02:00
delay_after: 5
2021-06-03 15:40:51 +02:00
- name: Enter pin number [second_account_pin_number - second account]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{second_metadata_entry_session_id}"
phoneNumber: "{second_account_phone_number}"
text: "2*{second_account_pin_number}"
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
Content-Length: '31'
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
expected_response: "CON Weka PIN yako tena\n0. Nyuma"
2021-08-06 18:29:01 +02:00
delay_after: 5
2021-06-03 15:40:51 +02:00
- name: Pin number confirmation [first_account_pin_number - first account]
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{first_metadata_entry_session_id}"
phoneNumber: "{first_account_phone_number}"
text: "1*{first_account_pin_number}*{first_account_pin_number}"
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
Content-Length: '51'
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
expected_response: "CON Balance {gift_value} {token_symbol}\n1. Send\n2. My Account\n3. Help"
delay_before: 10
2021-06-30 16:27:56 +02:00
- name: Pin number confirmation [{second_account_pin_number} - second account]
2021-06-03 15:40:51 +02:00
request:
url: "{server_url}"
data:
serviceCode: "*483*46#"
sessionId: "{second_metadata_entry_session_id}"
phoneNumber: "{second_account_phone_number}"
2021-06-30 16:27:56 +02:00
text: "2*{second_account_pin_number}*{second_account_pin_number}"
2021-06-03 15:40:51 +02:00
headers:
content-type: "application/x-www-form-urlencoded"
method: POST
response:
status_code:
- 200
headers:
Content-Length: '56'
Content-Type: "text/plain"
verify_response_with:
function: ext.validator:validate_response
extra_kwargs:
expected_response: "CON Salio {gift_value} {token_symbol}\n1. Tuma\n2. Akaunti yangu\n3. Usaidizi"
delay_before: 10