Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: Duplicate test runs
- description: Allow users to duplicate a run inside a plan
- author:
- version: 1.0
- includes:
- excludes:
- js:
- $(document).ready(
- function() {
- $(".plan-entry").each(function()
- {
- var entry = $(this).attr("id");
- entry = entry.split("entry-")[1];
- if($(this).find(".includeAllLink.hidden").length)
- {
- $(this).find(".summary-description-compact").append(" | <a href='#' class='link copyTestRun' value='"+entry+"'>Duplicate this test Run</a>");
- }
- else
- {
- console.log("All cases included");
- }
- //console.log(window.location.href);
- //console.log(uiscripts.env.page_base);
- });
- $(".copyTestRun").click(function(){
- var r = confirm("Please save the plan before using this functionnality, all unsaved modifications will be lost. Click ok to continue the copy.")
- if (r == true)
- {
- currentEntry = $(this).attr("value");
- testPlan = window.location.href.split('/')[6];
- console.log(testPlan);
- // alert(currentEntry);
- $.ajax(
- {
- url: "duplicateTestRuns.php?entry_id="+currentEntry+"&plan_id="+testPlan,
- // dataType: "json",
- // data: {entry: currentEntry},
- type: "GET",
- async: false,
- success : function(html,status){
- console.log(html);
- location.reload();
- },
- error : function(result,status,error){
- console.log(result);
- alert("error");
- }
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement