Skip to content

Commit aaba7a5

Browse files
committed
update xpath selectors
1 parent ee59d4d commit aaba7a5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/schedule-attendance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Use the custom javascript action to mark attendance based on the determined type
4747
- name: Mark Attendance
48-
uses: cbecerrae/talana-attendance-javascript-action@v1
48+
uses: cbecerrae/talana-attendance-javascript-action@v2
4949
id: mark-attendance
5050
with:
5151
attendance_email: ${{ secrets.ATTENDANCE_EMAIL }}

utils/mark_attendance.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function clickMarkAttendance(driver) {
2929
// Click the mark attendance button
3030
logger.info("Clicking the mark attendance button.");
3131

32-
await click(driver, By.xpath('//p[text()="Turnos y marcas"]/..//button')); // Click the mark attendance button
32+
await click(driver, By.xpath('//button[@data-cy="pdt-mark-attendance"]')); // Click the mark attendance button
3333

3434
logger.info("Mark attendance button clicked successfully.");
3535
}
@@ -48,12 +48,12 @@ async function clickMarkTypeSelector(driver, markType) {
4848
// Click the mark type selector and select the specified mark type
4949
logger.info(`Entering the mark type "${markType}".`);
5050

51-
await click(driver, By.xpath('//div[text()="Marca"]/..')); // Click the mark type selector
51+
await click(driver, By.xpath('//input[@placeholder="Marca"]')); // Click the mark type selector
5252

5353
if (markType === "In") {
54-
await click(driver, By.xpath('//div[text()="Entrada"]')); // Select the "In" mark type
54+
await click(driver, By.xpath('//span[text()="Entrada"]')); // Select the "In" mark type
5555
} else if (markType === "Out") {
56-
await click(driver, By.xpath('//div[text()="Salida"]')); // Select the "Out" mark type
56+
await click(driver, By.xpath('//span[text()="Salida"]')); // Select the "Out" mark type
5757
}
5858

5959
logger.info(`Mark type "${markType}" entered successfully.`);
@@ -70,7 +70,7 @@ async function finishMarkAttendance(driver) {
7070
// Click the finish mark button
7171
logger.info("Clicking the finish mark button.");
7272

73-
await click(driver, By.xpath('//span[text()="Marcar"]/../../..')); // Click the finish mark button
73+
await click(driver, By.xpath('//button[@data-cy="pdt-mark-confirmMarkAttendance"]')); // Click the finish mark button
7474

7575
logger.info("Finish mark button clicked successfully.");
7676
}

0 commit comments

Comments
 (0)