mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
Functional tests: check that browser waits for redirects to finish
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
56ee33793e
commit
33dde221d1
32
functional_tests/features/backups.feature
Normal file
32
functional_tests/features/backups.feature
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
@backups @bind
|
||||||
|
Feature: Backups module
|
||||||
|
Create and restore backups.
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given I'm a logged in user
|
||||||
|
Given the bind application is installed
|
||||||
|
|
||||||
|
Scenario: Browser waits for redirect after restoring a backup
|
||||||
|
Given the bind application is enabled
|
||||||
|
When I create a backup of the bind app data
|
||||||
|
And I restore the bind app data backup
|
||||||
|
And I open the main page
|
||||||
|
And I wait for 5 seconds
|
||||||
|
Then the main page should be shown
|
||||||
@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
from pytest import fixture
|
from pytest import fixture
|
||||||
from pytest_bdd import given, parsers, then, when
|
from pytest_bdd import given, parsers, then, when
|
||||||
@ -345,3 +346,19 @@ def monkeysphere_assert_imported_key(browser, key_type, domain):
|
|||||||
'{domain:S} in monkeysphere'))
|
'{domain:S} in monkeysphere'))
|
||||||
def monkeysphere_publish_key(browser, key_type, domain):
|
def monkeysphere_publish_key(browser, key_type, domain):
|
||||||
system.monkeysphere_publish_key(browser, key_type.lower(), domain)
|
system.monkeysphere_publish_key(browser, key_type.lower(), domain)
|
||||||
|
|
||||||
|
|
||||||
|
@when(parsers.parse('I wait for {seconds} seconds'))
|
||||||
|
def sleep_for(seconds):
|
||||||
|
seconds = int(seconds)
|
||||||
|
time.sleep(seconds)
|
||||||
|
|
||||||
|
|
||||||
|
@when(parsers.parse('I open the main page'))
|
||||||
|
def open_main_page(browser):
|
||||||
|
system.open_main_page(browser)
|
||||||
|
|
||||||
|
|
||||||
|
@then(parsers.parse('the main page should be shown'))
|
||||||
|
def main_page_is_shown(browser):
|
||||||
|
assert(browser.url.endswith('/plinth/'))
|
||||||
|
|||||||
@ -394,3 +394,8 @@ def monkeysphere_publish_key(browser, key_type, domain):
|
|||||||
key.find_by_css('.button-publish').click()
|
key.find_by_css('.button-publish').click()
|
||||||
|
|
||||||
application.wait_for_config_update(browser, 'monkeysphere')
|
application.wait_for_config_update(browser, 'monkeysphere')
|
||||||
|
|
||||||
|
|
||||||
|
def open_main_page(browser):
|
||||||
|
with wait_for_page_update(browser):
|
||||||
|
browser.find_link_by_href('/plinth/').first.click()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user