X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fwot%2FTestVerification.java;h=5b61f231bfcc66c0972877cf75542d32dc69ad1a;hp=eaff941c43d43de5c9d1f63ff6ddde0d8642b513;hb=d6fca4581fb8a65e2f84f227cdf32b080a58ab10;hpb=ca40eec05f7b3e6bd02014c30448af786aace969 diff --git a/tests/club/wpia/gigi/pages/wot/TestVerification.java b/tests/club/wpia/gigi/pages/wot/TestVerification.java index eaff941c..5b61f231 100644 --- a/tests/club/wpia/gigi/pages/wot/TestVerification.java +++ b/tests/club/wpia/gigi/pages/wot/TestVerification.java @@ -101,6 +101,7 @@ public class TestVerification extends ManagedTest { String body = executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); assertThat(body, containsString("10")); assertThat(body, containsString(applicantM)); + getMailReceiver().receive(applicantM); } @Test @@ -165,6 +166,7 @@ public class TestVerification extends ManagedTest { String error = fetchStartErrorMessage(IOUtils.readURL(uc)); if (succeed) { assertNull(error); + getMailReceiver().receive(applicantM); } else { assertTrue(error, !error.startsWith("")); assertThat(error, containsString("changed his personal details")); @@ -186,11 +188,13 @@ public class TestVerification extends ManagedTest { c.add(Calendar.HOUR_OF_DAY, 12); executeSuccess("date=" + sdf.format(new Date(c.getTimeInMillis())) + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); } @Test public void testVerifyFormPastInRange() throws IOException { executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); } @Test @@ -202,6 +206,7 @@ public class TestVerification extends ManagedTest { c.add(Calendar.DAY_OF_MONTH, 1); executeSuccess("date=" + sdf.format(new Date(c.getTimeInMillis())) + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); } @Test @@ -236,7 +241,8 @@ public class TestVerification extends ManagedTest { @Test public void testVerifyListingValid() throws IOException, GigiApiException { String uniqueLoc = createUniqueName(); - execute("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); String cookie = login(applicantM, TEST_PASSWORD); URLConnection url = get(cookie, Points.PATH); @@ -250,6 +256,8 @@ public class TestVerification extends ManagedTest { public void testAgentListingValid() throws IOException, GigiApiException { String uniqueLoc = createUniqueName(); executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); + String cookie = login(agentM, TEST_PASSWORD); URLConnection url = get(cookie, Points.PATH); String resp = IOUtils.readURL(url); @@ -317,6 +325,7 @@ public class TestVerification extends ManagedTest { // enter second entry String uniqueLoc = createUniqueName(); executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + getMailReceiver().receive(applicantM); // enter third entry on the same day URLConnection uc = get(cookie, VerifyPage.PATH); @@ -333,7 +342,7 @@ public class TestVerification extends ManagedTest { @Test public void testRANotificationSet() throws IOException, GigiApiException { - getMailReceiver().clearMails(); + getMailReceiver().assertEmpty(); User users[] = User.findByEmail(agentM); assertTrue("user RA Agent not found", users != null && users.length > 0); @@ -348,18 +357,15 @@ public class TestVerification extends ManagedTest { // enter verification String uniqueLoc = createUniqueName(); executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); - TestMail tm; - - do { - tm = getMailReceiver().receive(); - } while ( !tm.getTo().equals(targetMail)); + getMailReceiver().receive(applicantM); + TestMail tm = getMailReceiver().receive(targetMail); assertThat(tm.getMessage(), containsString("You entered a verification for the account with email address " + applicantM)); } @Test public void testRANotificationNotSet() throws IOException, GigiApiException { - getMailReceiver().clearMails(); + getMailReceiver().assertEmpty(); User users[] = User.findByEmail(agentM); assertTrue("user RA Agent not found", users != null && users.length > 0); @@ -375,7 +381,7 @@ public class TestVerification extends ManagedTest { TestMail tm; - tm = getMailReceiver().receive(); + tm = getMailReceiver().receive(applicantM); assertThat(tm.getMessage(), not(containsString("You entered a verification for the account with email address " + applicantM))); }