Skip to content

Commit ca3ca1e

Browse files
committed
test(collection/estimation): test collection estimation page
Fix php-coder#893
1 parent a963ea6 commit ca3ca1e

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

src/main/webapp/WEB-INF/views/collection/estimation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ <h3 class="text-center" th:text="#{t_collection_of(${ownerName})}">
6767
</h3>
6868

6969
<!--/*/
70-
<p class="text-center" th:if="${#lists.isEmpty(seriesOfCollection)}" th:text="#{t_empty_collection}">
70+
<p id="empty-series-of-collection" class="text-center" th:if="${#lists.isEmpty(seriesOfCollection)}" th:text="#{t_empty_collection}">
7171
In this collection is no stamps
7272
</p>
7373
/*/-->
7474

75-
<table class="table table-hover" th:if="${not #lists.isEmpty(seriesOfCollection)}">
75+
<table id="paid-user-collection" class="table table-hover" th:if="${not #lists.isEmpty(seriesOfCollection)}">
7676
<thead>
7777
<tr class="active">
7878
<th th:text="#{t_series}">Series</th>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
*** Settings ***
2+
Documentation Verify collection estimation scenarios
3+
Library SeleniumLibrary
4+
Resource ../../auth.steps.robot
5+
Resource ../../selenium.utils.robot
6+
Suite Setup Before Test Suite
7+
Suite Teardown Close Browser
8+
Force Tags collection estimation logic
9+
10+
*** Test Cases ***
11+
Message should be shown when a collection is empty
12+
Go To ${SITE_URL}/collection/paid/estimation
13+
Element Text Should Be id=empty-series-of-collection In this collection is no stamps
14+
15+
Series with its price should be taken into account
16+
[Tags] unstable
17+
Go To ${SITE_URL}/series/1
18+
Input Text id=paid-price 100
19+
Select From List By Value id=paid-currency ${currencyId}
20+
Submit Form id=add-series-form
21+
Go To ${SITE_URL}/collection/paid/estimation
22+
${amountInText} = Catenate 100.00 ${currencyId}
23+
Table Header Should Contain paid-user-collection ${amountInText}
24+
25+
Series without price should be shown but not taken into account
26+
[Tags] unstable
27+
Go To ${SITE_URL}/series/2
28+
Submit Form id=add-series-form
29+
Go To ${SITE_URL}/collection/paid/estimation
30+
${amountInText} = Catenate 100.00 ${currencyId}
31+
Table Header Should Contain paid-user-collection 100.00
32+
33+
*** Keywords ***
34+
Before Test Suite
35+
@{list} = Create List USD EUR RUB CZK
36+
${randomCurrencyId} = Evaluate random.choice((${list})) modules=random
37+
Set Suite Variable ${currencyId} ${randomCurrencyId}
38+
Open Browser ${SITE_URL}/account/auth ${BROWSER}
39+
Register Keyword To Run On Failure Log Source
40+
Log In As login=paid password=test

src/test/robotframework/selenium.utils.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ Select Random Option From List
7272
[Arguments] ${locator}
7373
${options}= Get List Items ${locator}
7474
${size}= Get Length ${options}
75-
${randomIndex}= Evaluate random.randint(0, ${size}-1) modules=random
76-
Select From List By Index ${locator} ${randomIndex}
75+
${randomItemIndex}= Evaluate random.randint(0, ${size}-1) modules=random
76+
Select From List By Index ${locator} ${randomItemIndex}

0 commit comments

Comments
 (0)