summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser/test_project_page.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-03-31 19:55:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-01 07:14:58 +0100
commit961cd90375630773f376328f8921804438e0f033 (patch)
treec468c35dac8565bed6a684f3b182ba1c75e5eb8d /bitbake/lib/toaster/tests/browser/test_project_page.py
parentf859a3d40e91e64d4b5292cefd880075a27ddaf9 (diff)
downloadpoky-961cd90375630773f376328f8921804438e0f033.tar.gz
bitbake: toaster: tests Migrate all builds page and project page tests to Selenium
(Bitbake rev: 4fda6be831d10e6d266b11975a0e9a35a7f35a77) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_project_page.py')
-rw-r--r--bitbake/lib/toaster/tests/browser/test_project_page.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_project_page.py b/bitbake/lib/toaster/tests/browser/test_project_page.py
new file mode 100644
index 0000000000..786bef1c6e
--- /dev/null
+++ b/bitbake/lib/toaster/tests/browser/test_project_page.py
@@ -0,0 +1,59 @@
1#! /usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# BitBake Toaster Implementation
6#
7# Copyright (C) 2013-2016 Intel Corporation
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 2 as
11# published by the Free Software Foundation.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22from django.core.urlresolvers import reverse
23from django.utils import timezone
24from tests.browser.selenium_helpers import SeleniumTestCase
25
26from orm.models import Build, Project
27
28class TestProjectPage(SeleniumTestCase):
29 """ Test project data at /project/X/ is displayed correctly """
30
31 CLI_BUILDS_PROJECT_NAME = 'Command line builds'
32
33 def test_cli_builds_in_progress(self):
34 """
35 In progress builds should not cause an error to be thrown
36 when navigating to "command line builds" project page;
37 see https://bugzilla.yoctoproject.org/show_bug.cgi?id=8277
38 """
39
40 # add the "command line builds" default project; this mirrors what
41 # we do with get_or_create_default_project()
42 default_project = Project.objects.create_project(self.CLI_BUILDS_PROJECT_NAME, None)
43 default_project.is_default = True
44 default_project.save()
45
46 # add an "in progress" build for the default project
47 now = timezone.now()
48 Build.objects.create(project=default_project,
49 started_on=now,
50 completed_on=now,
51 outcome=Build.IN_PROGRESS)
52
53 # navigate to the project page for the default project
54 url = reverse("project", args=(default_project.id,))
55 self.get(url)
56
57 # check that we get a project page with the correct heading
58 project_name = self.find('#project-name').text.strip()
59 self.assertEqual(project_name, self.CLI_BUILDS_PROJECT_NAME)