Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame^] | 1 | #! /usr/bin/env python3 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | # |
| 3 | # BitBake Toaster Implementation |
| 4 | # |
| 5 | # Copyright (C) 2013-2016 Intel Corporation |
| 6 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 7 | # SPDX-License-Identifier: GPL-2.0-only |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 8 | # |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 9 | |
| 10 | from django.core.urlresolvers import reverse |
| 11 | from django.utils import timezone |
| 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
| 13 | from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version |
| 14 | from orm.models import Target |
| 15 | |
| 16 | class TestBuilddashboardPageTasks(SeleniumTestCase): |
| 17 | """ Test build dashboard tasks sub-page """ |
| 18 | |
| 19 | def setUp(self): |
| 20 | project = Project.objects.get_or_create_default_project() |
| 21 | |
| 22 | now = timezone.now() |
| 23 | |
| 24 | self.build = Build.objects.create(project=project, |
| 25 | started_on=now, |
| 26 | completed_on=now) |
| 27 | |
| 28 | layer = Layer.objects.create() |
| 29 | |
| 30 | layer_version = Layer_Version.objects.create(layer=layer) |
| 31 | |
| 32 | recipe = Recipe.objects.create(layer_version=layer_version) |
| 33 | |
| 34 | task = Task.objects.create(build=self.build, recipe=recipe, order=1) |
| 35 | |
| 36 | Target.objects.create(build=self.build, task=task, target='do_build') |
| 37 | |
| 38 | def test_build_tasks_columns(self): |
| 39 | """ |
| 40 | Check that non-hideable columns of the table on the tasks sub-page |
| 41 | are disabled on the edit columns dropdown. |
| 42 | """ |
| 43 | url = reverse('tasks', args=(self.build.id,)) |
| 44 | self.get(url) |
| 45 | |
| 46 | self.wait_until_visible('#edit-columns-button') |
| 47 | |
| 48 | # check that options for the non-hideable columns are disabled |
| 49 | non_hideable = ['order', 'task_name', 'recipe__name'] |
| 50 | |
| 51 | for column in non_hideable: |
| 52 | selector = 'input#checkbox-%s[disabled="disabled"]' % column |
| 53 | self.wait_until_present(selector) |