Exemplo n.º 1
0
    def login(self):
        go_to('admin/')
        a.assert_title_contains('Admin')

        fill_user_form(self._data)
        button = a.get_element_by_xpath("//input[@title='Login']")
        a.click_button(button)

        # do away with messages if any
        close = None
        try:
            close = a.get_element_by_xpath(
                "//div[@id='message-popup-window']"
                "//a[@title='close']")
        except AssertionError:
            pass
        if close:
            a.click_link(close)
config.set_base_url_from_env()
client = apihelpers.get_api_client()
password = '******'

# Create an account
email_address = helpers.register_account(password=password)

# Login with the api to get a token
response = client.login(email=email_address, password=password,
                        token_name='test')
assert_equal(response.status_code, 201)
login_token = response.json()

# Add a new email
go_to(urls.EMAILS)
assert_title_contains("email addresses")
new_email = mail.make_unique_test_email_address()
write_textfield('id_newemail', new_email)
click_button(get_element(name='continue'))

# Find the invalidation link
link = sso_mail.get_invalidation_link_for_address(new_email)
assert link is not None, 'Invalidation link should not be None.'

# Invalidate the new email address
go_to(link)
assert_title_contains('Email invalidation')

click_button(get_element(name='invalidate'))
assert_title_contains('Email invalidated')
Exemplo n.º 3
0
from u1testutils.sst import config

from acceptance import helpers, urls


config.set_base_url_from_env()

go_to(urls.NEW_ACCOUNT)
assert_title('Create account')

email_address = mail.make_unique_test_email_address()
helpers.fill_registration_form(email_address)

click_button(get_element(name='continue'))

if 'allow_unverified' not in sst_config.flags:
    assert_title_contains('Account creation mail sent')
    assert_text_contains(
        get_element(id='content'),
        r'just emailed .* \(from .*\) to confirm your address\.',
        regex=True)

    vcode = sso_mail.get_verification_code_for_address(email_address)

    write_textfield(get_element(name='confirmation_code'), vcode)
    click_button(get_element(css_class='btn'))

# We know that the confirmation code worked if we are now looking at the
# logged-in details page for the user.
wait_for(assert_element, **{'data-qa-id': 'edit_account'})
Exemplo n.º 4
0
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4

from sst import actions as a

import common
import data

common.go_to()
a.assert_title_contains('Home page')

user = common.User(data.user)

user.login()

# search for tv
a.write_textfield('search', 'tv')
common.click_button_by_title('Search')

# click it
common.click_button_by_title('Add to Cart', multiple=True)

common.click_button_by_title('Proceed to Checkout', multiple=True)

a.wait_for(a.assert_displayed, 'checkout-step-billing')

a.click_button(a.get_element_by_xpath(
    "//div[@id='checkout-step-billing']"
    "//button[@title='Continue']"))

# in 1.4 it doesn't automatically proceed to shipping method