Skip to content

Commit

Permalink
Merge 6d73e9c into 2a722f3
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Dec 2, 2018
2 parents 2a722f3 + 6d73e9c commit e8236ab
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions tests/keywords.robot
Expand Up @@ -65,21 +65,7 @@ Skip test on Guillotina
# action is carried out (e.g. 'the front page')

A logged in site-administrator
${headers} Create dictionary Accept=application/json Content-Type=application/json
${data}= Create dictionary login=admin password=secret
Run Keyword If '${API}' == 'Guillotina' Create Session plone http://localhost:8081/db/container
Run Keyword If '${API}' == 'Plone' Create Session plone http://localhost:55001/plone
${resp}= Post Request plone /@login headers=${headers} data=${data}
Should Be Equal As Strings ${resp.status_code} 200
# Log ${resp.json().get('token')} WARN
the front page
Add Cookie auth_token ${resp.json().get('token')}
Reload page
Wait until keyword succeeds 120s 1s
... Page fully loaded
Wait until page contains element css=#toolbar
Wait until page contains Log out
Page should contain Log out
Autologin as admin secret

the front page
Go to ${FRONTEND_URL}
Expand Down Expand Up @@ -129,3 +115,22 @@ I should be logged out

I should be logged in
Wait until element is visible css=.left.fixed.menu


Autologin as
[Arguments] ${username}=admin ${password}=secret
${headers} Create dictionary Accept=application/json Content-Type=application/json
${data}= Create dictionary login=admin password=secret
Run Keyword If '${API}' == 'Guillotina' Create Session plone http://localhost:8081/db/container
Run Keyword If '${API}' == 'Plone' Create Session plone http://localhost:55001/plone
${resp}= Post Request plone /@login headers=${headers} data=${data}
Should Be Equal As Strings ${resp.status_code} 200
# Log ${resp.json().get('token')} WARN
the front page
Add Cookie auth_token ${resp.json().get('token')}
Reload page
Wait until keyword succeeds 120s 1s
... Page fully loaded
Wait until page contains element css=#toolbar
Wait until page contains Log out
Page should contain Log out

0 comments on commit e8236ab

Please sign in to comment.