107 lines
2.9 KiB
Groovy
107 lines
2.9 KiB
Groovy
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
|
|
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
|
|
|
|
// ======================
|
|
// LOGIN
|
|
// ======================
|
|
WebUI.openBrowser('')
|
|
|
|
WebUI.navigateToUrl('https://medory.my.id/login')
|
|
|
|
WebUI.setText(findTestObject('Page_Login - MedData/input_Email'), 'admin@admin.com')
|
|
|
|
WebUI.setEncryptedText(findTestObject('Page_Login - MedData/input_Password'), '8SQVv/p9jVRYfSV/eMGvjg==')
|
|
|
|
WebUI.click(findTestObject('Page_Login - MedData/button_Masuk'))
|
|
|
|
WebUI.delay(3)
|
|
|
|
// ======================
|
|
// MASUK MENU SATUAN
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Dashboard MedData - MedData/a_Satuan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// TC1 - BUKA FORM TAMBAH
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Satuan Obat - MedData/a_Tambah Satuan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// TC2 - INPUT DATA VALID
|
|
// ======================
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/input_Nama Satuan'), 'Bag1')
|
|
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/textarea_Keterangan'), 'Bag sachet')
|
|
|
|
// ======================
|
|
// TC3 - SIMPAN DATA
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Tambah Satuan - MedData/button_Simpan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// TC4 - TAMPILKAN DATA
|
|
// ======================
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// TC5 - TAMBAH DUPLIKAT
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Satuan Obat - MedData/a_Tambah Satuan'))
|
|
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/input_Nama Satuan'), 'Bag1')
|
|
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/textarea_Keterangan'), 'Bag sachet')
|
|
|
|
WebUI.click(findTestObject('Page_Tambah Satuan - MedData/button_Simpan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
WebUI.click(findTestObject('Page_Tambah Satuan - MedData/a_Batal'))
|
|
|
|
// ======================
|
|
// TC6 - INPUT KOSONG
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Satuan Obat - MedData/a_Tambah Satuan'))
|
|
|
|
WebUI.click(findTestObject('Page_Tambah Satuan - MedData/button_Simpan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
WebUI.click(findTestObject('Page_Tambah Satuan - MedData/a_Batal'))
|
|
|
|
// ======================
|
|
// TC7 - EDIT DATA
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Satuan Obat - MedData/a_Edit'))
|
|
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/input_Nama Satuan'), ' UbahEdited')
|
|
|
|
WebUI.setText(findTestObject('Page_Edit Satuan - MedData/textarea_Keterangan'), 'Bag sachet kecil')
|
|
|
|
WebUI.click(findTestObject('Page_Edit Satuan - MedData/button_Simpan Perubahan'))
|
|
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// TC10 - HAPUS DATA + ALERT OK
|
|
// ======================
|
|
WebUI.click(findTestObject('Page_Satuan Obat - MedData/button_Hapus'))
|
|
|
|
WebUI.waitForAlert(5)
|
|
|
|
WebUI.acceptAlert()
|
|
|
|
WebUI.delay(2)
|
|
|
|
// ======================
|
|
// SELESAI
|
|
// ======================
|
|
WebUI.closeBrowser()
|
|
|