diff --git a/go.mod b/go.mod index 07543cea7..dc796a1ec 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/fasthttp/session/v2 v2.4.13 github.com/go-asn1-ber/asn1-ber v1.5.4 github.com/go-ldap/ldap/v3 v3.4.4 - github.com/go-rod/rod v0.110.1 + github.com/go-rod/rod v0.111.0 github.com/go-sql-driver/mysql v1.6.0 github.com/go-webauthn/webauthn v0.4.0 github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 1fdd5ce8a..88b401215 100644 --- a/go.sum +++ b/go.sum @@ -311,8 +311,8 @@ github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7 github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-rod/rod v0.110.1 h1:+e0rCHCsOyWsmbP/6J3TTcO3LiCodFEa9vjdUSOFm5w= -github.com/go-rod/rod v0.110.1/go.mod h1:GZDtmEs6RpF6kBRYpGCZXxXlKNneKVPiKOjaMbmVVjE= +github.com/go-rod/rod v0.111.0 h1:aMNNdz10GYPYec9z1WsFqwAdRYVsuufVTOrah7whG3I= +github.com/go-rod/rod v0.111.0/go.mod h1:GZDtmEs6RpF6kBRYpGCZXxXlKNneKVPiKOjaMbmVVjE= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= diff --git a/internal/suites/action_2fa_methods.go b/internal/suites/action_2fa_methods.go index b012c1107..5e8990a95 100644 --- a/internal/suites/action_2fa_methods.go +++ b/internal/suites/action_2fa_methods.go @@ -9,26 +9,26 @@ import ( ) func (rs *RodSession) doChangeMethod(t *testing.T, page *rod.Page, method string) { - err := rs.WaitElementLocatedByID(t, page, "methods-button").Click("left") + err := rs.WaitElementLocatedByID(t, page, "methods-button").Click("left", 1) require.NoError(t, err) rs.WaitElementLocatedByID(t, page, "methods-dialog") - err = rs.WaitElementLocatedByID(t, page, fmt.Sprintf("%s-option", method)).Click("left") + err = rs.WaitElementLocatedByID(t, page, fmt.Sprintf("%s-option", method)).Click("left", 1) require.NoError(t, err) } func (rs *RodSession) doChangeDevice(t *testing.T, page *rod.Page, deviceID string) { - err := rs.WaitElementLocatedByID(t, page, "selection-link").Click("left") + err := rs.WaitElementLocatedByID(t, page, "selection-link").Click("left", 1) require.NoError(t, err) rs.doSelectDevice(t, page, deviceID) } func (rs *RodSession) doSelectDevice(t *testing.T, page *rod.Page, deviceID string) { rs.WaitElementLocatedByID(t, page, "device-selection") - err := rs.WaitElementLocatedByID(t, page, fmt.Sprintf("device-%s", deviceID)).Click("left") + err := rs.WaitElementLocatedByID(t, page, fmt.Sprintf("device-%s", deviceID)).Click("left", 1) require.NoError(t, err) } func (rs *RodSession) doClickButton(t *testing.T, page *rod.Page, buttonID string) { - err := rs.WaitElementLocatedByID(t, page, buttonID).Click("left") + err := rs.WaitElementLocatedByID(t, page, buttonID).Click("left", 1) require.NoError(t, err) } diff --git a/internal/suites/action_login.go b/internal/suites/action_login.go index 73e7b8073..cb327b2d4 100644 --- a/internal/suites/action_login.go +++ b/internal/suites/action_login.go @@ -19,12 +19,12 @@ func (rs *RodSession) doFillLoginPageAndClick(t *testing.T, page *rod.Page, user if keepMeLoggedIn { keepMeLoggedInElement := rs.WaitElementLocatedByID(t, page, "remember-checkbox") - err = keepMeLoggedInElement.Click("left") + err = keepMeLoggedInElement.Click("left", 1) require.NoError(t, err) } buttonElement := rs.WaitElementLocatedByID(t, page, "sign-in-button") - err = buttonElement.Click("left") + err = buttonElement.Click("left", 1) require.NoError(t, err) } diff --git a/internal/suites/action_reset_password.go b/internal/suites/action_reset_password.go index 5a3ca5d5b..112771ed4 100644 --- a/internal/suites/action_reset_password.go +++ b/internal/suites/action_reset_password.go @@ -9,13 +9,13 @@ import ( ) func (rs *RodSession) doInitiatePasswordReset(t *testing.T, page *rod.Page, username string) { - err := rs.WaitElementLocatedByID(t, page, "reset-password-button").Click("left") + err := rs.WaitElementLocatedByID(t, page, "reset-password-button").Click("left", 1) require.NoError(t, err) // Fill in username. err = rs.WaitElementLocatedByID(t, page, "username-textfield").Input(username) require.NoError(t, err) // And click on the reset button. - err = rs.WaitElementLocatedByID(t, page, "reset-button").Click("left") + err = rs.WaitElementLocatedByID(t, page, "reset-button").Click("left", 1) require.NoError(t, err) } @@ -33,7 +33,7 @@ func (rs *RodSession) doCompletePasswordReset(t *testing.T, page *rod.Page, newP err = rs.WaitElementLocatedByID(t, page, "password2-textfield").Input(newPassword2) require.NoError(t, err) - err = rs.WaitElementLocatedByID(t, page, "reset-button").Click("left") + err = rs.WaitElementLocatedByID(t, page, "reset-button").Click("left", 1) require.NoError(t, err) } diff --git a/internal/suites/action_totp.go b/internal/suites/action_totp.go index c4cf63a31..78636eafb 100644 --- a/internal/suites/action_totp.go +++ b/internal/suites/action_totp.go @@ -12,7 +12,7 @@ import ( ) func (rs *RodSession) doRegisterTOTP(t *testing.T, page *rod.Page) string { - err := rs.WaitElementLocatedByID(t, page, "register-link").Click("left") + err := rs.WaitElementLocatedByID(t, page, "register-link").Click("left", 1) require.NoError(t, err) rs.verifyMailNotificationDisplayed(t, page) link := doGetLinkFromLastMail(t) diff --git a/internal/suites/scenario_available_methods_test.go b/internal/suites/scenario_available_methods_test.go index 7135f7afa..4fcaf35bf 100644 --- a/internal/suites/scenario_available_methods_test.go +++ b/internal/suites/scenario_available_methods_test.go @@ -59,7 +59,7 @@ func (s *AvailableMethodsScenario) TestShouldCheckAvailableMethods() { s.doLoginOneFactor(s.T(), s.Context(ctx), "john", "password", false, "") methodsButton := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "methods-button") - err := methodsButton.Click("left") + err := methodsButton.Click("left", 1) s.Assert().NoError(err) methodsDialog := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "methods-dialog") diff --git a/internal/suites/scenario_oidc_test.go b/internal/suites/scenario_oidc_test.go index 7add41b48..f303d4615 100644 --- a/internal/suites/scenario_oidc_test.go +++ b/internal/suites/scenario_oidc_test.go @@ -86,11 +86,11 @@ func (s *OIDCScenario) TestShouldAuthorizeAccessToOIDCApp() { s.waitBodyContains(s.T(), s.Context(ctx), "Not logged yet...") // Search for the 'login' link. - err := s.Page.MustSearch("Log in").Click("left") + err := s.Page.MustSearch("Log in").Click("left", 1) assert.NoError(s.T(), err) s.verifyIsConsentPage(s.T(), s.Context(ctx)) - err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "accept-button").Click("left") + err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "accept-button").Click("left", 1) assert.NoError(s.T(), err) // Verify that the app is showing the info related to the user stored in the JWT token. @@ -152,12 +152,12 @@ func (s *OIDCScenario) TestShouldDenyConsent() { s.waitBodyContains(s.T(), s.Context(ctx), "Not logged yet...") // Search for the 'login' link. - err := s.Page.MustSearch("Log in").Click("left") + err := s.Page.MustSearch("Log in").Click("left", 1) assert.NoError(s.T(), err) s.verifyIsConsentPage(s.T(), s.Context(ctx)) - err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "deny-button").Click("left") + err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "deny-button").Click("left", 1) assert.NoError(s.T(), err) s.verifyIsOIDC(s.T(), s.Context(ctx), "access_denied", "https://oidc.example.com:8080/error?error=access_denied&error_description=The+resource+owner+or+authorization+server+denied+the+request.+Make+sure+that+the+request+you+are+making+is+valid.+Maybe+the+credential+or+request+parameters+you+are+using+are+limited+in+scope+or+otherwise+restricted.&state=random-string-here") diff --git a/internal/suites/scenario_regulation_test.go b/internal/suites/scenario_regulation_test.go index 0eba4661d..92404fdd2 100644 --- a/internal/suites/scenario_regulation_test.go +++ b/internal/suites/scenario_regulation_test.go @@ -62,14 +62,14 @@ func (s *RegulationScenario) TestShouldBanUserAfterTooManyAttempt() { for i := 0; i < 3; i++ { err := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "password-textfield").Input("bad-password") require.NoError(s.T(), err) - err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left") + err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left", 1) require.NoError(s.T(), err) } // Enter the correct password and test the regulation lock out. err := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "password-textfield").Input("password") require.NoError(s.T(), err) - err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left") + err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left", 1) require.NoError(s.T(), err) s.verifyNotificationDisplayed(s.T(), s.Context(ctx), "Incorrect username or password.") @@ -79,7 +79,7 @@ func (s *RegulationScenario) TestShouldBanUserAfterTooManyAttempt() { // Enter the correct password and test a successful login. err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "password-textfield").Input("password") require.NoError(s.T(), err) - err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left") + err = s.WaitElementLocatedByID(s.T(), s.Context(ctx), "sign-in-button").Click("left", 1) require.NoError(s.T(), err) s.verifyIsSecondFactorPage(s.T(), s.Context(ctx)) } diff --git a/internal/suites/suite_duo_push_test.go b/internal/suites/suite_duo_push_test.go index 4573c5b06..56a2c4400 100644 --- a/internal/suites/suite_duo_push_test.go +++ b/internal/suites/suite_duo_push_test.go @@ -303,7 +303,7 @@ func (s *DuoPushWebDriverSuite) TestShouldFailSelectionBecauseOfSelectionDenied( s.doLoginOneFactor(s.T(), s.Context(ctx), "john", "password", false, "") s.doChangeMethod(s.T(), s.Context(ctx), "push-notification") - err := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "selection-link").Click("left") + err := s.WaitElementLocatedByID(s.T(), s.Context(ctx), "selection-link").Click("left", 1) require.NoError(s.T(), err) s.verifyNotificationDisplayed(s.T(), s.Context(ctx), "Device selection was denied by Duo policy") }