Skip to content

Commit e33b2c8

Browse files
committed
test(series/search/logic.robot): add test to check that non existing catalog number results in no records found
php-coder#1066
1 parent f722f82 commit e33b2c8

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

src/main/webapp/WEB-INF/views/series/search_result.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h3 class="text-center" th:text="${#strings.capitalize(search_results)}">
7070
</h3>
7171

7272
<!--/*/
73-
<p class="text-center" th:if="${#lists.isEmpty(searchResults)}" th:text="#{t_no_series_found}">
73+
<p id="no-series-found" class="text-center" th:if="${#lists.isEmpty(searchResults)}" th:text="#{t_no_series_found}">
7474
No series found
7575
</p>
7676
/*/-->

src/test/robotframework/selenium.utils.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,11 @@ Wait Until Element Value Is
6666
... ${text}
6767
... ';
6868
Wait For Condition ${elemHasValue}
69+
70+
Select Random Option From List
71+
[Documentation] Select any random item from the list.
72+
[Arguments] ${listName}
73+
${listItems}= Get List Items ${listName}
74+
${listSize}= Get Length ${listItems}
75+
${listItemIndex}= Evaluate random.randint(0,${listSize}-1) random
76+
Select from list by index ${listName} ${listItemIndex}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*** Settings ***
2+
Documentation Searching Series by Catalog Number and Catalog Name
3+
Library SeleniumLibrary
4+
Resource ../../selenium.utils.robot
5+
Suite Setup Before Test Suite
6+
Suite Teardown Close Browser
7+
Force Tags series search validation
8+
9+
*** Test Cases ***
10+
Search non existing catalog number results in no series found
11+
Input Text id=catalogNumber 888
12+
Select Random Option From List catalogName
13+
Submit Form id=search-series-form
14+
Element Text Should Be id=no-series-found No series found
15+
16+
*** Keywords ***
17+
Before Test Suite
18+
Open Browser ${SITE_URL}/ ${BROWSER}
19+
Register Keyword To Run On Failure Log Source

0 commit comments

Comments
 (0)