import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser('')

WebUI.maximizeWindow()

WebUI.navigateToUrl('https://kaumancare.my.id/login')

WebUI.setText(findTestObject('Page_Aplikasi Kepegawaian/input_nameexample.com'), 'admin@example.com')

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/input_'))

WebUI.setEncryptedText(findTestObject('Page_Aplikasi Kepegawaian/input_'), 'RAIVpflpDOg=')

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Login'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/a_Slip Gaji'))

WebUI.selectOptionByValue(findTestObject('Page_Aplikasi Kepegawaian/select_month'), '11', false)

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Filter'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_reset_pegawai_slip_gaji_fix'))

WebUI.selectOptionByValue(findTestObject('Page_Aplikasi Kepegawaian/select_year'), '2025', false)

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Filter'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_reset_pegawai_slip_gaji_fix'))

WebUI.setText(findTestObject('Page_Aplikasi Kepegawaian/input_Nama_NIP'), 'dewi')

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Filter'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_reset_pegawai_slip_gaji_fix'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/a_Generate Slip Gaji'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Generate Slip'))

WebUI.selectOptionByValue(findTestObject('Page_Aplikasi Kepegawaian/select_user_id'), '01km4bq0zszgd10gfq0v4p7jhw', false)

WebUI.selectOptionByValue(findTestObject('Page_Aplikasi Kepegawaian/select_month_1'), '3', false)

WebUI.setText(findTestObject('Page_Aplikasi Kepegawaian/input_base_salary'), '3000000')

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Tambah Tunjangan'))

WebUI.setText(findTestObject('Page_Aplikasi Kepegawaian/input_Jumlah'), '20000000')

WebUI.setText(findTestObject('Page_Aplikasi Kepegawaian/textarea_notes'), 'catatan')

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Generate Slip'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/a_PDF'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/a_Excel'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_hapus_pegawai_slip_gaji_fix'))

WebUI.waitForAlert(5)

WebUI.acceptAlert()

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Export PDF'))

WebUI.click(findTestObject('Page_Aplikasi Kepegawaian/button_Export Excel'))

WebUI.closeBrowser()

