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

Commit c256124

Browse files
committed
SORMAS-Foundation#3262 - Added Include contacts from other jurisdictions checkbox
1 parent 2e2d9f5 commit c256124

2 files changed

Lines changed: 97 additions & 7 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<WebElementEntity>
3+
<description></description>
4+
<name>span_Include contacts from other jurisdictions</name>
5+
<tag></tag>
6+
<elementGuidId>730a4f4e-f343-42fc-bbd6-a8c17b05da79</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>span</value>
15+
</webElementProperties>
16+
<webElementProperties>
17+
<isSelected>false</isSelected>
18+
<matchCondition>equals</matchCondition>
19+
<name>class</name>
20+
<type>Main</type>
21+
<value>v-checkbox v-widget filter-item v-checkbox-filter-item filter-inline v-checkbox-filter-inline vspace-3 v-checkbox-vspace-3</value>
22+
</webElementProperties>
23+
<webElementProperties>
24+
<isSelected>true</isSelected>
25+
<matchCondition>equals</matchCondition>
26+
<name>id</name>
27+
<type>Main</type>
28+
<value>includeContactsFromOtherJurisdictions</value>
29+
</webElementProperties>
30+
<webElementProperties>
31+
<isSelected>false</isSelected>
32+
<matchCondition>equals</matchCondition>
33+
<name>text</name>
34+
<type>Main</type>
35+
<value>Include contacts from other jurisdictions</value>
36+
</webElementProperties>
37+
<webElementProperties>
38+
<isSelected>false</isSelected>
39+
<matchCondition>equals</matchCondition>
40+
<name>xpath</name>
41+
<type>Main</type>
42+
<value>id(&quot;includeContactsFromOtherJurisdictions&quot;)</value>
43+
</webElementProperties>
44+
<webElementXpaths>
45+
<isSelected>true</isSelected>
46+
<matchCondition>equals</matchCondition>
47+
<name>xpath:attributes</name>
48+
<type>Main</type>
49+
<value>//span[@id='includeContactsFromOtherJurisdictions']</value>
50+
</webElementXpaths>
51+
<webElementXpaths>
52+
<isSelected>false</isSelected>
53+
<matchCondition>equals</matchCondition>
54+
<name>xpath:idRelative</name>
55+
<type>Main</type>
56+
<value>//div[@id='sormasui-1655777373']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div/div/div/div/div/div/div/div[2]/div/div[2]/div[12]/span</value>
57+
</webElementXpaths>
58+
<webElementXpaths>
59+
<isSelected>false</isSelected>
60+
<matchCondition>equals</matchCondition>
61+
<name>xpath:neighbor</name>
62+
<type>Main</type>
63+
<value>(.//*[normalize-space(text()) and normalize-space(.)='Only contacts with source case linked to the specified event'])[1]/following::span[1]</value>
64+
</webElementXpaths>
65+
<webElementXpaths>
66+
<isSelected>false</isSelected>
67+
<matchCondition>equals</matchCondition>
68+
<name>xpath:neighbor</name>
69+
<type>Main</type>
70+
<value>(.//*[normalize-space(text()) and normalize-space(.)='Only contacts with reduced quarantine'])[1]/following::span[2]</value>
71+
</webElementXpaths>
72+
<webElementXpaths>
73+
<isSelected>false</isSelected>
74+
<matchCondition>equals</matchCondition>
75+
<name>xpath:position</name>
76+
<type>Main</type>
77+
<value>//div[12]/span</value>
78+
</webElementXpaths>
79+
</WebElementEntity>

sormas-e2e-ui-tests/Scripts/Contacts/NewContactViaContactsView/Script1586946842046.groovy

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
22
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
33
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
44

5-
import com.hzi.Helper
5+
import com.hzi.Helper as Helper
66
import com.hzi.Table as Table
7+
import com.kms.katalon.core.exception.StepFailedException
78
import com.kms.katalon.core.model.FailureHandling as FailureHandling
89
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
910

@@ -16,15 +17,16 @@ WebUI.callTestCase(findTestCase('Contacts/partials/switchToContacts'), [:], Fail
1617

1718
WebUI.delay(1)
1819

19-
2020
// TESTCASE
2121
WebUI.click(findTestObject('Contacts/ContactsOverview/div_New contact'))
2222

2323
WebUI.setText(findTestObject('Contacts/ContactsOverview/NewContact/input_First name'), 'Aurelius')
2424

2525
// generate name because contacts cannot be deleted
2626
String newContactLastName = Helper.generateString('Aurelius', 6)
27+
2728
println('generated lastname:' + newContactLastName)
29+
2830
WebUI.setText(findTestObject('Contacts/ContactsOverview/NewContact/input_Last name'), newContactLastName)
2931

3032
WebUI.click(findTestObject('Object Repository/Contacts/ContactInformationView/ChangeContactPersonData/div_Sex_v-filterselect-button'))
@@ -37,7 +39,8 @@ WebUI.click(findTestObject('Events/NewEventView/td_Disease_COVID-19'))
3739

3840
WebUI.click(findTestObject('Contacts/ContactsOverview/NewContact/div_Choose Case'))
3941

40-
WebUI.setText(findTestObject('Contacts/ContactsOverview/NewContact/input_Select Source Case_v-textfield_search'), findTestData(GlobalVariable.gContactTestDataName).getValue(2, 2))
42+
WebUI.setText(findTestObject('Contacts/ContactsOverview/NewContact/input_Select Source Case_v-textfield_search'), findTestData(
43+
GlobalVariable.gContactTestDataName).getValue(2, 2))
4144

4245
WebUI.click(findTestObject('Contacts/ContactsOverview/NewContact/div_Search case'))
4346

@@ -51,25 +54,33 @@ WebUI.click(findTestObject('ReusableORs/div_Save'))
5154

5255
// 'check if "Pick or create person" dialog is shown' ans select create-new-person
5356
boolean checkDialog = WebUI.verifyElementPresent(findTestObject('ReusableORs/div_Select a matching person'), 2, FailureHandling.OPTIONAL)
57+
5458
if (checkDialog) {
55-
WebUI.click(findTestObject('ReusableORs/div_Create a new person'))
59+
WebUI.click(findTestObject('ReusableORs/div_Create a new person'))
5660

57-
WebUI.click(findTestObject('ReusableORs/div_Save'))
61+
WebUI.click(findTestObject('ReusableORs/div_Save'))
5862
}
63+
5964
WebUI.delay(1)
6065

6166
// CHECK
6267
WebUI.click(findTestObject('Contacts/ContactsOverview/NewContact/span_Contacts list'))
6368

6469
WebUI.setText(findTestObject('Contacts/ContactsOverview/input_New contact_nameUuidCaseLike'), newContactLastName)
6570

71+
WebUI.click(findTestObject('Contacts/ContactsOverview/div_Show More Less Filters'))
72+
73+
WebUI.click(findTestObject('ReusableORs/Filters/span_Include contacts from other jurisdictions'))
74+
6675
WebUI.click(findTestObject('Contacts/ContactsOverview/div_Apply filters'))
76+
6777
WebUI.delay(1)
6878

6979
int numberOfRows = Table.getNumberOfTableRows()
80+
7081
if (numberOfRows != 1) {
71-
WebUI.closeBrowser()
72-
throw new com.kms.katalon.core.exception.StepFailedException('Expected one contact: ' + numberOfRows)
82+
WebUI.closeBrowser()
83+
throw new StepFailedException('Expected one contact: ' + numberOfRows)
7384
}
7485

7586
WebUI.closeBrowser()

0 commit comments

Comments
 (0)