コード例 #1
0
ファイル: test_deployment.py プロジェクト: flowbrew/website
 def run_test():
     with chrome_io() as chrome:
         disable_google_analytics_io(chrome, URL)
         get_url_with_split_test_io(chrome, URL, entry_point)
         assert '404' not in chrome.title, "Page not found"
         validate_logs_io(chrome)
         return url(chrome)
コード例 #2
0
ファイル: test_deployment.py プロジェクト: flowbrew/website
def test_e2e_404_redirect_io(URL):
    with chrome_io() as chrome:
        disable_google_analytics_io(chrome, URL)

        def assert_is_blog():
            assert only_url(chrome) in [
                url_join(URL, 'blog'),
                url_join(URL, 'blog') + '/',
            ]
            assert 'блог' in chrome.title.lower()

        get_url_io(chrome, URL, '/blog/nonexistent_article')
        assert_is_blog()

        branch = branch_prefix() + random_str()

        get_url_io(chrome, URL, branch, 'blog')
        assert_is_blog()

        get_url_io(chrome, URL, branch, 'blog', 'nonexistent_article')
        assert_is_blog()

        get_url_io(chrome, URL, branch,
                   'debug_split_test/a/test_split_testing')
        assert only_url(chrome) == url_join(
            URL, 'debug_split_test/a/test_split_testing')
        assert 'Test split testing A' in chrome.title
コード例 #3
0
ファイル: test_deployment.py プロジェクト: flowbrew/website
def test_e2e_checkout_io(URL):
    with chrome_io() as chrome:
        disable_google_analytics_io(chrome, base=URL)
        get_url_io(chrome, URL)
        chrome.find_element_by_id('buy-button-1').click()
        assert 'checkout' in url_path(chrome)

        token = random_str()

        WebDriverWait(chrome,
                      10).until(EC.presence_of_element_located(
                          (By.ID, 'name')))

        chrome.find_element_by_id("name").send_keys(token)
        chrome.find_element_by_id("email").send_keys("*****@*****.**")
        chrome.find_element_by_id("phone").send_keys("9999999")
        chrome.find_element_by_xpath(
            "//*[@id='checkout_form']/div[2]/div[3]/div/input").click()
        chrome.find_element_by_id("address").send_keys("Улица 2 д2")
        chrome.find_element_by_id("coupon").send_keys("FLB10")
        chrome.find_element_by_id("comment").send_keys("Ignore, E2E test")
        chrome.find_element_by_id('buy').click()

        @try_n_times_decorator(n=5, timeout=15)
        def __check_email():
            emails = emails_io('imap.yandex.ru', 993,
                               secret_io('YANDEX_BOT_EMAIL'),
                               secret_io('YANDEX_BOT_TOKEN'))
            assert any(token in x['body']
                       for x in emails), 'Order wasnt received via '

        __check_email()

        assert 'спасибо' in url(chrome)
        validate_logs_io(chrome)
コード例 #4
0
ファイル: test_deployment.py プロジェクト: flowbrew/website
    def run_test():
        with chrome_io() as chrome:
            disable_google_analytics_io(chrome, URL)

            get_url_with_split_test_io(chrome, URL, entry_point)
            assert '404' not in chrome.title, "Page not found"
            first_url = url(chrome)

            def sub_test(chrome, first_url):
                get_url_with_split_test_io(chrome, URL, entry_point)
                assert first_url == url(chrome), \
                    "Split test traffic allocation is not consistent"

            [sub_test(chrome, first_url) for _ in range(0, 5)]
            validate_logs_io(chrome)
コード例 #5
0
ファイル: test_deployment.py プロジェクト: flowbrew/website
def test_selenium_io():
    with chrome_io() as chrome:
        chrome.get("http://www.python.org")
        assert 'Python' in chrome.title