-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
161 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject | ||
|
||
import com.kms.katalon.core.testobject.TestObject | ||
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI | ||
|
||
/** | ||
* This script visits the page at https://katalon-demo-cura.herokuapp.com/ and the linked pages | ||
* without highlighting elements | ||
*/ | ||
|
||
// open browser and navigate to the AUT | ||
WebUI.openBrowser('') | ||
WebUI.setViewPortSize(1024, 768) | ||
WebUI.navigateToUrl('https://katalon-demo-cura.herokuapp.com/') | ||
WebUI.delay(1) | ||
|
||
TestObject a_MakeAppointment = findTestObject('Page_CURA Healthcare Service_top/a_Make Appointment') | ||
WebUI.verifyElementPresent(a_MakeAppointment, 10) | ||
|
||
WebUI.click(a_MakeAppointment) | ||
WebUI.delay(1) | ||
|
||
TestObject input_username = findTestObject('Page_CURA Healthcare Service_login/input_Username_username') | ||
WebUI.setText(input_username, 'John Doe') | ||
WebUI.delay(1) | ||
|
||
TestObject input_password = findTestObject('Page_CURA Healthcare Service_login/input_Password_password') | ||
WebUI.setEncryptedText(input_password, 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM') | ||
WebUI.delay(1) | ||
|
||
TestObject button_Login = findTestObject('Page_CURA Healthcare Service_login/button_Login') | ||
WebUI.click(button_Login) | ||
WebUI.delay(1) | ||
|
||
TestObject select_Facility = findTestObject('Page_CURA Healthcare Service_appointment/select_Facility') | ||
WebUI.selectOptionByIndex(select_Facility, 0) | ||
WebUI.delay(1) | ||
|
||
TestObject input_hospital_readm = findTestObject('Page_CURA Healthcare Service_appointment/input_Apply for hospital readm') | ||
WebUI.click(input_hospital_readm) | ||
WebUI.delay(1) | ||
|
||
TestObject input_Medicaid = findTestObject('Page_CURA Healthcare Service_appointment/input_Medicaid_programs') | ||
WebUI.click(input_Medicaid) | ||
WebUI.delay(1) | ||
|
||
TestObject input_Visit_Date = findTestObject('Page_CURA Healthcare Service_appointment/input_Visit Date (Required)_vi') | ||
WebUI.setText(input_Visit_Date, '01/12/34') | ||
WebUI.delay(1) | ||
|
||
TestObject textarea_comment = findTestObject('Page_CURA Healthcare Service_appointment/textarea_Comment_comment') | ||
WebUI.setText(textarea_comment, 'This is a comment') | ||
WebUI.delay(1) | ||
|
||
TestObject button_Book_Appointment = findTestObject('Page_CURA Healthcare Service_appointment/button_Book Appointment') | ||
WebUI.click(button_Book_Appointment) | ||
WebUI.delay(1) | ||
|
||
TestObject a_Go_to_Homepage = findTestObject('Page_CURA Healthcare Service_summary/a_Go to Homepage') | ||
WebUI.click(a_Go_to_Homepage) | ||
WebUI.delay(1) | ||
|
||
WebUI.closeBrowser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,80 @@ | ||
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject | ||
|
||
import com.kms.katalon.core.model.FailureHandling as FailureHandling | ||
import com.kms.katalon.core.testobject.TestObject | ||
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI | ||
|
||
/** | ||
* This script visits the page at https://katalon-demo-cura.herokuapp.com/ | ||
* and the linked pages while highlighting elements with red border. | ||
* This script repeats explicitly calling a custome keyword to put the highlight | ||
* so that this script looks tedius. | ||
*/ | ||
|
||
|
||
|
||
|
||
// open browser and navigate to the AUT | ||
WebUI.openBrowser('') | ||
WebUI.setViewPortSize(1024, 768) | ||
WebUI.navigateToUrl('https://katalon-demo-cura.herokuapp.com/') | ||
WebUI.delay(1) | ||
|
||
// highlight a specific element | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'( | ||
findTestObject('Page_CURA Healthcare Service_top/h1_CURA Healthcare Service')) | ||
WebUI.delay(2) | ||
|
||
WebUI.comment("Hello, world") | ||
TestObject a_MakeAppointment = findTestObject('Page_CURA Healthcare Service_top/a_Make Appointment') | ||
WebUI.verifyElementPresent(a_MakeAppointment, 10) | ||
|
||
// modify WebUI.* keywords which take TestObject as arg0 | ||
// so that they call Highlight.on() automatically | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.pandemic'() | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_top/a_Make Appointment')) | ||
// highlight the element | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(a_MakeAppointment) | ||
WebUI.click(a_MakeAppointment) | ||
WebUI.delay(1) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_login/input_Username_username'), 'John Doe') | ||
TestObject input_username = findTestObject('Page_CURA Healthcare Service_login/input_Username_username') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(input_username) | ||
WebUI.setText(input_username, 'John Doe') | ||
WebUI.delay(1) | ||
|
||
WebUI.setEncryptedText(findTestObject('Page_CURA Healthcare Service_login/input_Password_password'), 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM') | ||
TestObject input_password = findTestObject('Page_CURA Healthcare Service_login/input_Password_password') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(input_password) | ||
WebUI.setEncryptedText(input_password, 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM') | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_login/button_Login')) | ||
TestObject button_Login = findTestObject('Page_CURA Healthcare Service_login/button_Login') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(button_Login) | ||
WebUI.click(button_Login) | ||
WebUI.delay(1) | ||
|
||
//WebUI.selectOptionByValue(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), | ||
// 'Hongkong CURA Healthcare Center', false) | ||
//WebUI.delay(1) | ||
|
||
//WebUI.selectOptionByLabel(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), | ||
// 'Seoul CURA Healthcare Center', false) | ||
//WebUI.delay(1) | ||
|
||
WebUI.selectOptionByIndex(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), 0) | ||
TestObject select_Facility = findTestObject('Page_CURA Healthcare Service_appointment/select_Facility') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(select_Facility) | ||
WebUI.selectOptionByIndex(select_Facility, 0) | ||
WebUI.delay(1) | ||
|
||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/input_Apply for hospital readm')) | ||
TestObject input_hospital_readm = findTestObject('Page_CURA Healthcare Service_appointment/input_Apply for hospital readm') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(input_hospital_readm) | ||
WebUI.click(input_hospital_readm) | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/input_Medicaid_programs')) | ||
TestObject input_Medicaid = findTestObject('Page_CURA Healthcare Service_appointment/input_Medicaid_programs') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(input_Medicaid) | ||
WebUI.click(input_Medicaid) | ||
WebUI.delay(1) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_appointment/input_Visit Date (Required)_vi'), '01/12/34') | ||
TestObject input_Visit_Date = findTestObject('Page_CURA Healthcare Service_appointment/input_Visit Date (Required)_vi') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(input_Visit_Date) | ||
WebUI.setText(input_Visit_Date, '01/12/34') | ||
WebUI.delay(1) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_appointment/textarea_Comment_comment'), 'This is a comment') | ||
TestObject textarea_comment = findTestObject('Page_CURA Healthcare Service_appointment/textarea_Comment_comment') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(textarea_comment) | ||
WebUI.setText(textarea_comment, 'This is a comment') | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/button_Book Appointment')) | ||
TestObject button_Book_Appointment = findTestObject('Page_CURA Healthcare Service_appointment/button_Book Appointment') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(button_Book_Appointment) | ||
WebUI.click(button_Book_Appointment) | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_summary/a_Go to Homepage')) | ||
TestObject a_Go_to_Homepage = findTestObject('Page_CURA Healthcare Service_summary/a_Go to Homepage') | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'(a_Go_to_Homepage) | ||
WebUI.click(a_Go_to_Homepage) | ||
WebUI.delay(1) | ||
|
||
WebUI.closeBrowser() | ||
WebUI.closeBrowser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,74 @@ | ||
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject | ||
|
||
import com.kms.katalon.core.model.FailureHandling as FailureHandling | ||
import com.kms.katalon.core.testobject.TestObject | ||
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI | ||
|
||
/** | ||
* This script visits the page at https://katalon-demo-cura.herokuapp.com/ | ||
* and the linked pages while highlighting elements with red border. | ||
* This script does the same as the TC1 but is much shorter. | ||
* This script calls the `pandemic` method of the | ||
* `com.kazurayam.ksbackyard.HighlightElement` class, | ||
* which dynamically modifies the `WebUI.setText` and other built-in keywords | ||
* using Groovy's Metaprogramming technique. | ||
*/ | ||
|
||
// open browser and navigate to the AUT | ||
WebUI.openBrowser('') | ||
WebUI.setViewPortSize(1024, 768) | ||
WebUI.navigateToUrl('https://katalon-demo-cura.herokuapp.com/') | ||
WebUI.delay(1) | ||
|
||
// highlight a specific element | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.on'( | ||
findTestObject('Page_CURA Healthcare Service_top/h1_CURA Healthcare Service')) | ||
WebUI.delay(2) | ||
|
||
|
||
|
||
// modify WebUI.* keywords which take TestObject as arg0 | ||
// so that they call Highlight.on() automatically | ||
// pandemic() will modify some WebUI.* keywords so that they call | ||
// com.kazurayam.ksbackyard.Highlight.on(testobject) | ||
// automatically | ||
CustomKeywords.'com.kazurayam.ksbackyard.HighlightElement.pandemic'() | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_top/a_Make Appointment'), FailureHandling.CONTINUE_ON_FAILURE) | ||
WebUI.delay(1) | ||
TestObject a_MakeAppointment = findTestObject('Page_CURA Healthcare Service_top/a_Make Appointment') | ||
WebUI.verifyElementPresent(a_MakeAppointment, 10) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_login/input_Username_username'), 'John Doe', FailureHandling.CONTINUE_ON_FAILURE) | ||
// the target element for WebUI.click keyword will be highlighted | ||
WebUI.click(a_MakeAppointment) | ||
WebUI.delay(1) | ||
|
||
WebUI.setEncryptedText(findTestObject('Page_CURA Healthcare Service_login/input_Password_password'), 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM', FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject input_username = findTestObject('Page_CURA Healthcare Service_login/input_Username_username') | ||
WebUI.setText(input_username, 'John Doe') | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_login/button_Login'), FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject input_password = findTestObject('Page_CURA Healthcare Service_login/input_Password_password') | ||
WebUI.setEncryptedText(input_password, 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM') | ||
WebUI.delay(1) | ||
|
||
//WebUI.selectOptionByValue(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), | ||
// 'Hongkong CURA Healthcare Center', false) | ||
//WebUI.delay(1) | ||
|
||
//WebUI.selectOptionByLabel(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), | ||
// 'Seoul CURA Healthcare Center', false) | ||
//WebUI.delay(1) | ||
|
||
WebUI.selectOptionByIndex(findTestObject('Page_CURA Healthcare Service_appointment/select_Facility'), 0, FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject button_Login = findTestObject('Page_CURA Healthcare Service_login/button_Login') | ||
WebUI.click(button_Login) | ||
WebUI.delay(1) | ||
|
||
TestObject select_Facility = findTestObject('Page_CURA Healthcare Service_appointment/select_Facility') | ||
WebUI.selectOptionByIndex(select_Facility, 0) | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/input_Apply for hospital readm'), FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject input_hospital_readm = findTestObject('Page_CURA Healthcare Service_appointment/input_Apply for hospital readm') | ||
WebUI.click(input_hospital_readm) | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/input_Medicaid_programs'), FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject input_Medicaid = findTestObject('Page_CURA Healthcare Service_appointment/input_Medicaid_programs') | ||
WebUI.click(input_Medicaid) | ||
WebUI.delay(1) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_appointment/input_Visit Date (Required)_vi'), '01/12/34', FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject input_Visit_Date = findTestObject('Page_CURA Healthcare Service_appointment/input_Visit Date (Required)_vi') | ||
WebUI.setText(input_Visit_Date, '01/12/34') | ||
WebUI.delay(1) | ||
|
||
WebUI.setText(findTestObject('Page_CURA Healthcare Service_appointment/textarea_Comment_comment'), 'This is a comment', FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject textarea_comment = findTestObject('Page_CURA Healthcare Service_appointment/textarea_Comment_comment') | ||
WebUI.setText(textarea_comment, 'This is a comment') | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_appointment/button_Book Appointment'), FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject button_Book_Appointment = findTestObject('Page_CURA Healthcare Service_appointment/button_Book Appointment') | ||
WebUI.click(button_Book_Appointment) | ||
WebUI.delay(1) | ||
|
||
WebUI.click(findTestObject('Page_CURA Healthcare Service_summary/a_Go to Homepage'), FailureHandling.CONTINUE_ON_FAILURE) | ||
TestObject a_Go_to_Homepage = findTestObject('Page_CURA Healthcare Service_summary/a_Go to Homepage') | ||
WebUI.click(a_Go_to_Homepage) | ||
WebUI.delay(1) | ||
|
||
WebUI.closeBrowser() | ||
WebUI.closeBrowser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<TestCaseEntity> | ||
<description></description> | ||
<name>TC0</name> | ||
<tag></tag> | ||
<comment></comment> | ||
<recordOption>OTHER</recordOption> | ||
<testCaseGuid>78b3ca65-5cb5-4a9e-b949-e19dbccff62a</testCaseGuid> | ||
</TestCaseEntity> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters