diff --git a/functional_tests/features/sharing.feature b/functional_tests/features/sharing.feature index ed9b68e57..22a43b8b6 100644 --- a/functional_tests/features/sharing.feature +++ b/functional_tests/features/sharing.feature @@ -51,6 +51,11 @@ Scenario: Share permissions Then the share tmp should be listed from path /tmp for syncthing And the share tmp should not be accessible +Scenario: Public share + When I edit share tmp to be public + And I log out + Then the share_tmp site should be available + Scenario: Backup and restore sharing Given share tmp is not available When I add a share tmp from path /tmp for admin diff --git a/functional_tests/step_definitions/application.py b/functional_tests/step_definitions/application.py index cd3699268..41c1a81f9 100644 --- a/functional_tests/step_definitions/application.py +++ b/functional_tests/step_definitions/application.py @@ -167,6 +167,11 @@ def remove_share2(browser, name): application.remove_share(browser, name) +@when(parsers.parse('I edit share {name:w} to be public')) +def edit_share_public_access(browser, name): + application.make_share_public(browser, name) + + @then( parsers.parse( 'the share {name:w} should be listed from path {path} for {group:w}')) diff --git a/functional_tests/support/application.py b/functional_tests/support/application.py index f14dc205a..758240fac 100644 --- a/functional_tests/support/application.py +++ b/functional_tests/support/application.py @@ -232,6 +232,15 @@ def access_share(browser, name): assert '/share/{}'.format(name) in browser.title +def make_share_public(browser, name): + """Make share publicly accessible.""" + row = get_share(browser, name) + with wait_for_page_update(browser): + row.find_by_css('.share-edit')[0].click() + browser.find_by_id('id_sharing-is_public').check() + interface.submit(browser) + + def verify_nonexistant_share(browser, name): """Verify that given URL for a given share name is a 404.""" url = '{}/share/{}'.format(default_url, name) diff --git a/functional_tests/support/site.py b/functional_tests/support/site.py index 123866575..82355d077 100644 --- a/functional_tests/support/site.py +++ b/functional_tests/support/site.py @@ -37,6 +37,8 @@ site_url = { def get_site_url(site_name): + if site_name.startswith('share'): + site_name = site_name.replace('_', '/') url = '/' + site_name if site_name in site_url: url = site_url[site_name] @@ -601,8 +603,8 @@ def ttrss_subscribe(browser): _ttrss_load_main_interface(browser) browser.find_by_text('Actions...').click() browser.find_by_text('Subscribe to feed...').click() - browser.find_by_id( - 'feedDlg_feedUrl').fill('https://planet.debian.org/atom.xml') + browser.find_by_id('feedDlg_feedUrl').fill( + 'https://planet.debian.org/atom.xml') browser.find_by_text('Subscribe').click() if browser.is_text_present('You are already subscribed to this feed.'): browser.find_by_text('Cancel').click()