|
|
@ -406,13 +406,15 @@ func selectBookingSlot(ctx context.Context, page *rod.Page, timeCode string) *ro |
|
|
|
selectButtonElement := rowElement.MustElement("a") |
|
|
|
selectButtonElement.Eval(`this.click()`) |
|
|
|
|
|
|
|
time.Sleep(1000 * time.Millisecond) |
|
|
|
page.MustWaitLoad() |
|
|
|
|
|
|
|
// Check before exiting
|
|
|
|
bodyText := page.MustElement("body").MustText() |
|
|
|
if strings.Contains(bodyText, "System maintenance scheduled at 23:00 to 00:15 (UTC+8).") { |
|
|
|
completed = false |
|
|
|
|
|
|
|
// TODO: Test if it is okay to sleep after checking for maintenance
|
|
|
|
time.Sleep(1000 * time.Millisecond) |
|
|
|
closeModalButton := page.MustElement("#popupModalCloseButton") |
|
|
|
closeModalButton.Eval(`this.click()`) |
|
|
|
time.Sleep(1000 * time.Millisecond) |
|
|
|