diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_sample.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_sample.py | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_sample.py b/bitbake/lib/toaster/tests/browser/test_sample.py index 20ec53c28a..f04f1d9a16 100644 --- a/bitbake/lib/toaster/tests/browser/test_sample.py +++ b/bitbake/lib/toaster/tests/browser/test_sample.py @@ -1,23 +1,11 @@ -#! /usr/bin/env python -# ex:ts=4:sw=4:sts=4:et -# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +#! /usr/bin/env python3 # # BitBake Toaster Implementation # # Copyright (C) 2013-2016 Intel Corporation # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """ A small example test demonstrating the basics of writing a test with @@ -28,7 +16,7 @@ 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 django.urls import reverse from tests.browser.selenium_helpers import SeleniumTestCase class TestSample(SeleniumTestCase): @@ -39,3 +27,13 @@ class TestSample(SeleniumTestCase): self.get(url) brand_link = self.find('.toaster-navbar-brand a.brand') self.assertEqual(brand_link.text.strip(), 'Toaster') + + def test_no_builds_message(self): + """ Test that a message is shown when there are no builds """ + url = reverse('all-builds') + self.get(url) + self.wait_until_visible('#empty-state-allbuildstable') # wait for the empty state div to appear + div_msg = self.find('#empty-state-allbuildstable .alert-info') + + msg = 'Sorry - no data found' + self.assertEqual(div_msg.text, msg) |