-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot clone testcase #695
Comments
Well you've got to select a TestPlan in which the TestCase will be cloned. You've got an error message telling you that this field is required. However I'm able to reproduce a problem in which when you press Filter the results are shown on a different screen. I can reproduce on the demo website but not locally with master. I'm leaving this open for now to re-test with the new version which will be released very soon. |
Will start to work on this once #683 is merged |
Stop working on #683 for now. I was able to reproduce locally with master:
Results: Expected: Additional info: |
@radiateboy see the steps to reproduce above. Based on that you can workaround the problem by opening the test cases you want to clone from their test plan. |
I am able to reproduce this both locally and on the demo. jQ('#id_form_search_plan').bind('submit', function(e) {
e.stopPropagation();
e.preventDefault();
var url = '/plans/';
var container = jQ('#id_plan_container');
container.show();
jQ.ajax({
'url': url,
'type': 'GET',
'data': jQ(this).serialize(),
'success': function (data, textStatus, jqXHR) {
container.html(data);
}
});
});
For now, I have no idea why this is happening and will continue investigating |
@asankov see what binds this to the form. Maybe in one of the cases that is simply not initialized. |
@atodorov you were right. in the case we have are missing $('#id_product').change(update_version_select_from_product);
if (!$('#id_version').val().length) {
update_version_select_from_product();
}
jQ('#id_form_search_plan').bind('submit', function(e) {
// logic we need for the form to work as expected
});
The valid question here is: Why does this work when we have a product? The answer is: $('#id_product').change(update_version_select_from_product);
if (!$('#id_version').val().length) {
//asynchronous code
jsonRPC('Version.filter', {product: product_id}, updateVersionSelectCallback);
}
jQ('#id_form_search_plan').bind('submit', function(e) {
// logic we need for the form to work as expected
});
// more code
// here somewhere the asynchronous code is executed
function updateVersionSelectCallback(products) {
// code
$(selector).selectpicker('refresh'); // -> error. nothing more is executed
} when product is missing however, we don't do an aynschronous call, and load empty versions. therefore the code is executed in another order: $('#id_product').change(update_version_select_from_product);
if (!$('#id_version').val().length) {
//synchronous code
updateVersionSelectCallback([])
}
function updateVersionSelectCallback(products){
//code
$(selector).selectpicker('refresh'); // -> error. nothing more is executed
}
// none of this is executed
jQ('#id_form_search_plan').bind('submit', function(e) {
// logic we need for the form to work as expected
});
} This is easily fixed by importing I suppose that until then, the easiest and dirtiest workaround would be to place the sometimes failing code at the bottom of the js file: jQ('#id_form_search_plan').bind('submit', function(e) {
e.stopPropagation();
e.preventDefault();
var url = '/plans/';
var container = jQ('#id_plan_container');
container.show();
jQ.ajax({
'url': url,
'type': 'GET',
'data': jQ(this).serialize(),
'success': function (data, textStatus, jqXHR) {
container.html(data);
}
});
});
// more code
$('#id_product').change(update_version_select_from_product);
if (!$('#id_version').val().length) {
update_version_select_from_product();
} the boostrap-switch call would still fail, but the template will work, and we will refactor it anyway someday |
A temporary workaround until this template is refactored into Patternfly, when bootstrap-switch can be used, and the following js code will work
A temporary workaround until this template is refactored into Patternfly, when bootstrap-switch can be used, and the following js code will work
A temporary workaround until templates/case/clone.html is refactored into Patternfly when bootstrap-select can be imported and used
Steps to Reproduce
The text was updated successfully, but these errors were encountered: