From d00e4922d2268e8899da99102298bb4514e719b1 Mon Sep 17 00:00:00 2001 From: Asko Soukka Date: Sat, 20 Jul 2019 11:18:53 +0300 Subject: [PATCH] Add acceptance test for creating new page --- demo/robotlab/TestUpdates.ipynb | 32 ++++++++++++++++++++++++++++++++ demo/test-updates.robot | 26 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/demo/robotlab/TestUpdates.ipynb b/demo/robotlab/TestUpdates.ipynb index 5f9c9e7d..7f4fe27c 100644 --- a/demo/robotlab/TestUpdates.ipynb +++ b/demo/robotlab/TestUpdates.ipynb @@ -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=

HERE BE DRAGONS

\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": { diff --git a/demo/test-updates.robot b/demo/test-updates.robot index e966ec3c..893153c9 100644 --- a/demo/test-updates.robot +++ b/demo/test-updates.robot @@ -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=

HERE BE DRAGONS

+ 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 +