Compare commits
17 Commits
master
...
philip/tra
Author | SHA1 | Date | |
---|---|---|---|
f72313aea9 | |||
43fd7465e5 | |||
30eb9f517b | |||
f3e06dcd92 | |||
c0f578db75 | |||
5d2e5013f3 | |||
06d9612c6c | |||
07fef8df40 | |||
1bd281f2a2 | |||
7ab278d098 | |||
15d44c859e | |||
6d541d38bc | |||
08567436f2 | |||
091b1e9f16 | |||
85837e1fec | |||
a17da7b91b | |||
c8adfb7f19 |
4
apps/cic-ussd/.config/test/integration.ini
Normal file
4
apps/cic-ussd/.config/test/integration.ini
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[test]
|
||||||
|
gift_value = 50.00
|
||||||
|
server_url = http://localhost:63315/
|
||||||
|
token_symbol = GFT
|
@ -440,7 +440,8 @@ def process_request(user_input: str, user: Account, ussd_session: Optional[dict]
|
|||||||
'exit_invalid_pin',
|
'exit_invalid_pin',
|
||||||
'exit_invalid_new_pin',
|
'exit_invalid_new_pin',
|
||||||
'exit_pin_mismatch',
|
'exit_pin_mismatch',
|
||||||
'exit_invalid_request'
|
'exit_invalid_request',
|
||||||
|
'exit_successful_transaction'
|
||||||
] and person_metadata is not None:
|
] and person_metadata is not None:
|
||||||
return UssdMenu.find_by_name(name='start')
|
return UssdMenu.find_by_name(name='start')
|
||||||
else:
|
else:
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
pytest==6.0.1
|
Faker==8.1.2
|
||||||
|
faker-e164==0.1.0
|
||||||
|
pytest==6.2.4
|
||||||
pytest-alembic==0.2.5
|
pytest-alembic==0.2.5
|
||||||
pytest-celery==0.0.0a1
|
pytest-celery==0.0.0a1
|
||||||
pytest-cov==2.10.1
|
pytest-cov==2.10.1
|
||||||
pytest-mock==3.3.1
|
pytest-mock==3.3.1
|
||||||
pytest-redis==2.0.0
|
pytest-redis==2.0.0
|
||||||
requests-mock==1.8.0
|
requests-mock==1.8.0
|
||||||
|
tavern==1.14.2
|
@ -3,6 +3,7 @@ from cic_types.pytest import *
|
|||||||
|
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
|
from tests.fixtures.accounts import *
|
||||||
from tests.fixtures.config import *
|
from tests.fixtures.config import *
|
||||||
from tests.fixtures.db import *
|
from tests.fixtures.db import *
|
||||||
from tests.fixtures.celery import *
|
from tests.fixtures.celery import *
|
||||||
|
129
apps/cic-ussd/tests/fixtures/accounts.py
vendored
Normal file
129
apps/cic-ussd/tests/fixtures/accounts.py
vendored
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
# standard imports
|
||||||
|
|
||||||
|
# external imports
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from faker import Faker
|
||||||
|
|
||||||
|
# local imports
|
||||||
|
|
||||||
|
# test imports
|
||||||
|
from tests.helpers.accounts import phone_number, pin_number, session_id
|
||||||
|
|
||||||
|
|
||||||
|
fake = Faker()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='function')
|
||||||
|
def generate_phone_number() -> str:
|
||||||
|
return phone_number()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='function')
|
||||||
|
def generate_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_phone_number() -> str:
|
||||||
|
return phone_number()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_phone_number() -> str:
|
||||||
|
return phone_number()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_pin_number() -> str:
|
||||||
|
return pin_number()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_pin_number() -> str:
|
||||||
|
return pin_number()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_metadata_entry_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_metadata_entry_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_transaction_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_transaction_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_given_name() -> str:
|
||||||
|
return fake.first_name()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_given_name() -> str:
|
||||||
|
return fake.first_name()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_family_name() -> str:
|
||||||
|
return fake.last_name()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_family_name() -> str:
|
||||||
|
return fake.last_name()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_location() -> str:
|
||||||
|
return fake.city()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_location() -> str:
|
||||||
|
return fake.city()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_product() -> str:
|
||||||
|
return fake.job()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_product() -> str:
|
||||||
|
return fake.job()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def first_account_verify_balance_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def second_account_verify_balance_session_id() -> str:
|
||||||
|
return session_id()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def gift_value(load_config):
|
||||||
|
return load_config.get('TEST_GIFT_VALUE')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def server_url(load_config):
|
||||||
|
return load_config.get('TEST_SERVER_URL')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def token_symbol(load_config):
|
||||||
|
return load_config.get('TEST_TOKEN_SYMBOL')
|
26
apps/cic-ussd/tests/helpers/accounts.py
Normal file
26
apps/cic-ussd/tests/helpers/accounts.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# standard imports
|
||||||
|
import random
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
# external imports
|
||||||
|
from faker import Faker
|
||||||
|
from faker_e164.providers import E164Provider
|
||||||
|
|
||||||
|
# local imports
|
||||||
|
|
||||||
|
# test imports
|
||||||
|
|
||||||
|
fake = Faker()
|
||||||
|
fake.add_provider(E164Provider)
|
||||||
|
|
||||||
|
|
||||||
|
def phone_number() -> str:
|
||||||
|
return fake.e164('KE')
|
||||||
|
|
||||||
|
|
||||||
|
def session_id() -> str:
|
||||||
|
return uuid.uuid4().hex
|
||||||
|
|
||||||
|
|
||||||
|
def pin_number() -> int:
|
||||||
|
return random.randint(1000, 9999)
|
11
apps/cic-ussd/tests/integration/ext/validator.py
Normal file
11
apps/cic-ussd/tests/integration/ext/validator.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
logg = logging.getLogger()
|
||||||
|
logg.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_response(response, expected_response):
|
||||||
|
"""Makes sure that the response received matches the expected response"""
|
||||||
|
logg.debug(f'RESPONSE: {response.content.decode("utf-8")}')
|
||||||
|
assert response.content.decode('utf-8') == expected_response
|
2
apps/cic-ussd/tests/integration/run.sh
Normal file
2
apps/cic-ussd/tests/integration/run.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PYTHONPATH=. tavern-ci test_accounts.tavern.yaml --debug -vv --log-level debug -s --log-cli-level debug
|
730
apps/cic-ussd/tests/integration/test_accounts.tavern.yaml
Normal file
730
apps/cic-ussd/tests/integration/test_accounts.tavern.yaml
Normal file
@ -0,0 +1,730 @@
|
|||||||
|
test_name: Create an account 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_transaction_session_id
|
||||||
|
- second_transaction_session_id
|
||||||
|
- first_metadata_entry_session_id
|
||||||
|
- second_metadata_entry_session_id
|
||||||
|
- first_account_verify_balance_session_id
|
||||||
|
- second_account_verify_balance_session_id
|
||||||
|
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:
|
||||||
|
Content-Length: '175'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "END Your account is being created. You will receive an SMS when your account is ready.\nAkaunti yako ya Sarafu inatayarishwa. Utapokea ujumbe wa SMS akaunti yako ikiwa tayari.\n"
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
Content-Length: '175'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "END Your account is being created. You will receive an SMS when your account is ready.\nAkaunti yako ya Sarafu inatayarishwa. Utapokea ujumbe wa SMS akaunti yako ikiwa tayari.\n"
|
||||||
|
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:
|
||||||
|
Content-Length: '53'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Welcome to Sarafu\n1. English\n2. Kiswahili\n3. Help"
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
Content-Length: '53'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Welcome to Sarafu\n1. English\n2. Kiswahili\n3. Help"
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
Content-Length: '54'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Please enter a PIN to manage your account.\n0. Back"
|
||||||
|
|
||||||
|
- 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: '59'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Tafadhali weka PIN ili kudhibiti akaunti yako.\n0. Nyuma"
|
||||||
|
|
||||||
|
- 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: '32'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter your PIN again\n0. Back"
|
||||||
|
|
||||||
|
- 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"
|
||||||
|
|
||||||
|
- 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: '28'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter first name\n0. Back"
|
||||||
|
|
||||||
|
- name: Pin number confirmation [{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}*{second_account_pin_number}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '37'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka jina lako la kwanza\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter first name [first_account_given_name - 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}*{first_account_given_name}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '27'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter last name\n0. Back"
|
||||||
|
|
||||||
|
- name: Enter first name [second_account_given_name - 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}*{second_account_pin_number}*{second_account_given_name}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '37'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka jina lako la mwisho\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter last name [first_account_family_name - 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}*{first_account_given_name}*{first_account_family_name}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '42'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter gender\n1. Male\n2. Female\n0. Back"
|
||||||
|
|
||||||
|
- name: Enter last name [second_account_family_name - 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}*{second_account_pin_number}*{second_account_given_name}*{second_account_family_name}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '53'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka jinsia yako\n1. Mwanaume\n2. Mwanamke\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Select gender [Male - 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}*{first_account_given_name}*{first_account_family_name}*1"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '26'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter location\n0. Back"
|
||||||
|
|
||||||
|
- name: Select gender [Female - 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}*{second_account_pin_number}*{second_account_given_name}*{second_account_family_name}*2"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '27'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka eneo lako\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter location [first_account_location - 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}*{first_account_given_name}*{first_account_family_name}*1*{first_account_location}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '55'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Please enter a product or service you offer\n0. Back"
|
||||||
|
|
||||||
|
- name: Enter location [second_account_location - 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}*{second_account_pin_number}*{second_account_given_name}*{second_account_family_name}*2*{second_account_location}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '52'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Tafadhali weka bidhaa ama huduma unauza\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter product [first_account_product - 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}*{first_account_given_name}*{first_account_family_name}*1*{first_account_location}*{first_account_product}"
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Enter product [second_account_product - 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}*{second_account_pin_number}*{second_account_given_name}*{second_account_family_name}*2*{second_account_location}*{second_account_product}"
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Start menu [first account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_transaction_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: ""
|
||||||
|
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"
|
||||||
|
|
||||||
|
- name: Start menu [second account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_transaction_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: ""
|
||||||
|
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"
|
||||||
|
|
||||||
|
- name: Initate transcation attempt [first account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_transaction_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: "1"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '30'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter phone number\n0. Back"
|
||||||
|
|
||||||
|
- name: Initate transcation attempt [second account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_transaction_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: "1"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '33'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka nambari ya simu\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter phone number [first account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_transaction_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: "1*{second_account_phone_number}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '24'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Enter amount\n0. Back"
|
||||||
|
|
||||||
|
- name: Enter phone number [second account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_transaction_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: "1*{first_account_phone_number}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Length: '25'
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Weka kiwango\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Enter transcation amount [first account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_transaction_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: "1*{second_account_phone_number}*17"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON {second_account_given_name} {second_account_family_name} {second_account_phone_number} will receive 17.00 {token_symbol} from {first_account_given_name} {first_account_family_name} {first_account_phone_number}.\nPlease enter your PIN to confirm.\n0. Back"
|
||||||
|
|
||||||
|
- name: Enter transcation amount [second account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_transaction_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: "1*{first_account_phone_number}*25"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON {first_account_given_name} {first_account_family_name} {first_account_phone_number} atapokea 25.00 {token_symbol} kutoka kwa {second_account_given_name} {second_account_family_name} {second_account_phone_number}.\nTafadhali weka nambari yako ya siri kudhibitisha.\n0. Nyuma"
|
||||||
|
|
||||||
|
- name: Pin to authorize transaction [first account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_transaction_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: "1*{second_account_phone_number}*17*{first_account_pin_number}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Your request has been sent. {second_account_given_name} {second_account_family_name} {second_account_phone_number} will receive 17.00 {token_symbol} from {first_account_given_name} {first_account_family_name} {first_account_phone_number}.\n00. Back\n99. Exit"
|
||||||
|
|
||||||
|
- name: Pin to authorize transaction [second account]
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_transaction_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: "1*{first_account_phone_number}*25*{second_account_pin_number}"
|
||||||
|
headers:
|
||||||
|
content-type: "application/x-www-form-urlencoded"
|
||||||
|
method: POST
|
||||||
|
response:
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
headers:
|
||||||
|
Content-Type: "text/plain"
|
||||||
|
verify_response_with:
|
||||||
|
function: ext.validator:validate_response
|
||||||
|
extra_kwargs:
|
||||||
|
expected_response: "CON Ombi lako limetumwa. {first_account_given_name} {first_account_family_name} {first_account_phone_number} atapokea 25.00 {token_symbol} kutoka kwa {second_account_given_name} {second_account_family_name} {second_account_phone_number}.\n00. Nyuma\n99. Ondoka"
|
||||||
|
|
||||||
|
- name: Verify balance changes [first account]
|
||||||
|
delay_before: 10
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{first_account_verify_balance_session_id}"
|
||||||
|
phoneNumber: "{first_account_phone_number}"
|
||||||
|
text: ""
|
||||||
|
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 58.00 {token_symbol}\n1. Send\n2. My Account\n3. Help"
|
||||||
|
|
||||||
|
- name: Verify balance changes [first account]
|
||||||
|
delay_before: 10
|
||||||
|
request:
|
||||||
|
url: "{server_url}"
|
||||||
|
data:
|
||||||
|
serviceCode: "*483*46#"
|
||||||
|
sessionId: "{second_account_verify_balance_session_id}"
|
||||||
|
phoneNumber: "{second_account_phone_number}"
|
||||||
|
text: ""
|
||||||
|
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 42.00 {token_symbol}\n1. Tuma\n2. Akaunti yangu\n3. Usaidizi"
|
Loading…
Reference in New Issue
Block a user