1#! /usr/bin/env python3
2#
3# BitBake Toaster Implementation
4#
5# Copyright (C) 2013-2016 Intel Corporation
6#
7# SPDX-License-Identifier: GPL-2.0-only
8#
9
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.urls 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)
28        brand_link = self.find('.toaster-navbar-brand a.brand')
29        self.assertEqual(brand_link.text.strip(), 'Toaster')
30