mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
sharing: Add functional test for public shares
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
1eec1cf9ce
commit
6e0671e142
@ -51,6 +51,11 @@ Scenario: Share permissions
|
|||||||
Then the share tmp should be listed from path /tmp for syncthing
|
Then the share tmp should be listed from path /tmp for syncthing
|
||||||
And the share tmp should not be accessible
|
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
|
Scenario: Backup and restore sharing
|
||||||
Given share tmp is not available
|
Given share tmp is not available
|
||||||
When I add a share tmp from path /tmp for admin
|
When I add a share tmp from path /tmp for admin
|
||||||
|
|||||||
@ -167,6 +167,11 @@ def remove_share2(browser, name):
|
|||||||
application.remove_share(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(
|
@then(
|
||||||
parsers.parse(
|
parsers.parse(
|
||||||
'the share {name:w} should be listed from path {path} for {group:w}'))
|
'the share {name:w} should be listed from path {path} for {group:w}'))
|
||||||
|
|||||||
@ -232,6 +232,15 @@ def access_share(browser, name):
|
|||||||
assert '/share/{}'.format(name) in browser.title
|
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):
|
def verify_nonexistant_share(browser, name):
|
||||||
"""Verify that given URL for a given share name is a 404."""
|
"""Verify that given URL for a given share name is a 404."""
|
||||||
url = '{}/share/{}'.format(default_url, name)
|
url = '{}/share/{}'.format(default_url, name)
|
||||||
|
|||||||
@ -37,6 +37,8 @@ site_url = {
|
|||||||
|
|
||||||
|
|
||||||
def get_site_url(site_name):
|
def get_site_url(site_name):
|
||||||
|
if site_name.startswith('share'):
|
||||||
|
site_name = site_name.replace('_', '/')
|
||||||
url = '/' + site_name
|
url = '/' + site_name
|
||||||
if site_name in site_url:
|
if site_name in site_url:
|
||||||
url = site_url[site_name]
|
url = site_url[site_name]
|
||||||
@ -601,8 +603,8 @@ def ttrss_subscribe(browser):
|
|||||||
_ttrss_load_main_interface(browser)
|
_ttrss_load_main_interface(browser)
|
||||||
browser.find_by_text('Actions...').click()
|
browser.find_by_text('Actions...').click()
|
||||||
browser.find_by_text('Subscribe to feed...').click()
|
browser.find_by_text('Subscribe to feed...').click()
|
||||||
browser.find_by_id(
|
browser.find_by_id('feedDlg_feedUrl').fill(
|
||||||
'feedDlg_feedUrl').fill('https://planet.debian.org/atom.xml')
|
'https://planet.debian.org/atom.xml')
|
||||||
browser.find_by_text('Subscribe').click()
|
browser.find_by_text('Subscribe').click()
|
||||||
if browser.is_text_present('You are already subscribed to this feed.'):
|
if browser.is_text_present('You are already subscribed to this feed.'):
|
||||||
browser.find_by_text('Cancel').click()
|
browser.find_by_text('Cancel').click()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user