Modifying how the session checking works to prevent getting stuck on home page
This commit is contained in:
parent
466ff7c32e
commit
09de8ecff3
1 changed files with 11 additions and 2 deletions
|
|
@ -57,8 +57,8 @@ export class BaanReserverenService {
|
|||
session: this.session,
|
||||
})
|
||||
if (this.page.url().includes(BAAN_RESERVEREN_ROOT_URL)) {
|
||||
// Check session via reload to see if we are still logged in via cookies
|
||||
await this.page.reload()
|
||||
// Check session by going to /reservations to see if we are still logged in via cookies
|
||||
await this.navigateToReservations()
|
||||
if (this.page.url().includes('?reason=LOGGED_IN')) {
|
||||
return SessionAction.Login
|
||||
}
|
||||
|
|
@ -201,6 +201,15 @@ export class BaanReserverenService {
|
|||
})
|
||||
}
|
||||
|
||||
private async navigateToReservations() {
|
||||
this.loggerService.debug('Navigating to waiting list')
|
||||
await this.page
|
||||
.goto(`${BAAN_RESERVEREN_ROOT_URL}/${BaanReserverenUrls.Reservations}`)
|
||||
.catch((e) => {
|
||||
throw new RunnerWaitingListNavigationError(e)
|
||||
})
|
||||
}
|
||||
|
||||
private async openWaitingListDialog() {
|
||||
this.loggerService.debug('Opening waiting list dialog')
|
||||
await this.page.waitForNetworkIdle()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue