Commit e1cda649 authored by James Valleroy's avatar James Valleroy

functional_tests: Test ikiwiki backup and restore

Signed-off-by: James Valleroy's avatarJames Valleroy <jvalleroy@mailbox.org>
parent a356be87
......@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
@apps @ikiwiki
@apps @ikiwiki @backups
Feature: ikiwiki Wiki and Blog
Manage wikis and blogs.
......@@ -32,4 +32,12 @@ Scenario: Disable wiki application
Given the wiki application is enabled
When I disable the wiki application
Then the wiki site should not be available
\ No newline at end of file
Scenario: Backup and restore wiki
Given the wiki application is enabled
When there is an ikiwiki wiki
And I create a backup of the ikiwiki app data
And I delete the ikiwiki wiki
And I export the ikiwiki app data backup
And I restore the ikiwiki app data backup
Then the ikiwiki wiki should be restored
......@@ -199,3 +199,18 @@ def set_mediawiki_admin_password(browser):
@when(parsers.parse('I disable message archive management'))
def set_mediawiki_admin_password(browser):
application.disable_ejabberd_message_archive_management(browser)
@when('there is an ikiwiki wiki')
def ikiwiki_create_wiki_if_needed(browser):
application.ikiwiki_create_wiki_if_needed(browser)
@when('I delete the ikiwiki wiki')
def ikiwiki_delete_wiki(browser):
application.ikiwiki_delete_wiki(browser)
@then('the ikiwiki wiki should be restored')
def ikiwiki_should_exist(browser):
assert application.ikiwiki_wiki_exists(browser)
......@@ -267,3 +267,35 @@ def disable_ejabberd_message_archive_management(browser):
interface.nav_to_module(browser, 'ejabberd')
_change_status(browser, 'ejabberd', 'disabled',
checkbox_id='id_MAM_enabled')
def ikiwiki_create_wiki_if_needed(browser):
"""Create wiki if it does not exist."""
interface.nav_to_module(browser, 'ikiwiki')
browser.find_link_by_href('/plinth/apps/ikiwiki/manage/').first.click()
wiki = browser.find_link_by_href('/ikiwiki/wiki')
if not wiki:
browser.find_link_by_href('/plinth/apps/ikiwiki/create/').first.click()
browser.find_by_id('id_ikiwiki-name').fill('wiki')
browser.find_by_id('id_ikiwiki-admin_name').fill(
config['DEFAULT']['username'])
browser.find_by_id('id_ikiwiki-admin_password').fill(
config['DEFAULT']['password'])
submit(browser)
def ikiwiki_delete_wiki(browser):
"""Delete wiki."""
interface.nav_to_module(browser, 'ikiwiki')
browser.find_link_by_href('/plinth/apps/ikiwiki/manage/').first.click()
browser.find_link_by_href(
'/plinth/apps/ikiwiki/wiki/delete/').first.click()
submit(browser)
def ikiwiki_wiki_exists(browser):
"""Check whether the wiki exists."""
interface.nav_to_module(browser, 'ikiwiki')
browser.find_link_by_href('/plinth/apps/ikiwiki/manage/').first.click()
wiki = browser.find_link_by_href('/ikiwiki/wiki')
return bool(wiki)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment