summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py66
-rw-r--r--bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py65
2 files changed, 131 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py
new file mode 100644
index 0000000000..ed18324e57
--- /dev/null
+++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py
@@ -0,0 +1,66 @@
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
25from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
26from orm.models import Target
27
28class TestBuilddashboardPageRecipes(SeleniumTestCase):
29 """ Test build dashboard recipes sub-page """
30
31 def setUp(self):
32 project = Project.objects.get_or_create_default_project()
33
34 now = timezone.now()
35
36 self.build = Build.objects.create(project=project,
37 started_on=now,
38 completed_on=now)
39
40 layer = Layer.objects.create()
41
42 layer_version = Layer_Version.objects.create(layer=layer,
43 build=self.build)
44
45 recipe = Recipe.objects.create(layer_version=layer_version)
46
47 task = Task.objects.create(build=self.build, recipe=recipe, order=1)
48
49 Target.objects.create(build=self.build, task=task, target='do_build')
50
51 def test_build_recipes_columns(self):
52 """
53 Check that non-hideable columns of the table on the recipes sub-page
54 are disabled on the edit columns dropdown.
55 """
56 url = reverse('recipes', args=(self.build.id,))
57 self.get(url)
58
59 self.wait_until_visible('#edit-columns-button')
60
61 # check that options for the non-hideable columns are disabled
62 non_hideable = ['name', 'version']
63
64 for column in non_hideable:
65 selector = 'input#checkbox-%s[disabled="disabled"]' % column
66 self.wait_until_present(selector)
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py
new file mode 100644
index 0000000000..da50f16011
--- /dev/null
+++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py
@@ -0,0 +1,65 @@
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
25from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
26from orm.models import Target
27
28class TestBuilddashboardPageTasks(SeleniumTestCase):
29 """ Test build dashboard tasks sub-page """
30
31 def setUp(self):
32 project = Project.objects.get_or_create_default_project()
33
34 now = timezone.now()
35
36 self.build = Build.objects.create(project=project,
37 started_on=now,
38 completed_on=now)
39
40 layer = Layer.objects.create()
41
42 layer_version = Layer_Version.objects.create(layer=layer)
43
44 recipe = Recipe.objects.create(layer_version=layer_version)
45
46 task = Task.objects.create(build=self.build, recipe=recipe, order=1)
47
48 Target.objects.create(build=self.build, task=task, target='do_build')
49
50 def test_build_tasks_columns(self):
51 """
52 Check that non-hideable columns of the table on the tasks sub-page
53 are disabled on the edit columns dropdown.
54 """
55 url = reverse('tasks', args=(self.build.id,))
56 self.get(url)
57
58 self.wait_until_visible('#edit-columns-button')
59
60 # check that options for the non-hideable columns are disabled
61 non_hideable = ['order', 'task_name', 'recipe__name']
62
63 for column in non_hideable:
64 selector = 'input#checkbox-%s[disabled="disabled"]' % column
65 self.wait_until_present(selector)