Skip to content

Commit

Permalink
add new test newmod3
Browse files Browse the repository at this point in the history
  • Loading branch information
DamDory committed Jul 27, 2022
1 parent e1af70a commit 1e385a1
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 168 deletions.
268 changes: 106 additions & 162 deletions report/index.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: semantic check for activatePaymentNotice regarding idempotency
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>#notice_number_old#</noticeNumber>
</qrCode>
<expirationTime>2000</expirationTime>
<expirationTime>5000</expirationTime>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
Expand All @@ -33,7 +33,6 @@ Feature: semantic check for activatePaymentNotice regarding idempotency

Scenario: Execute activatePaymentNotice1 request
Given the Execute activatePaymentNotice request scenario executed successfully
And PSP waits expirationTime of activatePaymentNotice expires
And initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
Expand Down Expand Up @@ -68,4 +67,4 @@ Feature: semantic check for activatePaymentNotice regarding idempotency
And checks the value PAYING of the record at column STATUS of the table POSITION_STATUS_SNAPSHOT retrived by the query payment_status on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_ACTIVATE retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_PAYMENT retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table IDEMPOTENCY_KEY retrived by the query idempotency_key on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table IDEMPOTENCY_KEY retrived by the query idempotency_key on db nodo_online under macro NewMod3
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ Feature: semantic check for activatePaymentNotice regarding idempotency
#DB check
Scenario: Execute activatePaymentNotice request
Given the Execute activatePaymentNotice1 request scenario executed successfully
And verify 0 record for the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And verify 1 record for the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Feature: semantic check for activatePaymentNotice regarding idempotency

Background:
Given systems up
And nodo-dei-pagamenti has config parameter useIdempotency set to true

Scenario: Execute activatePaymentNotice request
Given initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>Password01</password>
<idempotencyKey>#idempotency_key#</idempotencyKey>
<qrCode>
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>#notice_number_old#</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is KO of activatePaymentNotice response
And check faultCode is PPT_AUTENTICAZIONE of activatePaymentNotice response

Scenario: Execute activatePaymentNotice1 request
Given the Execute activatePaymentNotice request scenario executed successfully
And initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>$activatePaymentNotice.idempotencyKey</idempotencyKey>
<qrCode>
<fiscalCode>$activatePaymentNotice.fiscalCode</fiscalCode>
<noticeNumber>$activatePaymentNotice.noticeNumber</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is OK of activatePaymentNotice response

#DB check
Scenario: Execute activatePaymentNotice request
Given the Execute activatePaymentNotice1 request scenario executed successfully
And verify 1 record for the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Feature: semantic check for activatePaymentNotice regarding idempotency

Background:
Given systems up
And nodo-dei-pagamenti has config parameter useIdempotency set to true

Scenario: Execute activatePaymentNotice request
Given initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>#idempotency_key#</idempotencyKey>
<qrCode>
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>#notice_number_old#</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is OK of activatePaymentNotice response

Scenario: Execute activatePaymentNotice1 request
Given the Execute activatePaymentNotice request scenario executed successfully
And initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>60000000001</idPSP>
<idBrokerPSP>60000000001</idBrokerPSP>
<idChannel>60000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>$activatePaymentNotice.idempotencyKey</idempotencyKey>
<qrCode>
<fiscalCode>$activatePaymentNotice.fiscalCode</fiscalCode>
<noticeNumber>$activatePaymentNotice.noticeNumber</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is KO of activatePaymentNotice response
And check faultCode is PPT_PAGAMENTO_IN_CORSO of activatePaymentNotice response

#DB check
Scenario: Execute activatePaymentNotice request
Given the Execute activatePaymentNotice1 request scenario executed successfully
And checks the value PAYING of the record at column STATUS of the table POSITION_PAYMENT_STATUS retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_PAYMENT_STATUS_SNAPSHOT retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_STATUS retrived by the query payment_status on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_STATUS_SNAPSHOT retrived by the query payment_status on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_ACTIVATE retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_PAYMENT retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table IDEMPOTENCY_KEY retrived by the query idempotency_key on db nodo_online under macro NewMod3






Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Feature: semantic check for activatePaymentNotice regarding idempotency

Background:
Given systems up
And nodo-dei-pagamenti has config parameter useIdempotency set to true

Scenario: Execute activatePaymentNotice request
Given initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>#idempotency_key#</idempotencyKey>
<qrCode>
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>#notice_number_old#</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is OK of activatePaymentNotice response

Scenario: Execute activatePaymentNotice1 request
Given the Execute activatePaymentNotice request scenario executed successfully
And initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>$activatePaymentNotice.idempotencyKey</idempotencyKey>
<qrCode>
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>$activatePaymentNotice.noticeNumber</noticeNumber>
</qrCode>
<amount>10.00</amount>
<dueDate>2021-12-31</dueDate>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is OK of activatePaymentNotice response

#DB check
Scenario: Execute activatePaymentNotice request
Given the Execute activatePaymentNotice1 request scenario executed successfully
And checks the value PAYING of the record at column STATUS of the table POSITION_PAYMENT_STATUS retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_PAYMENT_STATUS_SNAPSHOT retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_STATUS retrived by the query payment_status on db nodo_online under macro NewMod3
And checks the value PAYING of the record at column STATUS of the table POSITION_STATUS_SNAPSHOT retrived by the query payment_status on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_ACTIVATE retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table POSITION_PAYMENT retrived by the query payment_status_pay on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3








5 changes: 3 additions & 2 deletions src/integ-test/bdd-test/features/steps/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ def get_history(rest_mock, notice_number, primitive):
def query_json(context, name_query, name_macro):
query = json.load(open(os.path.join(context.config.base_dir + "/../resources/query_AutomationTest.json")))
selected_query = query.get(name_macro).get(name_query)

print(selected_query)
if '$' in selected_query:
selected_query = replace_local_variables(selected_query, context)
print(selected_query)
selected_query = replace_context_variables(selected_query, context)

print(selected_query)
return selected_query


Expand Down

0 comments on commit 1e385a1

Please sign in to comment.