Skip to content

Commit c34186f

Browse files
committed
1 parent 4eb4621 commit c34186f

File tree

7 files changed

+64
-202
lines changed

7 files changed

+64
-202
lines changed

pom.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@
284284
<scope>test</scope>
285285
</dependency>
286286

287+
<!-- Required for src/test/robotframework/account/registration/logic.robot -->
288+
<dependency>
289+
<groupId>com.github.hi-fi</groupId>
290+
<artifactId>robotframework-httprequestlibrary</artifactId>
291+
<version>${robotframework-httprequest.version}</version>
292+
<scope>test</scope>
293+
<exclusions>
294+
<exclusion>
295+
<groupId>commons-logging</groupId>
296+
<artifactId>commons-logging</artifactId>
297+
</exclusion>
298+
</exclusions>
299+
</dependency>
300+
287301
<dependency>
288302
<groupId>com.github.hi-fi</groupId>
289303
<artifactId>robotframework-seleniumlibrary</artifactId>
@@ -433,13 +447,6 @@
433447
<scope>test</scope>
434448
</dependency>
435449

436-
<dependency>
437-
<groupId>org.subethamail</groupId>
438-
<artifactId>subethasmtp</artifactId>
439-
<version>${subethasmtp.version}</version>
440-
<scope>test</scope>
441-
</dependency>
442-
443450
<dependency>
444451
<groupId>org.testng</groupId>
445452
<artifactId>testng</artifactId>
@@ -552,6 +559,7 @@
552559
<owasp-plugin.version>3.0.2</owasp-plugin.version>
553560
<pmd.plugin.version>3.12.0</pmd.plugin.version>
554561
<resources.plugin.version>3.1.0</resources.plugin.version>
562+
<robotframework-httprequest.version>0.0.15</robotframework-httprequest.version>
555563
<robotframework-plugin.version>1.4.7</robotframework-plugin.version>
556564
<robotframework-selenium.version>2.53.1.1</robotframework-selenium.version>
557565
<robotframework.version>3.0.4</robotframework.version>
@@ -583,7 +591,6 @@
583591
<!-- Define default value for spring-boot-starter-parent (https://github.com/spring-projects/spring-boot/blob/v1.5.20.RELEASE/spring-boot-starters/spring-boot-starter-parent/pom.xml) -->
584592
<start-class>ru.mystamps.web.support.spring.boot.ApplicationBootstrap</start-class>
585593

586-
<subethasmtp.version>3.1.7</subethasmtp.version>
587594
<surefire.plugin.version>2.22.0</surefire.plugin.version>
588595
<testng.version>6.8.8</testng.version>
589596
<thumbnailator.version>0.4.8</thumbnailator.version>
@@ -1154,7 +1161,7 @@
11541161
http://wiremock.org/docs/running-standalone/
11551162
-->
11561163
<!-- Handy for debugging: add &#45;&#45;verbose option -->
1157-
<params>--port=8888 --disable-banner --no-request-journal --container-threads=4 --jetty-acceptor-threads=1</params>
1164+
<params>--port=8888 --disable-banner --container-threads=4 --jetty-acceptor-threads=1</params>
11581165
</configuration>
11591166
<executions>
11601167
<execution>

src/main/webapp/WEB-INF/views/account/activate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h3 th:text="#{t_activation_on_site}">
7676
</div>
7777

7878
<div class="row" th:if="${justRegisteredUser}">
79-
<div class="alert alert-success text-center col-sm-10 col-sm-offset-1" th:text="#{t_activation_sent_message}">
79+
<div id="msg-success" class="alert alert-success text-center col-sm-10 col-sm-offset-1" th:text="#{t_activation_sent_message}">
8080
Instructions to finish registration have been sent to your e-mail
8181
</div>
8282
</div>

src/test/config/testng.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@
77
</classes>
88
</test>
99

10-
<test name="When anonymous user register account">
11-
<classes>
12-
<class name="ru.mystamps.web.tests.cases.WhenAnonymousUserRegisterAccount" />
13-
</classes>
14-
</test>
15-
1610
</suite>

src/test/java/ru/mystamps/web/tests/cases/WhenAnonymousUserRegisterAccount.java

Lines changed: 0 additions & 136 deletions
This file was deleted.

src/test/java/ru/mystamps/web/tests/page/RegisterAccountPage.java

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
*** Settings ***
2+
Documentation Verify account registration scenario
3+
Library String
4+
Library SeleniumLibrary
5+
Library HttpRequestLibrary
6+
Suite Setup Before Test Suite
7+
Suite Teardown After Test Suite
8+
Force Tags account registration logic
9+
10+
*** Test Cases ***
11+
After account creation an e-mail with activation link should be send
12+
Input Text id=email [email protected]
13+
Submit Form id=register-account-form
14+
Element Text Should Be id=msg-success Instructions to finish registration have been sent to your e-mail
15+
# check that e-mail has been sent by querying Wiremock. See http://wiremock.org/docs/verifying/
16+
Create Session mailserver ${MOCK_SERVER}
17+
${searchQuery}= Set Variable { "method": "POST", "url": "/mailgun/send-message" }
18+
${response}= Post Request mailserver /__admin/requests/find data=${searchQuery}
19+
Log ${response.json}
20+
Length Should Be ${response.json['requests']} 1
21+
${linkRegexp}= Set Variable ${SITE_URL}/account/activate\\?key=[0-9a-z]{10}
22+
${links}= Get Regexp Matches ${response.json['requests'][0]['body']} ${linkRegexp}
23+
Length Should Be ${links} 1
24+
25+
*** Keywords ***
26+
Before Test Suite
27+
Open Browser ${SITE_URL}/account/register ${BROWSER}
28+
Register Keyword To Run On Failure Log Source
29+
30+
After Test Suite
31+
Close Browser
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"request": {
3+
"method": "POST",
4+
"url": "/mailgun/send-message"
5+
},
6+
"response": {
7+
"status": 200,
8+
"headers": {
9+
"Content-Type": "application/json"
10+
},
11+
"jsonBody": {
12+
"id": "<[email protected]>",
13+
"message": "Queued. Thank you."
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)