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 25, 2022
1 parent 7a8dc67 commit 3974a21
Show file tree
Hide file tree
Showing 12 changed files with 699 additions and 150 deletions.
161 changes: 49 additions & 112 deletions report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@
</head>
<body>
<div class="behave">
<div id="behave-header" class="failed">
<div id="behave-header">
<div id="label">
<h1>Behave Test Report</h1>
</div>
<div id="summary">
<p id="totals">
<p id="feature_totals">Features: failed: 1</p>
<p id="scenario_totals">Scenarios: passed: 1, failed: 1</p>
<p id="step_totals">Steps: passed: 4, failed: 1, skipped: 10</p>
<p id="feature_totals">Features: passed: 1</p>
<p id="scenario_totals">Scenarios: passed: 2</p>
<p id="step_totals">Steps: passed: 6</p>
</p>
<p id="duration">Finished in 34.2 seconds</p>
<p id="duration">Finished in 15.5 seconds</p>
<div id="expand-collapse">
<a id="expander" href="#" onclick="Collapsible_expandAll('scenario_steps')">Expand All</a>
<span> | </span>
Expand All @@ -131,7 +131,7 @@ <h1>Behave Test Report</h1>
</div>
<div class="feature">
<h2>
<span class="val">Feature: semantic check for sendPaymentOutcomeReq regarding idempotency</span>
<span class="val">Feature: semantic check for activatePaymentNotice regarding idempotency</span>
</h2>
<span/>
</div>
Expand All @@ -143,7 +143,7 @@ <h3>
<span/>
</div>
<div class="scenario">
<span class="scenario_file">src/integ-test/bdd-test/features/NewMod3/flows/activatePaymentNotice/activatePaymentNotice_IDMP_ACT_1_1.feature:12</span>
<span class="scenario_file">src/integ-test/bdd-test/features/NewMod3/flows/activatePaymentNotice/activatePaymentNotice_IDMP_ACT_2.feature:7</span>
<h3 onclick="Collapsible_toggle('scenario_0')">
<span class="val">Scenario: Execute activatePaymentNotice request</span>
</h3>
Expand All @@ -152,7 +152,7 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
<div class="step_name">
<span class="keyword">Given </span>
<span class="step val">systems up</span>
<small class="step_duration">(0.079s)</small>
<small class="step_duration">(0.500s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:27</span>
Expand Down Expand Up @@ -192,44 +192,10 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
<b>true</b>
<span/>
</span>
<small class="step_duration">(5.372s)</small>
<small class="step_duration">(6.185s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
</div>
<span class="embed"/>
</li>
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>nodo-dei-pagamenti has config parameter </span>
<b>default_idempotency_key_validity_minutes</b>
<span> set to </span>
<b>1800000</b>
<span/>
</span>
<small class="step_duration">(5.357s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
</div>
<span class="embed"/>
</li>
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>nodo-dei-pagamenti has config parameter </span>
<b>default_token_duration_validity_millis</b>
<span> set to </span>
<b>40</b>
<span/>
</span>
<small class="step_duration">(5.294s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:622</span>
</div>
<span class="embed"/>
</li>
Expand All @@ -241,7 +207,7 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
<b>activatePaymentNotice</b>
<span/>
</span>
<small class="step_duration">(0.015s)</small>
<small class="step_duration">(0.014s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:54</span>
Expand All @@ -252,7 +218,7 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
&lt;soapenv:Header/&gt;
&lt;soapenv:Body&gt;
&lt;nod:activatePaymentNoticeReq&gt;
&lt;idPSP&gt;70000000001&lt;/idPSP&gt;
&lt;idPSP&gt;&lt;/idPSP&gt;
&lt;idBrokerPSP&gt;70000000001&lt;/idBrokerPSP&gt;
&lt;idChannel&gt;70000000001_01&lt;/idChannel&gt;
&lt;password&gt;pwdpwdpwd&lt;/password&gt;
Expand Down Expand Up @@ -282,10 +248,10 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
<b>nodo-dei-pagamenti</b>
<span/>
</span>
<small class="step_duration">(1.272s)</small>
<small class="step_duration">(3.051s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:169</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:170</span>
</div>
<span class="embed"/>
</li>
Expand All @@ -296,32 +262,51 @@ <h3 onclick="Collapsible_toggle('scenario_0')">
<span>check </span>
<b>outcome</b>
<span> is </span>
<b>OK</b>
<b>KO</b>
<span> of </span>
<b>activatePaymentNotice</b>
<span> response</span>
</span>
<small class="step_duration">(0.002s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:193</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:194</span>
</div>
<span class="embed"/>
</li>
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>check </span>
<b>faultCode</b>
<span> is </span>
<b>PPT_SINTASSI_EXTRAXSD</b>
<span> of </span>
<b>activatePaymentNotice</b>
<span> response</span>
</span>
<small class="step_duration">(0.002s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:194</span>
</div>
<span class="embed"/>
</li>
</ol>
<span/>
</div>
<div class="scenario">
<span class="scenario_file">src/integ-test/bdd-test/features/NewMod3/flows/activatePaymentNotice/activatePaymentNotice_IDMP_ACT_1_1.feature:40</span>
<h3 onclick="Collapsible_toggle('scenario_1')" class="failed">
<span class="scenario_file">src/integ-test/bdd-test/features/NewMod3/flows/activatePaymentNotice/activatePaymentNotice_IDMP_ACT_2.feature:35</span>
<h3 onclick="Collapsible_toggle('scenario_1')">
<span class="val">Scenario: Execute activatePaymentNotice request</span>
</h3>
<ol class="scenario_steps" id="scenario_1">
<li class="step passed">
<div class="step_name">
<span class="keyword">Given </span>
<span class="step val">systems up</span>
<small class="step_duration">(0.057s)</small>
<small class="step_duration">(0.065s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:27</span>
Expand Down Expand Up @@ -361,44 +346,10 @@ <h3 onclick="Collapsible_toggle('scenario_1')" class="failed">
<b>true</b>
<span/>
</span>
<small class="step_duration">(5.212s)</small>
<small class="step_duration">(5.326s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
</div>
<span class="embed"/>
</li>
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>nodo-dei-pagamenti has config parameter </span>
<b>default_idempotency_key_validity_minutes</b>
<span> set to </span>
<b>1800000</b>
<span/>
</span>
<small class="step_duration">(5.241s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
</div>
<span class="embed"/>
</li>
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>nodo-dei-pagamenti has config parameter </span>
<b>default_token_duration_validity_millis</b>
<span> set to </span>
<b>40</b>
<span/>
</span>
<small class="step_duration">(5.224s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:621</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:622</span>
</div>
<span class="embed"/>
</li>
Expand All @@ -410,22 +361,20 @@ <h3 onclick="Collapsible_toggle('scenario_1')" class="failed">
<b>Execute activatePaymentNotice request</b>
<span> scenario executed successfully</span>
</span>
<small class="step_duration">(0.887s)</small>
<small class="step_duration">(0.145s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:346</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:347</span>
</div>
<span class="embed"/>
</li>
<li class="step failed">
<li class="step passed">
<div class="step_name">
<span class="keyword">And </span>
<span class="step val">
<span>check datetime plus number of date </span>
<b>default_idempotency_key_validity_minutes</b>
<span> of the record at column </span>
<b>VALID_TO</b>
<span> of the table </span>
<span>verify </span>
<b>0</b>
<span> record for the table </span>
<b>IDEMPOTENCY_CACHE</b>
<span> retrived by the query </span>
<b>idempotency_cache_act</b>
Expand All @@ -435,24 +384,12 @@ <h3 onclick="Collapsible_toggle('scenario_1')" class="failed">
<b>NewMod3</b>
<span/>
</span>
<small class="step_duration">(0.164s)</small>
<small class="step_duration">(0.197s)</small>
</div>
<div class="step_file">
<span>src/integ-test/bdd-test/features/steps/steps.py:815</span>
<span>src/integ-test/bdd-test/features/steps/steps.py:871</span>
</div>
<span class="embed">
<a onclick="Collapsible_toggle('embed_1')">Error Message</a>
<pre id="embed_1" style="display: none">Traceback (most recent call last):
File &quot;C:\Users\damiano.dorelli\AppData\Local\Programs\Python\Python310\lib\site-packages\behave\model.py&quot;, line 1329, in run
match.run(runner.context)
File &quot;C:\Users\damiano.dorelli\AppData\Local\Programs\Python\Python310\lib\site-packages\behave\matchers.py&quot;, line 98, in run
self.func(context, *args, **kwargs)
File &quot;src\integ-test\bdd-test\features\steps\steps.py&quot;, line 840, in step_impl
assert elem == value
AssertionError
</pre>

</span>
<span class="embed"/>
</li>
</ol>
<span/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Feature: semantic check for sendPaymentOutcomeReq regarding idempotency
Feature: semantic check for activatePaymentNotice regarding idempotency

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

Scenario: Execute activatePaymentNotice request
Given initial XML activatePaymentNotice
Expand Down Expand Up @@ -32,11 +32,10 @@ Feature: semantic check for sendPaymentOutcomeReq regarding idempotency
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 activatePaymentNotice request scenario executed successfully
And check datetime plus number of date default_idempotency_key_validity_minutes of the record at column VALID_TO of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And check datetime plus number of date default_token_duration_validity_millis of the record at column VALID_TO of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act 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
And checks the value $activatePaymentNotice.fiscalCode of the record at column PA_FISCAL_CODE of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value activatePaymentNotice of the record at column PRIMITIVA of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Feature: semantic check for activatePaymentNotice regarding idempotency

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

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

#DB check
Scenario: Execute activatePaymentNotice request
Given the Execute activatePaymentNotice request scenario executed successfully
And check datetime plus number of date default_idempotency_key_validity_minutes of the record at column VALID_TO of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act 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
And checks the value $activatePaymentNotice.fiscalCode of the record at column PA_FISCAL_CODE of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value activatePaymentNotice of the record at column PRIMITIVA of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.idPSP of the record at column PSP_ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.noticeNumber of the record at column NOTICE_ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.idempotencyKey of the record at column IDEMPOTENCY_KEY of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNoticeResponse.paymentToken of the record at column TOKEN of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column HASH_REQUEST of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column RESPONSE of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column INSERTED_TIMESTAMP of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3



Loading

0 comments on commit 3974a21

Please sign in to comment.