Skip to content

Commit

Permalink
Add acceptance testing for sorting tips
Browse files Browse the repository at this point in the history
  • Loading branch information
bntti committed Apr 26, 2022
1 parent 5d17b69 commit 5db1819
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/templates/tips.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<h4>{{tip.title}}</h4>

{% if tip.type == "book" %}
<table>
<table id="tip_{{loop.index0}}">
<tbody>
<tr>
<td>Kirjailija:</td>
Expand Down
29 changes: 25 additions & 4 deletions src/tests/robot/tips.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Test Setup Reset Database, Create User, Log In, Add Book Tip And Go To Home Pag

*** Test Cases ***
Like Self Added Tip
Page Should Contain Book Tip Sinuhe egyptiläinen Mika Waltari 1945 robot
Click Button Tykkää
Page Should Contain Likes 1

Expand All @@ -16,7 +15,7 @@ Dislike Self Added Tip
Click Button En tykkää
Page Should Contain Likes 0

Like Other Users Tip
Like Tip Made By Other User
Click Button Tykkää
Log Out
Create User And Log In third_robot third_robot123
Expand All @@ -31,18 +30,40 @@ There Is No Like Button If Not Logged In
Page Should Not Contain Button En tykkää

Delete Self Added Tip
Page Should Contain Book Tip Sinuhe egyptiläinen Mika Waltari 1945 robot
Click Button Poista
Page Should Not Contain Sinuhe egyptiläinen

There Is No Delete Button On A Tip Added By Another User
Page Should Contain Book Tip Sinuhe egyptiläinen Mika Waltari 1945 robot
Page Should Contain Button Poista
Log Out
Create User And Log In other_robot other_robot123
Page Should Contain Book Tip Sinuhe egyptiläinen Mika Waltari 1945 robot
Page Should Not Contain Button Poista

Tips Are Sorted By Likes By Default
Like Tip
Add Book Tip And Go To Home Page Binary alphabet RobotAuthor 1970 robot
Table Cell Should Contain id:tip_0 1 2 Mika Waltari

Sort Tips By Time
Like Tip
Add Book Tip And Go To Home Page Binary alphabet RobotAuthor 1970 robot

Click Button id:menubutton
Click Link Aikaleiman mukaan
Table Cell Should Contain id:tip_0 1 2 RobotAuthor

Sort Tips By Likes
Like Tip
Add Book Tip And Go To Home Page Binary alphabet RobotAuthor 1970 robot

Click Button id:menubutton
Click Link Aikaleiman mukaan
Click Button id:menubutton
Click Link Tykkäyksien mukaan
Table Cell Should Contain id:tip_0 1 2 Mika Waltari


*** Keywords ***
Log Out
Click Link Kirjaudu ulos
Expand Down

0 comments on commit 5db1819

Please sign in to comment.