Skip to content

Commit

Permalink
Add acceptance test for creating new page
Browse files Browse the repository at this point in the history
  • Loading branch information
datakurre committed Jul 20, 2019
1 parent ee918b1 commit d00e492
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
32 changes: 32 additions & 0 deletions demo/robotlab/TestUpdates.ipynb
Expand Up @@ -193,6 +193,38 @@
" ... css:.breadcrumb a[href$=\"/tutorial/\"]\n",
" ... The Tutorial"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"*** Test Cases ***\n",
"\n",
"Scenario: Add new content\n",
" Set Plone headers\n",
" Go to ${GATSBY_URL}\n",
" Page should not contain New Page\n",
" ${payload}= Create dictionary\n",
" ... @type=Document\n",
" ... title=New Page\n",
" ... description=Hello World!\n",
" ... text=<p>HERE BE DRAGONS</p>\n",
" Post ${PLONE_URL} ${payload}\n",
" Integer response status 201\n",
" ${url}= Output response headers Location\n",
" Should be equal ${url} ${PLONE_URL}/new-page\n",
" Post ${PLONE_URL}/new-page/@workflow/publish\n",
" Integer response status 200\n",
" Wait until page contains element css:a[href$=\"/new-page/\"]\n",
" Element should contain\n",
" ... css:a[href$=\"/new-page/\"]\n",
" ... New Page\n",
" Page should not contain HERE BE DRAGONS\n",
" Go to ${GATSBY_URL}/new-page/\n",
" Wait until page contains HERE BE DRAGONS\n"
]
}
],
"metadata": {
Expand Down
26 changes: 26 additions & 0 deletions demo/test-updates.robot
Expand Up @@ -122,3 +122,29 @@ Scenario: Update content visible in breadcrumbs
Wait until element contains
... css:.breadcrumb a[href$="/tutorial/"]
... The Tutorial

*** Test Cases ***

Scenario: Add new content
Set Plone headers
Go to ${GATSBY_URL}
Page should not contain New Page
${payload}= Create dictionary
... @type=Document
... title=New Page
... description=Hello World!
... text=<p>HERE BE DRAGONS</p>
Post ${PLONE_URL} ${payload}
Integer response status 201
${url}= Output response headers Location
Should be equal ${url} ${PLONE_URL}/new-page
Post ${PLONE_URL}/new-page/@workflow/publish
Integer response status 200
Wait until page contains element css:a[href$="/new-page/"]
Element should contain
... css:a[href$="/new-page/"]
... New Page
Page should not contain HERE BE DRAGONS
Go to ${GATSBY_URL}/new-page/
Wait until page contains HERE BE DRAGONS

0 comments on commit d00e492

Please sign in to comment.