mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
test: sharing: Fix tests that check text in English
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
2ac2726752
commit
a152811d70
@ -26,27 +26,27 @@ Scenario: Add new share
|
|||||||
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
|
||||||
Then the share tmp should be listed from path /tmp for admin
|
Then the share tmp should be listed from path /tmp for admin
|
||||||
Then the share tmp should be accessible
|
And the share tmp should be accessible
|
||||||
|
|
||||||
Scenario: Edit a share
|
Scenario: Edit a share
|
||||||
Given share tmp is not available
|
Given share tmp is not available
|
||||||
When I remove share boot
|
When I remove share boot
|
||||||
When I add a share tmp from path /tmp for admin
|
And I add a share tmp from path /tmp for admin
|
||||||
When I edit share tmp to boot from path /boot for admin
|
And I edit share tmp to boot from path /boot for admin
|
||||||
Then the share tmp should not be listed
|
Then the share tmp should not be listed
|
||||||
Then the share tmp should not exist
|
And the share tmp should not exist
|
||||||
Then the share boot should be listed from path /boot for admin
|
And the share boot should be listed from path /boot for admin
|
||||||
Then the share boot should be accessible
|
And the share boot should be accessible
|
||||||
|
|
||||||
Scenario: Remove a share
|
Scenario: Remove a share
|
||||||
When I remove share tmp
|
When I remove share tmp
|
||||||
When I add a share tmp from path /tmp for admin
|
And I add a share tmp from path /tmp for admin
|
||||||
When I remove share tmp
|
And I remove share tmp
|
||||||
Then the share tmp should not be listed
|
Then the share tmp should not be listed
|
||||||
Then the share tmp should not exist
|
And the share tmp should not exist
|
||||||
|
|
||||||
Scenario: Share permissions
|
Scenario: Share permissions
|
||||||
When I remove share tmp
|
When I remove share tmp
|
||||||
When I add a share tmp from path /tmp for syncthing
|
And I add a share tmp from path /tmp for syncthing
|
||||||
Then the share tmp should be listed from path /tmp for syncthing
|
Then the share tmp should be listed from path /tmp for syncthing
|
||||||
Then the share tmp should not be accessible
|
And the share tmp should not be accessible
|
||||||
|
|||||||
@ -20,7 +20,8 @@ from time import sleep
|
|||||||
import splinter
|
import splinter
|
||||||
|
|
||||||
from support import config, interface
|
from support import config, interface
|
||||||
from support.service import eventually
|
from support.interface import submit
|
||||||
|
from support.service import eventually, wait_for_page_update
|
||||||
|
|
||||||
# unlisted apps just use the app_name as module name
|
# unlisted apps just use the app_name as module name
|
||||||
app_module = {
|
app_module = {
|
||||||
@ -131,6 +132,9 @@ def modify_upload_password(browser, password):
|
|||||||
interface.submit(browser, 'form-configuration')
|
interface.submit(browser, 'form-configuration')
|
||||||
|
|
||||||
|
|
||||||
|
# Sharing app helper functions
|
||||||
|
|
||||||
|
|
||||||
def remove_share(browser, name):
|
def remove_share(browser, name):
|
||||||
"""Remove a share in sharing app."""
|
"""Remove a share in sharing app."""
|
||||||
try:
|
try:
|
||||||
@ -148,22 +152,20 @@ def add_share(browser, name, path, group):
|
|||||||
browser.fill('sharing-path', path)
|
browser.fill('sharing-path', path)
|
||||||
browser.find_by_css(
|
browser.find_by_css(
|
||||||
'#id_sharing-groups input[value="{}"]'.format(group)).check()
|
'#id_sharing-groups input[value="{}"]'.format(group)).check()
|
||||||
browser.find_by_css('input[type="submit"]').click()
|
submit(browser)
|
||||||
eventually(browser.is_text_present, args=['Share added.'])
|
|
||||||
|
|
||||||
|
|
||||||
def edit_share(browser, old_name, new_name, path, group):
|
def edit_share(browser, old_name, new_name, path, group):
|
||||||
"""Edit a share in sharing app."""
|
"""Edit a share in sharing app."""
|
||||||
row = get_share(browser, old_name)
|
row = get_share(browser, old_name)
|
||||||
row.find_by_css('.share-edit')[0].click()
|
with wait_for_page_update(browser):
|
||||||
eventually(browser.is_text_present, args=['Edit Share'])
|
row.find_by_css('.share-edit')[0].click()
|
||||||
browser.fill('sharing-name', new_name)
|
browser.fill('sharing-name', new_name)
|
||||||
browser.fill('sharing-path', path)
|
browser.fill('sharing-path', path)
|
||||||
browser.find_by_css('#id_sharing-groups input').uncheck()
|
browser.find_by_css('#id_sharing-groups input').uncheck()
|
||||||
browser.find_by_css(
|
browser.find_by_css(
|
||||||
'#id_sharing-groups input[value="{}"]'.format(group)).check()
|
'#id_sharing-groups input[value="{}"]'.format(group)).check()
|
||||||
browser.find_by_css('input[type="submit"]').click()
|
submit(browser)
|
||||||
eventually(browser.is_text_present, args=['Share edited.'])
|
|
||||||
|
|
||||||
|
|
||||||
def get_share(browser, name):
|
def get_share(browser, name):
|
||||||
@ -189,14 +191,14 @@ def access_share(browser, name):
|
|||||||
row = get_share(browser, name)
|
row = get_share(browser, name)
|
||||||
url = row.find_by_css('.share-url a')[0]['href']
|
url = row.find_by_css('.share-url a')[0]['href']
|
||||||
browser.visit(url)
|
browser.visit(url)
|
||||||
browser.is_text_present('Index of /share/{}'.format(name))
|
assert '/share/{}'.format(name) in browser.title
|
||||||
|
|
||||||
|
|
||||||
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)
|
||||||
browser.visit(url)
|
browser.visit(url)
|
||||||
browser.is_text_present('Not Found')
|
assert '404' in browser.title
|
||||||
|
|
||||||
|
|
||||||
def verify_inaccessible_share(browser, name):
|
def verify_inaccessible_share(browser, name):
|
||||||
|
|||||||
@ -38,12 +38,12 @@ def get_service_module(service_name):
|
|||||||
|
|
||||||
def is_running(browser, service_name):
|
def is_running(browser, service_name):
|
||||||
interface.nav_to_module(browser, get_service_module(service_name))
|
interface.nav_to_module(browser, get_service_module(service_name))
|
||||||
return browser.is_text_present('is running')
|
return len(browser.find_by_css('.running-status.active')) != 0
|
||||||
|
|
||||||
|
|
||||||
def is_not_running(browser, service_name):
|
def is_not_running(browser, service_name):
|
||||||
interface.nav_to_module(browser, get_service_module(service_name))
|
interface.nav_to_module(browser, get_service_module(service_name))
|
||||||
return browser.is_text_present('is not running')
|
return len(browser.find_by_css('.running-status.inactive')) != 0
|
||||||
|
|
||||||
|
|
||||||
def eventually(function, args=[], timeout=30):
|
def eventually(function, args=[], timeout=30):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user