Bug 82807 - Optionally hide HTML editor in Testopia
git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1353 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
a1511c5ad0
commit
c4f3cdfa1f
|
@ -1498,6 +1498,212 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var processText;
|
||||||
|
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||||
|
{
|
||||||
|
params = params || {};
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Set Up / Break Down',
|
||||||
|
items: [{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Setup',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_setup_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('setup', params)
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Breakdown',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_breakdown_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: [{
|
||||||
|
text: 'Save',
|
||||||
|
handler: processText
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseTextEditor = function(id, data)
|
||||||
|
{
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
xtype: 'htmleditor',
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
else
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
html: data[id]||'',
|
||||||
|
height: 'auto'
|
||||||
|
},{
|
||||||
|
id: id+'_textarea',
|
||||||
|
xtype: 'textarea',
|
||||||
|
style: 'font-family: monospace',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
hidden: true,
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseShowHTMLEditor = function()
|
||||||
|
{
|
||||||
|
var s, h;
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
var b = Ext.getCmp('edit_html_button');
|
||||||
|
var b1 = Ext.getCmp('save_html_button');
|
||||||
|
if (Ext.getCmp('action_editor').hidden)
|
||||||
|
{
|
||||||
|
b.setText('Edit HTML source');
|
||||||
|
b1.hide();
|
||||||
|
s = 'hide', h = 'show';
|
||||||
|
for (var i in editorids)
|
||||||
|
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b1.show();
|
||||||
|
b.setText('Close editor');
|
||||||
|
s = 'show', h = 'hide';
|
||||||
|
}
|
||||||
|
for (var i in editorids)
|
||||||
|
{
|
||||||
|
Ext.getCmp(i+'_editor')[h]();
|
||||||
|
Ext.getCmp(i+'_textarea')[s]();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseUpdateTextForId = function(id)
|
||||||
|
{
|
||||||
|
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||||
|
var params = {};
|
||||||
|
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
for (var i in editorids)
|
||||||
|
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||||
|
params.case_id = id;
|
||||||
|
params.action = 'update_doc';
|
||||||
|
testopia_form.submit({
|
||||||
|
url: 'tr_process_case.cgi',
|
||||||
|
params: params,
|
||||||
|
success: function(){
|
||||||
|
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||||
|
},
|
||||||
|
failure: Testopia.Util.error
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseShowEffectEditor = function()
|
||||||
|
{
|
||||||
|
var d = Ext.getCmp('effect_editor_col');
|
||||||
|
if (!d.hidden)
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||||
|
d.hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||||
|
d.show();
|
||||||
|
}
|
||||||
|
Ext.getCmp('action_panel').doLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseActionPanel = function(data)
|
||||||
|
{
|
||||||
|
data = data || {};
|
||||||
|
var actionResultsButtons = [{
|
||||||
|
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||||
|
id: 'showhide_results_btn',
|
||||||
|
handler: Testopia.TestCaseShowEffectEditor
|
||||||
|
}];
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Update Action/Results',
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Save',
|
||||||
|
id: 'save_html_button',
|
||||||
|
hidden: true,
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
}, {
|
||||||
|
text: 'Edit HTML source',
|
||||||
|
id: 'edit_html_button',
|
||||||
|
handler: Testopia.TestCaseShowHTMLEditor
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||||
|
if (!h || h != h)
|
||||||
|
h = 500;
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Description',
|
||||||
|
id: 'action_panel',
|
||||||
|
items: [{
|
||||||
|
columnWidth: data.effect ? 0.5 : 1.0,
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'action_editor_col',
|
||||||
|
items:[{
|
||||||
|
title: 'Action',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_action_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('action', data)
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
columnWidth: 0.5,
|
||||||
|
id: 'effect_editor_col',
|
||||||
|
layout: 'fit',
|
||||||
|
forceLayout: true,
|
||||||
|
hidden: !data.effect,
|
||||||
|
items: {
|
||||||
|
title: 'Expected Results',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_results_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('effect', data)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: actionResultsButtons
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
Testopia.TestCaseRun.Info = function(){
|
Testopia.TestCaseRun.Info = function(){
|
||||||
this.caserun_id;
|
this.caserun_id;
|
||||||
this.store = new Ext.data.Store({
|
this.store = new Ext.data.Store({
|
||||||
|
@ -1532,16 +1738,34 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
}])
|
}])
|
||||||
});
|
});
|
||||||
var store = this.store;
|
var store = this.store;
|
||||||
store.on('load', function(s, r){
|
store.on('load', function(s, r)
|
||||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
{
|
||||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||||
|
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
{
|
||||||
|
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||||
|
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||||
|
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||||
|
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
{
|
||||||
|
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||||
|
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||||
|
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||||
Ext.getCmp('showhide_results_btn').handler();
|
Ext.getCmp('showhide_results_btn').handler();
|
||||||
if (Param_Show_Setup_Breakdown)
|
|
||||||
{
|
|
||||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
|
||||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
|
||||||
}
|
|
||||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1561,27 +1785,6 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
failure: Testopia.Util.error
|
failure: Testopia.Util.error
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
processText = function(){
|
|
||||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
|
||||||
var params = {};
|
|
||||||
if (Param_Show_Setup_Breakdown)
|
|
||||||
{
|
|
||||||
params.tcsetup = Ext.getCmp('setup_editor').getValue();
|
|
||||||
params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue();
|
|
||||||
}
|
|
||||||
params.tcaction = Ext.getCmp('action_editor').getValue();
|
|
||||||
params.tceffect = Ext.getCmp('effect_editor').getValue();
|
|
||||||
params.case_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id');
|
|
||||||
params.action = 'update_doc';
|
|
||||||
testopia_form.submit({
|
|
||||||
url: 'tr_process_case.cgi',
|
|
||||||
params: params,
|
|
||||||
success: function(){
|
|
||||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
|
||||||
},
|
|
||||||
failure: Testopia.Util.error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var summary_tb = new Ext.Toolbar({
|
var summary_tb = new Ext.Toolbar({
|
||||||
id: 'summary_tb',
|
id: 'summary_tb',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
@ -1689,6 +1892,9 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
}
|
}
|
||||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||||
});
|
});
|
||||||
|
Testopia.TestCaseUpdateText = function() {
|
||||||
|
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||||
|
};
|
||||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||||
id: 'case_details_panel',
|
id: 'case_details_panel',
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
@ -1706,73 +1912,9 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
id: 'caserun_center_region',
|
id: 'caserun_center_region',
|
||||||
title: 'Details',
|
title: 'Details',
|
||||||
tbar: summary_tb,
|
tbar: summary_tb,
|
||||||
items: [{
|
items: [
|
||||||
layout: 'column',
|
Testopia.TestCaseActionPanel(),
|
||||||
title: 'Description',
|
{
|
||||||
id: 'action_panel',
|
|
||||||
items: [{
|
|
||||||
columnWidth:1.0,
|
|
||||||
layout:'fit',
|
|
||||||
id:'action_editor_col',
|
|
||||||
items:[{
|
|
||||||
title: 'Action',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_action_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
autoScroll: true,
|
|
||||||
items: [{
|
|
||||||
id: 'action_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
id:'effect_editor_col',
|
|
||||||
layout:'fit',
|
|
||||||
style:{
|
|
||||||
display: 'none',
|
|
||||||
},
|
|
||||||
items:{
|
|
||||||
title: 'Expected Results',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_results_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
autoScroll: true,
|
|
||||||
layout: 'fit',
|
|
||||||
items: [{
|
|
||||||
id: 'effect_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Action/Results',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
},{
|
|
||||||
text: 'Show Results Edit',
|
|
||||||
id: 'showhide_results_btn',
|
|
||||||
handler: function(){
|
|
||||||
d = document.getElementById('effect_editor_col');
|
|
||||||
if (d.style.display != 'none')
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
|
||||||
d.style.display = 'none';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
|
||||||
d.style.display = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: 'Notes',
|
title: 'Notes',
|
||||||
id: 'caserun_notes_panel',
|
id: 'caserun_notes_panel',
|
||||||
border: false,
|
border: false,
|
||||||
|
@ -1799,55 +1941,17 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
text: 'Append Note',
|
text: 'Append Note',
|
||||||
handler: appendNote.createDelegate(this)
|
handler: appendNote.createDelegate(this)
|
||||||
}]
|
}]
|
||||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
},
|
||||||
id: 0,
|
new Testopia.TestCaseRun.History(),
|
||||||
type: 'caserun'
|
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
new Testopia.TestCase.Bugs.Grid(),
|
||||||
}]
|
new Testopia.TestCase.Components(),
|
||||||
|
new Testopia.Tags.ObjectTags('case', 0)
|
||||||
|
]}]
|
||||||
});
|
});
|
||||||
if (Param_Show_Setup_Breakdown)
|
if (Param_Show_Setup_Breakdown)
|
||||||
{
|
{
|
||||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||||
layout: 'column',
|
|
||||||
title: 'Set Up / Break Down',
|
|
||||||
items: [{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Setup',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_setup_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'setup_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Breakdown',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_breakdown_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'breakdown_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Setup/Breakdown',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
}]
|
|
||||||
}));
|
|
||||||
Ext.getCmp('caserun_center_region').doLayout();
|
Ext.getCmp('caserun_center_region').doLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -117,7 +117,7 @@ sub get_param_list {
|
||||||
{
|
{
|
||||||
name => 'test_case_wiki_action_iframe',
|
name => 'test_case_wiki_action_iframe',
|
||||||
type => 't',
|
type => 't',
|
||||||
default => '<iframe src="$URL?useskin=chick" width="100%" height="100%"></iframe>',
|
default => '<iframe src="$URL?useskin=ichick" width="100%" height="100%"></iframe>',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -126,6 +126,12 @@ sub get_param_list {
|
||||||
default => 0,
|
default => 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name => 'testopia-hide-htmleditor',
|
||||||
|
type => 'b',
|
||||||
|
default => 0,
|
||||||
|
},
|
||||||
|
|
||||||
# {
|
# {
|
||||||
# name => 'new-testrun-email-notif',
|
# name => 'new-testrun-email-notif',
|
||||||
# type => 'l',
|
# type => 'l',
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#%]
|
#%]
|
||||||
|
|
||||||
[% PROCESS global/header.html.tmpl
|
[% PROCESS global/header.html.tmpl
|
||||||
|
|
||||||
title = "Search by Test Case Number"
|
title = "Search by Test Case Number"
|
||||||
%]
|
%]
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,6 @@
|
||||||
# Greg Hendricks <ghendricks@novell.com>
|
# Greg Hendricks <ghendricks@novell.com>
|
||||||
#%]
|
#%]
|
||||||
|
|
||||||
[%# INTERFACE:
|
|
||||||
# ...
|
|
||||||
#%]
|
|
||||||
|
|
||||||
|
|
||||||
[% PROCESS testopia/style.none.tmpl %]
|
[% PROCESS testopia/style.none.tmpl %]
|
||||||
[% PROCESS testopia/blocks.html.tmpl %]
|
[% PROCESS testopia/blocks.html.tmpl %]
|
||||||
|
|
||||||
|
@ -32,6 +27,7 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
||||||
|
var Param_Use_HTMLEditor = [% Param('testopia-hide-htmleditor') ? 0 : 1 %];
|
||||||
var tcase = [% case.TO_JSON FILTER html_light %];
|
var tcase = [% case.TO_JSON FILTER html_light %];
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
|
@ -107,24 +103,7 @@ Ext.onReady(function(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function processText(){
|
Testopia.TestCaseUpdateText = function(){ Testopia.TestCaseUpdateTextForId(tcase.case_id); };
|
||||||
var params = {};
|
|
||||||
params.tcsetup = Ext.getCmp('setup_editor').getValue();
|
|
||||||
params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue();
|
|
||||||
params.tcaction = Ext.getCmp('action_editor').getValue();
|
|
||||||
params.tceffect = Ext.getCmp('effect_editor').getValue();
|
|
||||||
params.case_id = tcase.case_id;
|
|
||||||
params.action = 'update_doc';
|
|
||||||
testopia_form.submit({
|
|
||||||
url: 'tr_process_case.cgi',
|
|
||||||
method: 'POST',
|
|
||||||
params: params,
|
|
||||||
success: function(){
|
|
||||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
|
||||||
},
|
|
||||||
failure: Testopia.Util.error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileMenu = new Ext.menu.Menu({
|
var fileMenu = new Ext.menu.Menu({
|
||||||
id: 'file-menu',
|
id: 'file-menu',
|
||||||
|
@ -163,11 +142,15 @@ Ext.onReady(function(){
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
var caseControls = new Ext.Toolbar();
|
var casetext = {
|
||||||
|
action: '[% case.text.action|js %]',
|
||||||
|
effect: '[% case.text.effect|js %]',
|
||||||
|
setup: '[% case.text.setup|js %]',
|
||||||
|
breakdown: '[% case.text.breakdown|js %]'
|
||||||
|
};
|
||||||
|
var actionpanel = Testopia.TestCaseActionPanel(casetext);
|
||||||
|
actionpanel.tbar = new DocCompareToolbar('case', tcase.case_id);
|
||||||
|
|
||||||
var cases = new Ext.grid.GridPanel({
|
|
||||||
|
|
||||||
});
|
|
||||||
var casepanel = new Ext.Panel({
|
var casepanel = new Ext.Panel({
|
||||||
layout: 'border',
|
layout: 'border',
|
||||||
monitorResize: true,
|
monitorResize: true,
|
||||||
|
@ -176,29 +159,29 @@ Ext.onReady(function(){
|
||||||
footer: true,
|
footer: true,
|
||||||
title: '[% title FILTER js %]',
|
title: '[% title FILTER js %]',
|
||||||
tbar: [{
|
tbar: [{
|
||||||
text: 'File',
|
text: 'File',
|
||||||
menu: fileMenu
|
menu: fileMenu
|
||||||
},
|
},
|
||||||
new Ext.Toolbar.Fill(),
|
new Ext.Toolbar.Fill(),
|
||||||
{
|
{
|
||||||
xtype: 'button',
|
xtype: 'button',
|
||||||
id: 'plan-copy-button',
|
id: 'plan-copy-button',
|
||||||
icon: 'extensions/testopia/img/copy.png',
|
icon: 'extensions/testopia/img/copy.png',
|
||||||
iconCls: 'img_button_16x',
|
iconCls: 'img_button_16x',
|
||||||
tooltip: 'Clone this Test Case',
|
tooltip: 'Clone this Test Case',
|
||||||
handler: function(){
|
handler: function(){
|
||||||
Testopia.TestCase.clonePopup(tcase.product_id, tcase.case_id);
|
Testopia.TestCase.clonePopup(tcase.product_id, tcase.case_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
[% IF case.candelete %]
|
[% IF case.candelete %]
|
||||||
,{
|
,{
|
||||||
xtype: 'button',
|
xtype: 'button',
|
||||||
id: 'plan-delete-btn',
|
id: 'plan-delete-btn',
|
||||||
icon: 'extensions/testopia/img/delete.png',
|
icon: 'extensions/testopia/img/delete.png',
|
||||||
iconCls: 'img_button_16x',
|
iconCls: 'img_button_16x',
|
||||||
tooltip: 'Delete this Test Case',
|
tooltip: 'Delete this Test Case',
|
||||||
handler: confirmDelete
|
handler: confirmDelete
|
||||||
}
|
}
|
||||||
[% END %]
|
[% END %]
|
||||||
],
|
],
|
||||||
items:[{
|
items:[{
|
||||||
|
@ -209,77 +192,7 @@ Ext.onReady(function(){
|
||||||
region: 'center',
|
region: 'center',
|
||||||
activeTab: 0,
|
activeTab: 0,
|
||||||
items: [
|
items: [
|
||||||
{
|
actionpanel,
|
||||||
layout: 'column',
|
|
||||||
columnWidth: 1.0,
|
|
||||||
title: 'Description',
|
|
||||||
tbar: new DocCompareToolbar('case',tcase.case_id),
|
|
||||||
id: 'action_panel',
|
|
||||||
[% SET case.text.effect = "" UNLESS case.text.effect.defined %]
|
|
||||||
[% SET showeffect = !case.text.effect.match('^\s*(<[^>]*>\s*)*$') %]
|
|
||||||
items: [{
|
|
||||||
columnWidth: [% showeffect ? "0.5" : "1.0" %],
|
|
||||||
layout:'fit',
|
|
||||||
id: 'action_editor_col',
|
|
||||||
items:[{
|
|
||||||
title: 'Action',
|
|
||||||
height: 420,
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'action_editor',
|
|
||||||
xtype:'htmleditor',
|
|
||||||
value: '[% case.text.action FILTER js %]'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
id:'effect_editor_col',
|
|
||||||
layout:'fit',
|
|
||||||
[% UNLESS showeffect %]
|
|
||||||
style:{
|
|
||||||
display: 'none',
|
|
||||||
},
|
|
||||||
[% END %]
|
|
||||||
items:{
|
|
||||||
title: 'Expected Results',
|
|
||||||
height: 420,
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'effect_editor',
|
|
||||||
xtype:'htmleditor',
|
|
||||||
value: '[% case.text.effect FILTER js %]'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Action/Results',
|
|
||||||
handler: processText
|
|
||||||
},{
|
|
||||||
text: '[% showeffect ? "Hide Results Edit" : "Show Results Edit" %]',
|
|
||||||
id: 'showhide_results_btn',
|
|
||||||
handler: function(){
|
|
||||||
d = document.getElementById('effect_editor_col');
|
|
||||||
if (d.style.display != 'none')
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
|
||||||
d.style.display = 'none';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
|
||||||
d.style.display = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
new Testopia.Util.HistoryList('case', [% case.id FILTER none %]),
|
new Testopia.Util.HistoryList('case', [% case.id FILTER none %]),
|
||||||
new Testopia.TestCaseRun.List({case_id: tcase.case_id, viewall: 1 },{id: 'case_history_grid'}),
|
new Testopia.TestCaseRun.List({case_id: tcase.case_id, viewall: 1 },{id: 'case_history_grid'}),
|
||||||
new Testopia.Attachment.Grid(tcase),
|
new Testopia.Attachment.Grid(tcase),
|
||||||
|
@ -342,7 +255,6 @@ Ext.onReady(function(){
|
||||||
border: false,
|
border: false,
|
||||||
root: new Ext.tree.TreeNode({text: 'Test Case [% case.id FILTER none %]'})
|
root: new Ext.tree.TreeNode({text: 'Test Case [% case.id FILTER none %]'})
|
||||||
}]
|
}]
|
||||||
|
|
||||||
},{
|
},{
|
||||||
columnWidth: 0.5,
|
columnWidth: 0.5,
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
@ -458,45 +370,7 @@ Ext.onReady(function(){
|
||||||
});
|
});
|
||||||
if (Param_Show_Setup_Breakdown)
|
if (Param_Show_Setup_Breakdown)
|
||||||
{
|
{
|
||||||
Ext.getCmp('object_panel').insert(0, new Ext.Panel({
|
Ext.getCmp('object_panel').insert(0, Testopia.TestCaseSetupBreakdownPanel(casetext));
|
||||||
layout: 'column',
|
|
||||||
title: 'Set Up / Break Down',
|
|
||||||
items: [{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Setup',
|
|
||||||
height: 420,
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'setup_editor',
|
|
||||||
xtype:'htmleditor',
|
|
||||||
value: '[% case.text.setup FILTER js %]'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Breakdown',
|
|
||||||
height: 420,
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'breakdown_editor',
|
|
||||||
xtype:'htmleditor',
|
|
||||||
value: '[% case.text.breakdown FILTER js %]'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Setup/Breakdown',
|
|
||||||
handler: processText
|
|
||||||
}]
|
|
||||||
}));
|
|
||||||
Ext.getCmp('object_panel').doLayout();
|
Ext.getCmp('object_panel').doLayout();
|
||||||
}
|
}
|
||||||
[% IF case.canedit %]
|
[% IF case.canedit %]
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<div id="mask"></div>
|
<div id="mask"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
||||||
|
var Param_Use_HTMLEditor = [% Param('testopia-hide-htmleditor') ? 0 : 1 %];
|
||||||
var run = [% run.TO_JSON FILTER html_light %];
|
var run = [% run.TO_JSON FILTER html_light %];
|
||||||
var user_login = '[% user.login FILTER html_light %]';
|
var user_login = '[% user.login FILTER html_light %]';
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
|
|
|
@ -4158,6 +4158,212 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var processText;
|
||||||
|
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||||
|
{
|
||||||
|
params = params || {};
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Set Up / Break Down',
|
||||||
|
items: [{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Setup',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_setup_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('setup', params)
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Breakdown',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_breakdown_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: [{
|
||||||
|
text: 'Save',
|
||||||
|
handler: processText
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseTextEditor = function(id, data)
|
||||||
|
{
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
xtype: 'htmleditor',
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
else
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
html: data[id]||'',
|
||||||
|
height: 'auto'
|
||||||
|
},{
|
||||||
|
id: id+'_textarea',
|
||||||
|
xtype: 'textarea',
|
||||||
|
style: 'font-family: monospace',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
hidden: true,
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseShowHTMLEditor = function()
|
||||||
|
{
|
||||||
|
var s, h;
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
var b = Ext.getCmp('edit_html_button');
|
||||||
|
var b1 = Ext.getCmp('save_html_button');
|
||||||
|
if (Ext.getCmp('action_editor').hidden)
|
||||||
|
{
|
||||||
|
b.setText('Edit HTML source');
|
||||||
|
b1.hide();
|
||||||
|
s = 'hide', h = 'show';
|
||||||
|
for (var i in editorids)
|
||||||
|
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b1.show();
|
||||||
|
b.setText('Close editor');
|
||||||
|
s = 'show', h = 'hide';
|
||||||
|
}
|
||||||
|
for (var i in editorids)
|
||||||
|
{
|
||||||
|
Ext.getCmp(i+'_editor')[h]();
|
||||||
|
Ext.getCmp(i+'_textarea')[s]();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseUpdateTextForId = function(id)
|
||||||
|
{
|
||||||
|
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||||
|
var params = {};
|
||||||
|
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
for (var i in editorids)
|
||||||
|
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||||
|
params.case_id = id;
|
||||||
|
params.action = 'update_doc';
|
||||||
|
testopia_form.submit({
|
||||||
|
url: 'tr_process_case.cgi',
|
||||||
|
params: params,
|
||||||
|
success: function(){
|
||||||
|
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||||
|
},
|
||||||
|
failure: Testopia.Util.error
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseShowEffectEditor = function()
|
||||||
|
{
|
||||||
|
var d = Ext.getCmp('effect_editor_col');
|
||||||
|
if (!d.hidden)
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||||
|
d.hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||||
|
d.show();
|
||||||
|
}
|
||||||
|
Ext.getCmp('action_panel').doLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
Testopia.TestCaseActionPanel = function(data)
|
||||||
|
{
|
||||||
|
data = data || {};
|
||||||
|
var actionResultsButtons = [{
|
||||||
|
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||||
|
id: 'showhide_results_btn',
|
||||||
|
handler: Testopia.TestCaseShowEffectEditor
|
||||||
|
}];
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Update Action/Results',
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Save',
|
||||||
|
id: 'save_html_button',
|
||||||
|
hidden: true,
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
}, {
|
||||||
|
text: 'Edit HTML source',
|
||||||
|
id: 'edit_html_button',
|
||||||
|
handler: Testopia.TestCaseShowHTMLEditor
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||||
|
if (!h || h != h)
|
||||||
|
h = 500;
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Description',
|
||||||
|
id: 'action_panel',
|
||||||
|
items: [{
|
||||||
|
columnWidth: data.effect ? 0.5 : 1.0,
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'action_editor_col',
|
||||||
|
items:[{
|
||||||
|
title: 'Action',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_action_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('action', data)
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
columnWidth: 0.5,
|
||||||
|
id: 'effect_editor_col',
|
||||||
|
layout: 'fit',
|
||||||
|
forceLayout: true,
|
||||||
|
hidden: !data.effect,
|
||||||
|
items: {
|
||||||
|
title: 'Expected Results',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_results_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('effect', data)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: actionResultsButtons
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
Testopia.TestCaseRun.Info = function(){
|
Testopia.TestCaseRun.Info = function(){
|
||||||
this.caserun_id;
|
this.caserun_id;
|
||||||
this.store = new Ext.data.Store({
|
this.store = new Ext.data.Store({
|
||||||
|
@ -4192,16 +4398,34 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
}])
|
}])
|
||||||
});
|
});
|
||||||
var store = this.store;
|
var store = this.store;
|
||||||
store.on('load', function(s, r){
|
store.on('load', function(s, r)
|
||||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
{
|
||||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||||
|
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
{
|
||||||
|
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||||
|
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||||
|
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||||
|
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
{
|
||||||
|
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||||
|
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||||
|
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||||
Ext.getCmp('showhide_results_btn').handler();
|
Ext.getCmp('showhide_results_btn').handler();
|
||||||
if (Param_Show_Setup_Breakdown)
|
|
||||||
{
|
|
||||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
|
||||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
|
||||||
}
|
|
||||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4221,27 +4445,6 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
failure: Testopia.Util.error
|
failure: Testopia.Util.error
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
processText = function(){
|
|
||||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
|
||||||
var params = {};
|
|
||||||
if (Param_Show_Setup_Breakdown)
|
|
||||||
{
|
|
||||||
params.tcsetup = Ext.getCmp('setup_editor').getValue();
|
|
||||||
params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue();
|
|
||||||
}
|
|
||||||
params.tcaction = Ext.getCmp('action_editor').getValue();
|
|
||||||
params.tceffect = Ext.getCmp('effect_editor').getValue();
|
|
||||||
params.case_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id');
|
|
||||||
params.action = 'update_doc';
|
|
||||||
testopia_form.submit({
|
|
||||||
url: 'tr_process_case.cgi',
|
|
||||||
params: params,
|
|
||||||
success: function(){
|
|
||||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
|
||||||
},
|
|
||||||
failure: Testopia.Util.error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var summary_tb = new Ext.Toolbar({
|
var summary_tb = new Ext.Toolbar({
|
||||||
id: 'summary_tb',
|
id: 'summary_tb',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
@ -4349,6 +4552,9 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
}
|
}
|
||||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||||
});
|
});
|
||||||
|
Testopia.TestCaseUpdateText = function() {
|
||||||
|
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||||
|
};
|
||||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||||
id: 'case_details_panel',
|
id: 'case_details_panel',
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
@ -4366,73 +4572,9 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
id: 'caserun_center_region',
|
id: 'caserun_center_region',
|
||||||
title: 'Details',
|
title: 'Details',
|
||||||
tbar: summary_tb,
|
tbar: summary_tb,
|
||||||
items: [{
|
items: [
|
||||||
layout: 'column',
|
Testopia.TestCaseActionPanel(),
|
||||||
title: 'Description',
|
{
|
||||||
id: 'action_panel',
|
|
||||||
items: [{
|
|
||||||
columnWidth:1.0,
|
|
||||||
layout:'fit',
|
|
||||||
id:'action_editor_col',
|
|
||||||
items:[{
|
|
||||||
title: 'Action',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_action_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
autoScroll: true,
|
|
||||||
items: [{
|
|
||||||
id: 'action_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
id:'effect_editor_col',
|
|
||||||
layout:'fit',
|
|
||||||
style:{
|
|
||||||
display: 'none',
|
|
||||||
},
|
|
||||||
items:{
|
|
||||||
title: 'Expected Results',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_results_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
autoScroll: true,
|
|
||||||
layout: 'fit',
|
|
||||||
items: [{
|
|
||||||
id: 'effect_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Action/Results',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
},{
|
|
||||||
text: 'Show Results Edit',
|
|
||||||
id: 'showhide_results_btn',
|
|
||||||
handler: function(){
|
|
||||||
d = document.getElementById('effect_editor_col');
|
|
||||||
if (d.style.display != 'none')
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
|
||||||
d.style.display = 'none';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
|
||||||
d.style.display = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: 'Notes',
|
title: 'Notes',
|
||||||
id: 'caserun_notes_panel',
|
id: 'caserun_notes_panel',
|
||||||
border: false,
|
border: false,
|
||||||
|
@ -4459,55 +4601,17 @@ Testopia.TestCaseRun.Info = function(){
|
||||||
text: 'Append Note',
|
text: 'Append Note',
|
||||||
handler: appendNote.createDelegate(this)
|
handler: appendNote.createDelegate(this)
|
||||||
}]
|
}]
|
||||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
},
|
||||||
id: 0,
|
new Testopia.TestCaseRun.History(),
|
||||||
type: 'caserun'
|
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
new Testopia.TestCase.Bugs.Grid(),
|
||||||
}]
|
new Testopia.TestCase.Components(),
|
||||||
|
new Testopia.Tags.ObjectTags('case', 0)
|
||||||
|
]}]
|
||||||
});
|
});
|
||||||
if (Param_Show_Setup_Breakdown)
|
if (Param_Show_Setup_Breakdown)
|
||||||
{
|
{
|
||||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||||
layout: 'column',
|
|
||||||
title: 'Set Up / Break Down',
|
|
||||||
items: [{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Setup',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_setup_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'setup_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Breakdown',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_breakdown_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'breakdown_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Setup/Breakdown',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
}]
|
|
||||||
}));
|
|
||||||
Ext.getCmp('caserun_center_region').doLayout();
|
Ext.getCmp('caserun_center_region').doLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -3932,6 +3932,206 @@ this.store.load();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
var processText;
|
||||||
|
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||||
|
{
|
||||||
|
params = params || {};
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Set Up / Break Down',
|
||||||
|
items: [{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Setup',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_setup_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('setup', params)
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
columnWidth:0.5,
|
||||||
|
layout:'fit',
|
||||||
|
items:{
|
||||||
|
title: 'Breakdown',
|
||||||
|
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
id: 'cr_breakdown_panel',
|
||||||
|
autoScroll: true,
|
||||||
|
layout: 'fit',
|
||||||
|
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: [{
|
||||||
|
text: 'Save',
|
||||||
|
handler: processText
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Testopia.TestCaseTextEditor = function(id, data)
|
||||||
|
{
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
xtype: 'htmleditor',
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
else
|
||||||
|
return [{
|
||||||
|
id: id+'_editor',
|
||||||
|
html: data[id]||'',
|
||||||
|
height: 'auto'
|
||||||
|
},{
|
||||||
|
id: id+'_textarea',
|
||||||
|
xtype: 'textarea',
|
||||||
|
style: 'font-family: monospace',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
hidden: true,
|
||||||
|
value: data[id]||''
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
Testopia.TestCaseShowHTMLEditor = function()
|
||||||
|
{
|
||||||
|
var s, h;
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
var b = Ext.getCmp('edit_html_button');
|
||||||
|
var b1 = Ext.getCmp('save_html_button');
|
||||||
|
if (Ext.getCmp('action_editor').hidden)
|
||||||
|
{
|
||||||
|
b.setText('Edit HTML source');
|
||||||
|
b1.hide();
|
||||||
|
s = 'hide', h = 'show';
|
||||||
|
for (var i in editorids)
|
||||||
|
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b1.show();
|
||||||
|
b.setText('Close editor');
|
||||||
|
s = 'show', h = 'hide';
|
||||||
|
}
|
||||||
|
for (var i in editorids)
|
||||||
|
{
|
||||||
|
Ext.getCmp(i+'_editor')[h]();
|
||||||
|
Ext.getCmp(i+'_textarea')[s]();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Testopia.TestCaseUpdateTextForId = function(id)
|
||||||
|
{
|
||||||
|
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||||
|
var params = {};
|
||||||
|
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||||
|
var editorids = { 'action': 1, 'effect': 1 };
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
editorids['setup'] = editorids['breakdown'] = 1;
|
||||||
|
for (var i in editorids)
|
||||||
|
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||||
|
params.case_id = id;
|
||||||
|
params.action = 'update_doc';
|
||||||
|
testopia_form.submit({
|
||||||
|
url: 'tr_process_case.cgi',
|
||||||
|
params: params,
|
||||||
|
success: function(){
|
||||||
|
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||||
|
},
|
||||||
|
failure: Testopia.Util.error
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Testopia.TestCaseShowEffectEditor = function()
|
||||||
|
{
|
||||||
|
var d = Ext.getCmp('effect_editor_col');
|
||||||
|
if (!d.hidden)
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||||
|
d.hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||||
|
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||||
|
d.show();
|
||||||
|
}
|
||||||
|
Ext.getCmp('action_panel').doLayout();
|
||||||
|
};
|
||||||
|
Testopia.TestCaseActionPanel = function(data)
|
||||||
|
{
|
||||||
|
data = data || {};
|
||||||
|
var actionResultsButtons = [{
|
||||||
|
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||||
|
id: 'showhide_results_btn',
|
||||||
|
handler: Testopia.TestCaseShowEffectEditor
|
||||||
|
}];
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Update Action/Results',
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actionResultsButtons.unshift({
|
||||||
|
text: 'Save',
|
||||||
|
id: 'save_html_button',
|
||||||
|
hidden: true,
|
||||||
|
handler: Testopia.TestCaseUpdateText
|
||||||
|
}, {
|
||||||
|
text: 'Edit HTML source',
|
||||||
|
id: 'edit_html_button',
|
||||||
|
handler: Testopia.TestCaseShowHTMLEditor
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||||
|
if (!h || h != h)
|
||||||
|
h = 500;
|
||||||
|
return {
|
||||||
|
layout: 'column',
|
||||||
|
columnWidth: 1.0,
|
||||||
|
title: 'Description',
|
||||||
|
id: 'action_panel',
|
||||||
|
items: [{
|
||||||
|
columnWidth: data.effect ? 0.5 : 1.0,
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'action_editor_col',
|
||||||
|
items:[{
|
||||||
|
title: 'Action',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_action_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('action', data)
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
columnWidth: 0.5,
|
||||||
|
id: 'effect_editor_col',
|
||||||
|
layout: 'fit',
|
||||||
|
forceLayout: true,
|
||||||
|
hidden: !data.effect,
|
||||||
|
items: {
|
||||||
|
title: 'Expected Results',
|
||||||
|
height: h,
|
||||||
|
id: 'cr_results_panel',
|
||||||
|
bodyBorder: false,
|
||||||
|
border: false,
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: true,
|
||||||
|
items: Testopia.TestCaseTextEditor('effect', data)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
buttons: actionResultsButtons
|
||||||
|
};
|
||||||
|
};
|
||||||
Testopia.TestCaseRun.Info = function(){
|
Testopia.TestCaseRun.Info = function(){
|
||||||
this.caserun_id;
|
this.caserun_id;
|
||||||
this.store = new Ext.data.Store({
|
this.store = new Ext.data.Store({
|
||||||
|
@ -3966,16 +4166,34 @@ mapping: 'notes'
|
||||||
}])
|
}])
|
||||||
});
|
});
|
||||||
var store = this.store;
|
var store = this.store;
|
||||||
store.on('load', function(s, r){
|
store.on('load', function(s, r)
|
||||||
|
{
|
||||||
|
if (Param_Use_HTMLEditor)
|
||||||
|
{
|
||||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
|
||||||
Ext.getCmp('showhide_results_btn').handler();
|
|
||||||
if (Param_Show_Setup_Breakdown)
|
if (Param_Show_Setup_Breakdown)
|
||||||
{
|
{
|
||||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||||
|
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||||
|
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||||
|
if (Param_Show_Setup_Breakdown)
|
||||||
|
{
|
||||||
|
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||||
|
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||||
|
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||||
|
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||||
|
Ext.getCmp('showhide_results_btn').handler();
|
||||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||||
});
|
});
|
||||||
appendNote = function(){
|
appendNote = function(){
|
||||||
|
@ -3994,27 +4212,6 @@ store.reload();
|
||||||
failure: Testopia.Util.error
|
failure: Testopia.Util.error
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
processText = function(){
|
|
||||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
|
||||||
var params = {};
|
|
||||||
if (Param_Show_Setup_Breakdown)
|
|
||||||
{
|
|
||||||
params.tcsetup = Ext.getCmp('setup_editor').getValue();
|
|
||||||
params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue();
|
|
||||||
}
|
|
||||||
params.tcaction = Ext.getCmp('action_editor').getValue();
|
|
||||||
params.tceffect = Ext.getCmp('effect_editor').getValue();
|
|
||||||
params.case_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id');
|
|
||||||
params.action = 'update_doc';
|
|
||||||
testopia_form.submit({
|
|
||||||
url: 'tr_process_case.cgi',
|
|
||||||
params: params,
|
|
||||||
success: function(){
|
|
||||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
|
||||||
},
|
|
||||||
failure: Testopia.Util.error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var summary_tb = new Ext.Toolbar({
|
var summary_tb = new Ext.Toolbar({
|
||||||
id: 'summary_tb',
|
id: 'summary_tb',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
@ -4122,6 +4319,9 @@ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id')
|
||||||
}
|
}
|
||||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||||
});
|
});
|
||||||
|
Testopia.TestCaseUpdateText = function() {
|
||||||
|
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||||
|
};
|
||||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||||
id: 'case_details_panel',
|
id: 'case_details_panel',
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
@ -4139,73 +4339,9 @@ activeTab: 0,
|
||||||
id: 'caserun_center_region',
|
id: 'caserun_center_region',
|
||||||
title: 'Details',
|
title: 'Details',
|
||||||
tbar: summary_tb,
|
tbar: summary_tb,
|
||||||
items: [{
|
items: [
|
||||||
layout: 'column',
|
Testopia.TestCaseActionPanel(),
|
||||||
title: 'Description',
|
|
||||||
id: 'action_panel',
|
|
||||||
items: [{
|
|
||||||
columnWidth:1.0,
|
|
||||||
layout:'fit',
|
|
||||||
id:'action_editor_col',
|
|
||||||
items:[{
|
|
||||||
title: 'Action',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_action_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
autoScroll: true,
|
|
||||||
items: [{
|
|
||||||
id: 'action_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
id:'effect_editor_col',
|
|
||||||
layout:'fit',
|
|
||||||
style:{
|
|
||||||
display: 'none',
|
|
||||||
},
|
|
||||||
items:{
|
|
||||||
title: 'Expected Results',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_results_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
border: false,
|
|
||||||
autoScroll: true,
|
|
||||||
layout: 'fit',
|
|
||||||
items: [{
|
|
||||||
id: 'effect_editor',
|
|
||||||
xtype: 'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Action/Results',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
},{
|
|
||||||
text: 'Show Results Edit',
|
|
||||||
id: 'showhide_results_btn',
|
|
||||||
handler: function(){
|
|
||||||
d = document.getElementById('effect_editor_col');
|
|
||||||
if (d.style.display != 'none')
|
|
||||||
{
|
{
|
||||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
|
||||||
d.style.display = 'none';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
|
||||||
Ext.getCmp('action_panel').doLayout();
|
|
||||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
|
||||||
d.style.display = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: 'Notes',
|
title: 'Notes',
|
||||||
id: 'caserun_notes_panel',
|
id: 'caserun_notes_panel',
|
||||||
border: false,
|
border: false,
|
||||||
|
@ -4232,55 +4368,17 @@ xtype: 'button',
|
||||||
text: 'Append Note',
|
text: 'Append Note',
|
||||||
handler: appendNote.createDelegate(this)
|
handler: appendNote.createDelegate(this)
|
||||||
}]
|
}]
|
||||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
},
|
||||||
id: 0,
|
new Testopia.TestCaseRun.History(),
|
||||||
type: 'caserun'
|
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
new Testopia.TestCase.Bugs.Grid(),
|
||||||
}]
|
new Testopia.TestCase.Components(),
|
||||||
|
new Testopia.Tags.ObjectTags('case', 0)
|
||||||
|
]}]
|
||||||
});
|
});
|
||||||
if (Param_Show_Setup_Breakdown)
|
if (Param_Show_Setup_Breakdown)
|
||||||
{
|
{
|
||||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||||
layout: 'column',
|
|
||||||
title: 'Set Up / Break Down',
|
|
||||||
items: [{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Setup',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_setup_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'setup_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
columnWidth:0.5,
|
|
||||||
layout:'fit',
|
|
||||||
items:{
|
|
||||||
title: 'Breakdown',
|
|
||||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
|
||||||
id: 'cr_breakdown_panel',
|
|
||||||
bodyBorder: false,
|
|
||||||
autoScroll: true,
|
|
||||||
border: false,
|
|
||||||
layout: 'fit',
|
|
||||||
items:[{
|
|
||||||
id: 'breakdown_editor',
|
|
||||||
xtype:'htmleditor'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
buttons: [{
|
|
||||||
text: 'Update Setup/Breakdown',
|
|
||||||
handler: processText.createDelegate(this)
|
|
||||||
}]
|
|
||||||
}));
|
|
||||||
Ext.getCmp('caserun_center_region').doLayout();
|
Ext.getCmp('caserun_center_region').doLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,70 +20,75 @@
|
||||||
#%]
|
#%]
|
||||||
|
|
||||||
[%
|
[%
|
||||||
title = "Testopia"
|
title = "Testopia"
|
||||||
desc = "Set Testopia parameters"
|
desc = "Set Testopia parameters"
|
||||||
%]
|
%]
|
||||||
|
|
||||||
[% param_descs = {
|
[% param_descs = {
|
||||||
"private-cases-log" => "If this option is on, the tester cannot view other testers' cases",
|
"private-cases-log" => "If this option is on, the tester cannot view other testers' cases",
|
||||||
|
|
||||||
"allow-test-deletion" => "If this option is on, users can delete objects including plans and cases",
|
"allow-test-deletion" => "If this option is on, users can delete objects including plans and cases",
|
||||||
|
|
||||||
"testopia-allow-group-member-deletes" => "If this option is on, members of the Testers group will be
|
"testopia-allow-group-member-deletes" =>
|
||||||
allowed to delete test objects",
|
"If this option is on, members of the Testers group will be allowed to delete test objects",
|
||||||
|
|
||||||
"testopia-default-plan-testers-regexp" => "This is the default regular expression for granting
|
"testopia-default-plan-testers-regexp" =>
|
||||||
access to new test plans",
|
"This is the default regular expression for granting access to new test plans",
|
||||||
|
|
||||||
"print-tag-in-case-log" => 'If this option is on, the entire tag text is printed in a test case ' _
|
"print-tag-in-case-log" =>
|
||||||
'log entry. Otherwise, only an href to the tag is put there.',
|
'If this option is on, the entire tag text is printed in a test case ' _
|
||||||
|
'log entry. Otherwise, only an href to the tag is put there.',
|
||||||
|
|
||||||
"new-case-action-template" => "This is the text to be put in a newly created test case \"action\" field",
|
"new-case-action-template" => "This is the text to be put in a newly created test case \"action\" field",
|
||||||
|
|
||||||
"new-case-results-template" => "This is the text to be put in a newly created test case \"expected results\" field",
|
"new-case-results-template" => "This is the text to be put in a newly created test case \"expected results\" field",
|
||||||
|
|
||||||
"bug-to-test-case-summary" => 'This is the default summary text used when generating a test case ' _
|
"bug-to-test-case-summary" =>
|
||||||
'out of a bug. The special symbol %id% is replaced with the bug id and ' _
|
'This is the default summary text used when generating a test case ' _
|
||||||
"%summary% is replaced with the bug's summary",
|
'out of a bug. The special symbol %id% is replaced with the bug id and ' _
|
||||||
|
"%summary% is replaced with the bug's summary",
|
||||||
|
|
||||||
"bug-to-test-case-action" => 'This is the default action text used when generating a test case ' _
|
"bug-to-test-case-action" =>
|
||||||
'out of a bug. The special symbol %id% is replaced with a ' _
|
'This is the default action text used when generating a test case ' _
|
||||||
"hyperlink to the bug's page. The special symbol \%description\% is " _
|
'out of a bug. The special symbol %id% is replaced with a ' _
|
||||||
"replaced with the bug's description",
|
"hyperlink to the bug's page. The special symbol \%description\% is " _
|
||||||
|
"replaced with the bug's description",
|
||||||
|
|
||||||
"bug-to-test-case-results" => 'This is the default results text used when generating a test case ' _
|
"bug-to-test-case-results" =>
|
||||||
'out of a bug. The special symbol %id% is replaced with a ' _
|
'This is the default results text used when generating a test case ' _
|
||||||
"hyperlink to the bug's page",
|
'out of a bug. The special symbol %id% is replaced with a ' _
|
||||||
|
"hyperlink to the bug's page",
|
||||||
|
|
||||||
"default-test-case-status" => 'Default status for newly created test cases.',
|
"default-test-case-status" => 'Default status for newly created test cases.',
|
||||||
|
|
||||||
"new-testrun-email-notif" => 'E-mail message sent to assigned testers when a new test run is started. ' _
|
"new-testrun-email-notif" =>
|
||||||
'There are some special symbols replaced at run time:<br/>' _
|
'E-mail message sent to assigned testers when a new test run is started. ' _
|
||||||
'%to%: list of assigned testers email addresses<br/>' _
|
'There are some special symbols replaced at run time:<br/>' _
|
||||||
'%summary%: test run summary<br/>' _
|
'%to%: list of assigned testers email addresses<br/>' _
|
||||||
'%plan%: plan\'s name<br/>' _
|
'%summary%: test run summary<br/>' _
|
||||||
'%plan_id%: plan\'s id<br/>' _
|
'%plan%: plan\'s name<br/>' _
|
||||||
'%product%: product\'s name<br/>' _
|
'%plan_id%: plan\'s id<br/>' _
|
||||||
'%product_id%: product\'s id',
|
'%product%: product\'s name<br/>' _
|
||||||
|
'%product_id%: product\'s id',
|
||||||
|
|
||||||
"case-failed-email-notif" => 'E-mail message sent when a test case log is marked as \'failed\'. ' _
|
"case-failed-email-notif" =>
|
||||||
'There are some special symbols replaced at run time:<br/>' _
|
'E-mail message sent when a test case log is marked as \'failed\'. ' _
|
||||||
'%id%: test case log id<br/>' _
|
'There are some special symbols replaced at run time:<br/>' _
|
||||||
'%manager%: test run\'s manager<br/>' _
|
'%id%: test case log id<br/>' _
|
||||||
'%test_run%: test run\'s summary<br/>' _
|
'%manager%: test run\'s manager<br/>' _
|
||||||
'%tester%: tester<br/>' _
|
'%test_run%: test run\'s summary<br/>' _
|
||||||
'%component%: component\'s name',
|
'%tester%: tester<br/>' _
|
||||||
|
'%component%: component\'s name',
|
||||||
|
|
||||||
"tester-completed-email-notif" => 'E-mail message sent when a tester has run every assigned test case.',
|
"tester-completed-email-notif" => 'E-mail message sent when a tester has run every assigned test case.',
|
||||||
|
|
||||||
"test-run-completed-email-notif" => 'E-mail message sent when every test case in a test run is completed.',
|
"test-run-completed-email-notif" => 'E-mail message sent when every test case in a test run is completed.',
|
||||||
"testopia-max-allowed-plan-testers" => 'Limit to how many users a plan access regular expression should match',
|
"testopia-max-allowed-plan-testers" => 'Limit to how many users a plan access regular expression should match',
|
||||||
"testopia-debug" => 'Developer: Load individual files (Slowest) <br>ON: Use the debug version of Javascript files (Slower but needful if reporting javascript related problems) <br/> OFF: Use the compressed version (faster)',
|
"testopia-debug" => 'Developer: Load individual files (Slowest) <br>ON: Use the debug version of Javascript files (Slower but needful if reporting javascript related problems) <br/> OFF: Use the compressed version (faster)',
|
||||||
|
|
||||||
"test_case_wiki_action_iframe" => 'Source HTML (probably with an iframe) for test case action in the case of "Use from Wiki" selected. $URL is substituted with article URL.',
|
"test_case_wiki_action_iframe" => 'Source HTML (probably with an iframe) for test case action in the case of "Use from Wiki" selected. $URL is substituted with article URL.',
|
||||||
|
|
||||||
"testopia-show-setup-breakdown" => 'Show an individual tab with Setup/Breakdown edit fields in test case display.',
|
"testopia-show-setup-breakdown" => 'Show an individual tab with Setup/Breakdown edit fields in test case display.',
|
||||||
|
|
||||||
}
|
'testopia-hide-htmleditor' => 'Hide WISYWIG HTML editor in Action/Results/Setup/Breakdown edit fields.<br />Useful when your test cases are stored in MediaWiki.'
|
||||||
|
} %]
|
||||||
%]
|
|
||||||
|
|
Loading…
Reference in New Issue