From b8737ad6638c4e7ebe09dc2871e06c39a71b0bab Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sun, 27 Jan 2019 09:17:22 -0500 Subject: [PATCH] help: Add functional test to check status logs page Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- functional_tests/features/help.feature | 27 +++++++++++++++++++ .../step_definitions/interface.py | 10 +++++++ functional_tests/support/interface.py | 8 ++++++ 3 files changed, 45 insertions(+) create mode 100644 functional_tests/features/help.feature diff --git a/functional_tests/features/help.feature b/functional_tests/features/help.feature new file mode 100644 index 000000000..d03f6b24d --- /dev/null +++ b/functional_tests/features/help.feature @@ -0,0 +1,27 @@ +# +# This file is part of FreedomBox. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +@help @system @essential +Feature: Help module + Show various information about the system. + +Background: + Given I'm a logged in user + +Scenario: Status logs + When I go to the status logs page + Then status logs should be shown diff --git a/functional_tests/step_definitions/interface.py b/functional_tests/step_definitions/interface.py index e414be22a..c9bb7be4c 100644 --- a/functional_tests/step_definitions/interface.py +++ b/functional_tests/step_definitions/interface.py @@ -83,3 +83,13 @@ def new_user_is_not_listed(browser, name): def sample_local_file(): file_path, contents = interface.create_sample_local_file() return dict(file_path=file_path, contents=contents) + + +@when('I go to the status logs page') +def help_go_to_status_logs(browser): + interface.go_to_status_logs(browser) + + +@then('status logs should be shown') +def help_status_logs_are_shown(browser): + assert interface.are_status_logs_shown(browser) diff --git a/functional_tests/support/interface.py b/functional_tests/support/interface.py index a8f78807b..a24064782 100644 --- a/functional_tests/support/interface.py +++ b/functional_tests/support/interface.py @@ -150,3 +150,11 @@ def compare_files(file1, file2): file2_contents = open(file2, 'rb').read() assert file1_contents == file2_contents + + +def go_to_status_logs(browser): + browser.visit(default_url + '/plinth/help/status-log/') + + +def are_status_logs_shown(browser): + return browser.is_text_present('Logs begin')