refactor: parameterize submit delay
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"gitea.urkob.com/urko/go-wifi-switcher/pkg/provider"
|
||||
"github.com/go-rod/rod"
|
||||
)
|
||||
|
||||
@@ -56,7 +57,7 @@ func (p ArcherAx50) Login(user, pass string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ArcherAx50) SwitchWIFI() error {
|
||||
func (p ArcherAx50) SwitchWIFI(cfg provider.SwitchConfig) error {
|
||||
pageURL := p.page.MustInfo().URL
|
||||
log.Println("p.page.MustInfo().URL", pageURL)
|
||||
|
||||
@@ -94,7 +95,7 @@ func (p ArcherAx50) SwitchWIFI() error {
|
||||
saveButton.MustClick()
|
||||
log.Println(p.saveButtonID, "DONE")
|
||||
|
||||
time.Sleep(time.Millisecond * 7500)
|
||||
time.Sleep(time.Millisecond * cfg.SubmitDelay)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user