Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleface committed Oct 4, 2024
1 parent 7cb4398 commit ad28199
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,43 @@ class AmeliContentScript extends SuperContentScript {
async gotoLoginForm() {
this.launcher.log('info', '🤖 gotoLoginForm starts')
await this.page.goto(baseUrl)
this.launcher.log('info', '🤖 gotoLoginForm after goto')
await this.page
.getByCss(
'.deconnexionButton, #connexioncompte_2nir_as, #id_r_cnx_btn_code'
'.deconnexionButton, #connexioncompte_2nir_as, a#id_r_cnx_btn_code.r_btlien.connexion'
)
.waitFor()
const firstConnectLocator = this.page.getByCss('#id_r_cnx_btn_code')
if (await firstConnectLocator.isPresent()) {
this.launcher.log('info', '🤖 gotoLoginForm after first waitfor')
const deconnexionButtonPresent = await this.page
.getByCss('.deconnexionButton')
.isPresent()
this.launcher.log(
'info',
'🐛🐛🐛 deconnexionButtonPresent ' + deconnexionButtonPresent
)
const connexioncomptePresent = await this.page
.getByCss('#connexioncompte_2nir_as')
.isPresent()
this.launcher.log(
'info',
'🐛🐛🐛 connexioncomptePresent ' + connexioncomptePresent
)
const codePresent = await this.page
.getByCss('a#id_r_cnx_btn_code.r_btlien.connexion')
.isPresent()
this.launcher.log('info', '🐛🐛🐛 codePresent ' + codePresent)
const firstConnectLocator = this.page.getByCss(
'a#id_r_cnx_btn_code.r_btlien.connexion'
)
this.launcher.log('info', '🤖 gotoLoginForm after locator')
const isPresent = await firstConnectLocator.isPresent()
this.launcher.log('info', 'isPresent ' + isPresent)
if (isPresent) {
this.launcher.log('info', 'Found firstConnectLocator')
await firstConnectLocator.click()
this.launcher.log('info', 'after click')
}
this.launcher.log('info', 'last waitfor')
await this.page
.getByCss('.deconnexionButton, #connexioncompte_2nir_as')
.waitFor()
Expand Down

0 comments on commit ad28199

Please sign in to comment.