blob: f4ad670a36825d78828b56cbb2e97636833265fc [file] [log] [blame]
Brad Bishop96ff1982019-08-19 13:50:42 -04001#! /usr/bin/env python3
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002#
3# BitBake Toaster Implementation
4#
5# Copyright (C) 2013-2016 Intel Corporation
6#
Brad Bishopc342db32019-05-15 21:57:59 -04007# SPDX-License-Identifier: GPL-2.0-only
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008#
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05009
10"""
11A small example test demonstrating the basics of writing a test with
12Toaster's SeleniumTestCase; this just fetches the Toaster home page
13and checks it has the word "Toaster" in the brand link
14
15New test files should follow this structure, should be named "test_*.py",
16and should be in the same directory as this sample.
17"""
18
19from django.core.urlresolvers import reverse
20from tests.browser.selenium_helpers import SeleniumTestCase
21
22class TestSample(SeleniumTestCase):
23 """ Test landing page shows the Toaster brand """
24
25 def test_landing_page_has_brand(self):
26 url = reverse('landing')
27 self.get(url)
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 brand_link = self.find('.toaster-navbar-brand a.brand')
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029 self.assertEqual(brand_link.text.strip(), 'Toaster')