Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit d716d73

Browse files
committed
SORMAS-Foundation#3288 - Added test cases for Export of Cases and Contacts
1 parent f11bd75 commit d716d73

8 files changed

Lines changed: 501 additions & 4 deletions

File tree

sormas-e2e-ui-tests/Data Files/testContactTestData.dat

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@
1515
<data>unchangable-epid-number-A TTZEQU null</data>
1616
<data>unchangable-epid-number-B XU7LM3 null</data>
1717
<data>userName-B UserB+test null</data>
18+
<data>test test random+search+for+test+data+export</data>
1819
<internalDataColumns>
1920
<columnIndex>0</columnIndex>
2021
<name>Key</name>
21-
<size>7</size>
22+
<size>8</size>
2223
</internalDataColumns>
2324
<internalDataColumns>
2425
<columnIndex>1</columnIndex>
2526
<name>Value</name>
26-
<size>7</size>
27+
<size>8</size>
2728
</internalDataColumns>
2829
<internalDataColumns>
2930
<columnIndex>2</columnIndex>
3031
<name>Description</name>
31-
<size>7</size>
32+
<size>8</size>
3233
</internalDataColumns>
3334
<isInternalPath>false</isInternalPath>
3435
<query></query>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<WebElementEntity>
3+
<description></description>
4+
<name>div_Detailed Export</name>
5+
<tag></tag>
6+
<elementGuidId>442a4dad-3cab-4fce-9c8e-2da814dd351b</elementGuidId>
7+
<selectorMethod>BASIC</selectorMethod>
8+
<useRalativeImagePath>false</useRalativeImagePath>
9+
<webElementProperties>
10+
<isSelected>true</isSelected>
11+
<matchCondition>equals</matchCondition>
12+
<name>tag</name>
13+
<type>Main</type>
14+
<value>div</value>
15+
</webElementProperties>
16+
<webElementProperties>
17+
<isSelected>false</isSelected>
18+
<matchCondition>equals</matchCondition>
19+
<name>tabindex</name>
20+
<type>Main</type>
21+
<value>0</value>
22+
</webElementProperties>
23+
<webElementProperties>
24+
<isSelected>false</isSelected>
25+
<matchCondition>equals</matchCondition>
26+
<name>role</name>
27+
<type>Main</type>
28+
<value>button</value>
29+
</webElementProperties>
30+
<webElementProperties>
31+
<isSelected>false</isSelected>
32+
<matchCondition>equals</matchCondition>
33+
<name>class</name>
34+
<type>Main</type>
35+
<value>v-button v-widget primary v-button-primary v-has-width</value>
36+
</webElementProperties>
37+
<webElementProperties>
38+
<isSelected>true</isSelected>
39+
<matchCondition>equals</matchCondition>
40+
<name>id</name>
41+
<type>Main</type>
42+
<value>exportDetailed</value>
43+
</webElementProperties>
44+
<webElementProperties>
45+
<isSelected>false</isSelected>
46+
<matchCondition>equals</matchCondition>
47+
<name>text</name>
48+
<type>Main</type>
49+
<value>Detailed Export</value>
50+
</webElementProperties>
51+
<webElementProperties>
52+
<isSelected>false</isSelected>
53+
<matchCondition>equals</matchCondition>
54+
<name>xpath</name>
55+
<type>Main</type>
56+
<value>id(&quot;exportDetailed&quot;)</value>
57+
</webElementProperties>
58+
<webElementXpaths>
59+
<isSelected>true</isSelected>
60+
<matchCondition>equals</matchCondition>
61+
<name>xpath:attributes</name>
62+
<type>Main</type>
63+
<value>//div[@id='exportDetailed']</value>
64+
</webElementXpaths>
65+
<webElementXpaths>
66+
<isSelected>false</isSelected>
67+
<matchCondition>equals</matchCondition>
68+
<name>xpath:idRelative</name>
69+
<type>Main</type>
70+
<value>//div[@id='sormasui-1655777373-overlays']/div[2]/div/div/div[3]/div</value>
71+
</webElementXpaths>
72+
<webElementXpaths>
73+
<isSelected>false</isSelected>
74+
<matchCondition>equals</matchCondition>
75+
<name>xpath:neighbor</name>
76+
<type>Main</type>
77+
<value>(.//*[normalize-space(text()) and normalize-space(.)='Basic Export'])[1]/following::div[3]</value>
78+
</webElementXpaths>
79+
<webElementXpaths>
80+
<isSelected>false</isSelected>
81+
<matchCondition>equals</matchCondition>
82+
<name>xpath:neighbor</name>
83+
<type>Main</type>
84+
<value>(.//*[normalize-space(text()) and normalize-space(.)=''])[1]/following::div[3]</value>
85+
</webElementXpaths>
86+
<webElementXpaths>
87+
<isSelected>false</isSelected>
88+
<matchCondition>equals</matchCondition>
89+
<name>xpath:position</name>
90+
<type>Main</type>
91+
<value>//div[2]/div[2]/div/div/div[3]/div</value>
92+
</webElementXpaths>
93+
</WebElementEntity>

sormas-e2e-ui-tests/Performance Tests/Performance.md

Lines changed: 305 additions & 0 deletions
Large diffs are not rendered by default.

sormas-e2e-ui-tests/Scripts/Events/CreateNewClusterEvent/Script1602235346380.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ WebUI.click(findTestObject('Events/NewEventView/td_Disease_COVID-19'))
2323
WebUI.setText(findTestObject('Events/NewEventView/textarea_EventDescription_TArea'), 'Cluster Event')
2424

2525
//select Nosocomial as Yes
26-
WebUI.click(findTestObject('Events/NewEventView/Nosocomial_label_Yes'))
26+
//WebUI.click(findTestObject('Events/NewEventView/Nosocomial_label_Yes'))
2727

2828
//WebUI.click(findTestObject('Events/NewEventView/div_Source type_v-filterselect-button'))
2929

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
2+
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
3+
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
4+
5+
import com.hzi.FileHandler
6+
import com.hzi.TestDataConnector as TestDataConnector
7+
import com.kms.katalon.core.exception.StepFailedException
8+
import com.kms.katalon.core.model.FailureHandling as FailureHandling
9+
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
10+
11+
import internal.GlobalVariable
12+
13+
WebUI.callTestCase(findTestCase('Login/partials/LoginAsSurveillanceSupervisor'), [:], FailureHandling.STOP_ON_FAILURE)
14+
15+
WebUI.callTestCase(findTestCase('SurveillanceSupervisor/partials/SwitchToCases'), [:], FailureHandling.STOP_ON_FAILURE)
16+
17+
String firstName = TestDataConnector.getValueByKey('GenericUsers', 'first_name_case')
18+
19+
String lastName = TestDataConnector.getValueByKey('GenericUsers', 'last_name_case')
20+
21+
WebUI.setText(findTestObject('Contacts/ContactsOverview/NewContact/input_More_nameUuidEpidNumberLike'), findTestData(GlobalVariable.gContactTestDataName).getValue(2, 8))
22+
23+
WebUI.click(findTestObject('Contacts/ContactsOverview/div_Apply filters'))
24+
25+
// Wait one second for ui update
26+
WebUI.delay(1)
27+
28+
WebUI.click(findTestObject('Surveillance/CaseView/div_Export'))
29+
30+
WebUI.click(findTestObject('Surveillance/CaseView/div_Detailed Export'))
31+
32+
WebUI.delay(2)
33+
34+
// CHECK
35+
String dateString = new Date().format("yyyy-MM-dd")
36+
String filename = "sormas_cases_" + dateString + ".csv"
37+
println("file path should be: " + GlobalVariable.gDownloadPath + filename)
38+
if (!FileHandler.existFile(GlobalVariable.gDownloadPath, filename)) {
39+
WebUI.closeBrowser()
40+
throw new StepFailedException("File '" + GlobalVariable.gDownloadPath + filename + "' was not downloaded or found")
41+
}
42+
43+
WebUI.closeBrowser()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
2+
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
3+
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
4+
5+
import com.hzi.FileHandler
6+
import com.kms.katalon.core.exception.StepFailedException
7+
import com.kms.katalon.core.model.FailureHandling as FailureHandling
8+
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
9+
10+
import internal.GlobalVariable
11+
12+
WebUI.callTestCase(findTestCase('Contacts/partials/loginAsContactSupervisor'), [:], FailureHandling.STOP_ON_FAILURE)
13+
14+
WebUI.callTestCase(findTestCase('Contacts/partials/switchToContacts'), [:], FailureHandling.STOP_ON_FAILURE)
15+
WebUI.delay(1)
16+
17+
WebUI.setText(findTestObject('Contacts/ContactsOverview/input_New contact_nameUuidCaseLike'),
18+
findTestData(GlobalVariable.gContactTestDataName).getValue(2, 8))
19+
20+
WebUI.click(findTestObject('Contacts/ContactsOverview/div_Apply filters'))
21+
22+
WebUI.delay(1)
23+
24+
WebUI.click(findTestObject('Surveillance/CaseView/div_Export'))
25+
26+
WebUI.click(findTestObject('Surveillance/CaseView/div_Detailed Export'))
27+
28+
WebUI.delay(2)
29+
30+
// CHECK
31+
String dateString = new Date().format("yyyy-MM-dd")
32+
String filename = "sormas_contacts_" + dateString + ".csv"
33+
println("file path should be: " + GlobalVariable.gDownloadPath + filename)
34+
if (!FileHandler.existFile(GlobalVariable.gDownloadPath, filename)) {
35+
WebUI.closeBrowser()
36+
throw new StepFailedException("File '" + GlobalVariable.gDownloadPath + filename + "' was not downloaded or found")
37+
}
38+
39+
WebUI.closeBrowser()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<TestCaseEntity>
3+
<description></description>
4+
<name>ExportCases</name>
5+
<tag></tag>
6+
<comment></comment>
7+
<testCaseGuid>1d6cdf3b-e775-4165-ae04-482bb2ba960f</testCaseGuid>
8+
</TestCaseEntity>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<TestCaseEntity>
3+
<description></description>
4+
<name>ExportContacts</name>
5+
<tag></tag>
6+
<comment></comment>
7+
<testCaseGuid>30f3db01-8090-4c0c-a4e2-7165f153cd5c</testCaseGuid>
8+
</TestCaseEntity>

0 commit comments

Comments
 (0)