summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Mancy <rmancy@redhat.com>2011-03-07 14:09:26 +1000
committerRaymond Mancy <rmancy@redhat.com>2011-03-07 14:21:47 +1000
commitba28e4fcc7ed4ff09dc9fbe6d2cbac3bcb813fab (patch)
tree1f04348e4918831551d0ca121c2d9d0bd1fdb5ab
parentc3085256c117d975f53df0e810ea230d7d97a715 (diff)
fixed width for whiteboard, fix for matrix for column ordering, updated testbeaker-distribution-beaker-dogfood-1_1-10
-rw-r--r--Server/bkr/server/static/css/job_matrix.css4
-rw-r--r--Server/bkr/server/test/selenium/test_job_matrix.py34
-rw-r--r--Server/bkr/server/widgets.py40
3 files changed, 49 insertions, 29 deletions
diff --git a/Server/bkr/server/static/css/job_matrix.css b/Server/bkr/server/static/css/job_matrix.css
index 4d91c09..a737809 100644
--- a/Server/bkr/server/static/css/job_matrix.css
+++ b/Server/bkr/server/static/css/job_matrix.css
@@ -27,6 +27,10 @@ outer-headers {
text-align:left;
}
+.whiteboard {
+ width:600px;
+}
+
.matrix-header {
background-color:#4F4F4F;
color:#FFFFFF;
diff --git a/Server/bkr/server/test/selenium/test_job_matrix.py b/Server/bkr/server/test/selenium/test_job_matrix.py
index 630b510..bdc144b 100644
--- a/Server/bkr/server/test/selenium/test_job_matrix.py
+++ b/Server/bkr/server/test/selenium/test_job_matrix.py
@@ -55,24 +55,35 @@ class TestJobMatrix(SeleniumTestCase):
sel.click('//input[@value="Generate"]')
sel.wait_for_page_to_load('30000')
# why are both .select and .click necessary?? weird
+ # Because there are two fields and we need to know from which we are
+ # generating our result
sel.select('whiteboard', 'label=%s' % self.job_whiteboard)
sel.click('//select[@name="whiteboard"]//option[@value="%s"]'
% self.job_whiteboard)
sel.click('//input[@value="Generate"]')
sel.wait_for_page_to_load('30000')
- self.assertEqual(sel.get_table('my_datagrid.0.0'), 'Task')
- self.assertEqual(sel.get_table('my_datagrid.0.1'), 'ia64')
- self.assertEqual(sel.get_table('my_datagrid.0.2'), 'x86_64')
- self.assertEqual(sel.get_table('my_datagrid.0.3'), 'i386')
- self.assertEqual(sel.get_table('my_datagrid.1.0'), '/distribution/reservesys')
- self.assertEqual(sel.get_table('my_datagrid.1.1'),
- '%s Warn: 1' % self.recipe_whiteboard)
- self.assertEqual(sel.get_table('my_datagrid.1.2'),
- '%s Fail: 1' % self.recipe_whiteboard)
- self.assertEqual(sel.get_table('my_datagrid.1.3'),
- '%s Pass: 1' % self.recipe_whiteboard)
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table[@class=' FixedColumns_Cloned'].0.0"), 'Task')
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.0.1"),
+ 'i386')
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.0.2"),
+ 'ia64')
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.0.3"),
+ 'x86_64')
+ # get_table('matrix_datagrid') doesn't seem to return anything
+ # possibly because of elements inside table
+ body = sel.get_text("//table[@id='matrix_datagrid']/tbody")
+ self.assert_('Pass: 1' in body)
+ self.assert_('Warn: 1' in body)
+ self.assert_('Fail: 1' in body)
+
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.1.1"),
+ '%s' % self.recipe_whiteboard)
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.1.2"),
+ '%s' % self.recipe_whiteboard)
+ self.assertEqual(sel.get_table("//div[@class='dataTables_scrollHeadInner']/table.1.3"),
+ '%s' % self.recipe_whiteboard)
sel.click('link=Pass: 1')
sel.wait_for_page_to_load('3000')
self.assertEqual(sel.get_title(), 'Executed Tasks')
@@ -81,7 +92,6 @@ class TestJobMatrix(SeleniumTestCase):
self.passed_job.recipesets[0].recipes[0].tasks[0].t_id)
sel.go_back()
sel.wait_for_page_to_load('3000')
-
sel.click('link=Warn: 1')
sel.wait_for_page_to_load('3000')
self.assertEqual(sel.get_title(), 'Executed Tasks')
diff --git a/Server/bkr/server/widgets.py b/Server/bkr/server/widgets.py
index 475ae28..71e0959 100644
--- a/Server/bkr/server/widgets.py
+++ b/Server/bkr/server/widgets.py
@@ -263,7 +263,6 @@ class MatrixDataGrid(DataGrid):
params = ['TASK_POS']
class Column(DataGrid.Column):
- orders_used = []
def __init__(self,*args, **kw):
outer_header = None
type = None
@@ -278,14 +277,9 @@ class MatrixDataGrid(DataGrid):
del kw['type']
if 'order' in kw:
order = kw['order']
- try:
-
- self.orders_used.index(order)
- raise BeakerException('Order number %s has already been specified,it cannot be specified twice' % order)
- except ValueError, e:
- self.order = order
- self.orders_used.append(self.order)
- del kw['order']
+ self.order = order
+ del kw['order']
+
DataGrid.Column.__init__(self, *args, **kw) #Old style object
def _header_cmp(self,x,y):
@@ -309,22 +303,34 @@ class MatrixDataGrid(DataGrid):
super(MatrixDataGrid,self).update_params(d)
headers = {}
header_order = {}
+ orders_used = []
cant_use_header = False
must_use_header = False
for col in self.columns:
try:
- header_order[col.outer_header] = getattr(col.outer_header, 'order', None)
+ order = col.order
+ except AttributeError:
+ order = None
+ else:
+ try:
+ orders_used.index(order)
+ raise BeakerException('Order number %s has already been specified,it cannot be specified twice' % order)
+ except ValueError, e:
+ orders_used.append(order)
+ try:
+ header_order[col.outer_header] = order
+ except AttributeError:
+ cant_use_header = True
+ else:
must_use_header = True
if headers.get(col.outer_header):
headers[col.outer_header] += 1
else:
headers[col.outer_header] = 1
- except AttributeError:
- cant_use_header = True
- else:
- if cant_use_header and must_use_header:
- raise ValueError("All Columns must be \
- unified in their use of outer headers")
+ if cant_use_header and must_use_header:
+ raise ValueError("All Columns must be \
+ unified in their use of outer headers")
+
decorated_headers = [(header, occurance, header_order[header]) for header,occurance in headers.items()]
sorted_decorated_headers = sorted(decorated_headers, cmp=self._header_cmp)
d['outer_headers'] = [(header,occurance) for header,occurance,order in sorted_decorated_headers]
@@ -490,7 +496,7 @@ class JobMatrixReport(Form):
self.nack_list = CheckBoxList("Hide naks",validator=self.default_validator)
- self.whiteboard = SingleSelectField('whiteboard',label='Whiteboard',attrs={'size':5}, options=whiteboard_options, validator=self.default_validator)
+ self.whiteboard = SingleSelectField('whiteboard',label='Whiteboard',attrs={'size':5, 'class':'whiteboard'}, options=whiteboard_options, validator=self.default_validator)
self.job_ids = TextArea('job_ids',label='Job ID', rows=7,cols=7, validator=self.default_validator)
self.whiteboard_filter = TextField('whiteboard_filter', label='Filter Whiteboard')