-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_bulk_approve.py
37 lines (27 loc) · 1.02 KB
/
test_bulk_approve.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from time import sleep
from playwright.sync_api import Page, expect
from common import login, go_to_attendance
def test_bulk_approve(page: Page):
login(page)
go_to_attendance(page)
go_to_approval(page)
select_all(page)
sleep(2)
approve(page)
sleep(4)
def go_to_approval(page: Page):
page.locator("//a[@data-title='Weekly Attendance Approval']").hover()
page.locator("//a[@data-title='Weekly Attendance Approval']").click()
def select_all(page: Page):
page.locator("//div[@id='dvSelectAll']").click()
def approve(page: Page):
submit = page.locator("//button[@id='BulkActionUpdateByHR']")
try:
expect(submit).to_be_enabled()
except:
print("Nothing to approve here")
return
submit.click()
page.locator("//form[@id='AttendanceMultipleApprovalForm']/div[1]/div").click()
page.locator("//form[@id='AttendanceMultipleApprovalForm']/div[1]//div[@data-value='1']").click()
page.locator("//button[@id='btnSaveAttendanceMultipleApproval']").click()