feat: adjust waiting times

This commit is contained in:
Urko 2023-07-02 23:56:23 +02:00
parent 0933174ea1
commit 62bda54d98
1 changed files with 5 additions and 4 deletions

View File

@ -29,7 +29,7 @@ func NewArcherAx50(page *rod.Page) ArcherAx50 {
} }
func (p ArcherAx50) Login(user, pass string) error { func (p ArcherAx50) Login(user, pass string) error {
time.Sleep(time.Millisecond * 1850) time.Sleep(time.Millisecond * 5550)
p.page.MustEvaluate(&rod.EvalOptions{ p.page.MustEvaluate(&rod.EvalOptions{
JS: `() => { JS: `() => {
@ -57,7 +57,7 @@ func (p ArcherAx50) Login(user, pass string) error {
} }
func (p ArcherAx50) SwitchWIFI() error { func (p ArcherAx50) SwitchWIFI() error {
time.Sleep(time.Millisecond * 1350) time.Sleep(time.Millisecond * 1850)
pageURL := p.page.MustInfo().URL pageURL := p.page.MustInfo().URL
log.Println("p.page.MustInfo().URL", pageURL) log.Println("p.page.MustInfo().URL", pageURL)
@ -68,7 +68,7 @@ func (p ArcherAx50) SwitchWIFI() error {
wirelessTab.MustClick() wirelessTab.MustClick()
log.Println(p.wirelessTab, "DONE") log.Println(p.wirelessTab, "DONE")
time.Sleep(time.Millisecond * 1250) time.Sleep(time.Millisecond * 1850)
checked := p.page.MustEvaluate(&rod.EvalOptions{ checked := p.page.MustEvaluate(&rod.EvalOptions{
JS: `() => { JS: `() => {
return document.getElementById('` + p.chkWifi2gID + `').checked; return document.getElementById('` + p.chkWifi2gID + `').checked;
@ -84,6 +84,7 @@ func (p ArcherAx50) SwitchWIFI() error {
}`, }`,
}) })
time.Sleep(time.Millisecond * 150)
log.Println(p.chkWifi2gID, "DONE") log.Println(p.chkWifi2gID, "DONE")
saveButton, err := p.page.Element(p.saveButtonID) saveButton, err := p.page.Element(p.saveButtonID)
if err != nil { if err != nil {
@ -92,7 +93,7 @@ func (p ArcherAx50) SwitchWIFI() error {
saveButton.MustClick() saveButton.MustClick()
log.Println(p.saveButtonID, "DONE") log.Println(p.saveButtonID, "DONE")
time.Sleep(time.Millisecond * 1500) time.Sleep(time.Millisecond * 5500)
return nil return nil
} }