~elopio/ubuntuone-testing/newaccount

« back to all changes in this revision

Viewing changes to ubuntuone/web/tests/sst/shared/actions/files.py

  • Committer: Tarmac
  • Author(s): Leo Arias
  • Date: 2011-11-21 15:40:58 UTC
  • mfrom: (56.1.1 fix-public-url)
  • Revision ID: tarmac-20111121154058-a6adh30f3aa0wx7f
Fixes the public url bug in u1webf003, and a little refactoring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from sst.actions import _get_elem
24
24
from config import DEFAULT_TIMEOUT
25
25
from loading import *
 
26
import urlparse
26
27
 
27
28
def open():
28
29
    """Open the files page and assert it's title."""
248
249
    input_public_url = get_element_by_xpath('id("%s-details")//'
249
250
                                           'input[@class="public_url"]'
250
251
                                           % _get_file_identifier(name))
251
 
    return input_public_url.get_attribute('value')
 
252
    public_url = input_public_url.get_attribute('value')
 
253
    parsed_url = urlparse.urlparse(public_url)
 
254
    base_url = public_url[:-len(parsed_url.path)]
 
255
    path = parsed_url.path
 
256
    return base_url, path
 
257
 
 
258
def go_to_public_url(name):
 
259
    base_url, path = get_public_url(name)
 
260
    set_base_url(base_url)
 
261
    goto(path)
252
262
 
253
263
def stop_publishing_file(name):
254
264
    """Stop publishing a file.