X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Faccount%2FTestChangePassword.java;h=73d23c56e8e3e99403da209b1d267446787e5c1e;hb=ae39029198c046f75f6b0efea270970d6308fb5c;hp=7a2a6a923f7187f0d7e5bc018f55216713529b4d;hpb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e;p=gigi.git diff --git a/tests/club/wpia/gigi/pages/account/TestChangePassword.java b/tests/club/wpia/gigi/pages/account/TestChangePassword.java index 7a2a6a92..73d23c56 100644 --- a/tests/club/wpia/gigi/pages/account/TestChangePassword.java +++ b/tests/club/wpia/gigi/pages/account/TestChangePassword.java @@ -5,10 +5,11 @@ import static org.junit.Assert.*; import java.io.IOException; import java.net.URLEncoder; +import org.hamcrest.CoreMatchers; import org.junit.Test; import club.wpia.gigi.GigiApiException; -import club.wpia.gigi.pages.account.ChangePasswordPage; +import club.wpia.gigi.testUtils.ArrayContains; import club.wpia.gigi.testUtils.ClientTest; public class TestChangePassword extends ClientTest { @@ -44,6 +45,9 @@ public class TestChangePassword extends ClientTest { assertTrue(isLoggedin(login(u.getEmail(), TEST_PASSWORD + "v2"))); assertFalse(isLoggedin(login(u.getEmail(), TEST_PASSWORD))); + String[] result = u.getAdminLog(); + assertThat(result, ArrayContains.contains(CoreMatchers.equalTo("User triggered password reset"))); + } @Test @@ -103,4 +107,19 @@ public class TestChangePassword extends ClientTest { } + @Test + public void testChangePasswordCertLogin() throws IOException, GigiApiException { + // no cert login + String np = URLEncoder.encode(TEST_PASSWORD + "v1", "UTF-8"); + String error = executeBasicWebInteraction(cookie, path, "pword1=" + np + "&pword2=" + np); + assertNotNull(error); + + // cert login + cookie = cookieWithCertificateLogin(u); + error = executeBasicWebInteraction(cookie, path, "pword1=" + np + "&pword2=" + np); + assertNull(error); + + cookie = login(u.getEmail(), TEST_PASSWORD); + loginCertificate = null; + } }