aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/tests/browser/test_sample.py
blob: f4ad670a36825d78828b56cbb2e97636833265fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /usr/bin/env python3
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#

"""
A small example test demonstrating the basics of writing a test with
Toaster's SeleniumTestCase; this just fetches the Toaster home page
and checks it has the word "Toaster" in the brand link

New test files should follow this structure, should be named "test_*.py",
and should be in the same directory as this sample.
"""

from django.core.urlresolvers import reverse
from tests.browser.selenium_helpers import SeleniumTestCase

class TestSample(SeleniumTestCase):
    """ Test landing page shows the Toaster brand """

    def test_landing_page_has_brand(self):
        url = reverse('landing')
        self.get(url)
        brand_link = self.find('.toaster-navbar-brand a.brand')
        self.assertEqual(brand_link.text.strip(), 'Toaster')