Skip to content
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

test cases erased appearing in test plans #238

Open
paulotortorelli opened this issue May 27, 2014 · 8 comments
Open

test cases erased appearing in test plans #238

paulotortorelli opened this issue May 27, 2014 · 8 comments

Comments

@paulotortorelli
Copy link

Hello,
I noticed that when a test case is deleted from the project root, what happens is an update of the active field that receives the value "0". But these test cases continue to appear in the test plans that had already been allocated. I know it's possible to remove them from these plans, but if we drag a suite again to plan, test cases deleted will reappear.

Anyone have any solution?

Thank you :D

@Saragu0
Copy link

Saragu0 commented May 27, 2014

Hi,

No way to upload solution now, but I think I've got it. Say something tomorrow.

Regards,

El 27/05/2014, a las 20:11, paulotortorelli [email protected] escribió:

Hello,
I noticed that when a test case is deleted from the project root, what happens is an update of the active field that receives the value "0". But these test cases continue to appear in the test plans that had already been allocated. I know it's possible to remove them from these plans, but if we drag a suite again to plan, test cases deleted will reappear.

Anyone have any solution?

Thank you :D


Reply to this email directly or view it on GitHub.

@paulotortorelli
Copy link
Author

thank you :)

@Saragu0
Copy link

Saragu0 commented May 28, 2014

Hi, Paulo,

Here's what we did (it also solves problem when trying to use _show_detail.test_project.html.erb):

Change line 22 in redmine_impasse/app/views/impasse_test_case/_show.html.erb to:

  <%= render :partial => "show_detail.#{@node_type_name}" if @node_type_name != "test_project"%>

Change line 329 in redmine_impasse/app/controllers/impasse_test_case_controller.rb to:

original_case = Impasse::TestCase.find(original_node.id, :include => :test_steps, :include => :keywords)

Add new line just after 331:

original_case.keywords.each{|k| test_case.keywords << k.dup}

I think it may be OK. Would you mind to tell me something when you try it, please? ;-)

Regards,

@Saragu0
Copy link

Saragu0 commented May 28, 2014

Hi, Paulo,

Can't answer directly to your last comment as I don't find it.

Be careful: I've updated my comment just after writing it. Lines 329 and 331 are from redmine_impasse/app/controllers/impasse_test_case_controller.rb. And that's the main part of the solution, if I remember well.

Regards,

@paulotortorelli
Copy link
Author

sorry! I ended up deleting the message: (

impasse_test_case_controller.rb my file is a little different,

Your Line 329 corresponds to my 355.

What is the piece of code to add the new line?

def copy_node(original_node, parent_id, level=0)
node = original_node.dup

if node.is_test_case?
  original_case = Impasse::TestCase.find(original_node.id, :include => :test_steps, :include => :keywords)
  test_case = original_case.dup
  original_case.test_steps.each{|ts| test_case.test_steps << ts.dup }
else
  original_case = Impasse::TestSuite.find(original_node.id)
  test_case = original_case.dup
end

node.parent_id = parent_id
node.name = "#{l(:button_copy)}_#{node.name}"
node.save!
node.update_siblings_order! if level == 0

test_case.id = node.id
test_case.save!

if original_node.is_test_suite?
  original_node.children.each {|child|
    copy_node(child, node.id, level + 1)
  }
end
[node, test_case]

end

@Saragu0
Copy link

Saragu0 commented May 28, 2014

Just add the line before the else. This way:

    if node.is_test_case?
      original_case = Impasse::TestCase.find(original_node.id, :include => :test_steps, :include => :keywords)
      test_case = original_case.dup
      original_case.test_steps.each{|ts| test_case.test_steps << ts.dup }
      original_case.keywords.each{|k| test_case.keywords << k.dup}
    else
      original_case = Impasse::TestSuite.find(original_node.id)
      test_case = original_case.dup

@paulotortorelli
Copy link
Author

I changed the lines and did not work.
I created a project, release, test plan ...

cases of deleted test will reappear when dragging the suite

@paulotortorelli
Copy link
Author

Hello, I managed to solve the problem by adding the condition "AND tc.active = 1" after "ON child.id = tc.id" ​​in lines 59 and 138.

Works with mysql base without problems :)

But with the base sql server, I have problems to assign the user to the test case :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants