Open Bug 437132 Opened 16 years ago Updated 16 years ago

Changes to the Action or Expected Results section of Test Cases cause incorrect search behavior

Categories

(Testopia :: Search, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: cgalanis, Assigned: gregaryh)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Testopia 2.0

Note that this was reported in the past for Testopia version 1.2 in bug 385477, but for the sake of helping the engineer who will fix it, I'm re-reporting and updating it as a new bug since, although the underlying issue remains, the symptoms in Testopia 2.0 are quite different. Once done, the old bug will be marked as a duplicate of this one.

It appears that the Test Case search tool is searching through old versions of Test Cases. When a change is committed to the Action or Expected Results section of a TC, the old Case Versions do not seem to be skipped by the search.

For instance, let's say that originally my Expected Results section for a test case has the sentence "The user is loggged in" (notice the typo in the word 'logged'), and I make a commit to correct the typo. Now, I do a search that looks for the word "user" in the Expected Results section. In this case, both versions are caught by the search tool and considered as if they are two separate hits when you look at the result count at the bottom right of the screen. If I make another change and then repeat the search, I will register as three separate hits, and so on.

The symptom described above is not so bad, since it's only the number of hits that is off, and you can get the right number simply by selecting "View All" in the results page (although it won't make sense, it will say something like "Display test cases 1 - 74 of 85" when there are no other pages). However, there is another more serious symptom that leads to inaccurate results and that I have not found any workaround for. Let's say for instance that the Expected Results field originally reads as follows "The server is logged in" where the word "server" was a mistake and should have been "user". I notice the mistake and correct it by changing the word "server" for "user" and committing the change. Now, if I do a TC search for the word "server" in the Expected Results section, the Test Case I fixed should not be returned, because the word has been removed. Due to this bug however, the test case will incorrectly be returned because the word used to be there in an old version.

Reproducible: Always

Steps to Reproduce:
1. Create a Test Case where the Action section is simply the following: "Apple
Banana"
2. After the TC has been created, go back to it and delete the word "Banana"
and commit the change.
3. Go to the Test Case Search page and look for the word "Apple" in the Action
section.
4. Try again with the word "Banana"

Actual Results:  
3. The test case is returned and the number of hits in the bottom right corner says "Displaying test cases 1 - 1 of 2"
4. The test case is incorrectly returned in the results.

Expected Results:  
3. The test case is returned and the number of hits in the bottom right corner says "Displaying test cases 1 - 1 of 1"
4. No results are found because the word "Banana" is no longer in the
Action section.

This makes creating batches of similar test cases with only a small change in
them using the Clone feature a painful situation when it comes to searching
through them later on. If I clone a test case 5 times and change one section
each time, but then do a search for a term in the original section that was
changed for all the rest, all 6 test cases are returned.
Search results are now set up with a DISTINCT so that no repeats should be appearing. However, I do not have a solution to the other problem of returning results when they match a previous version.

Here is the SQL: 
SELECT test_cases.case_id FROM test_cases 
LEFT JOIN test_case_texts AS case_texts ON (test_cases.case_id = case_texts.case_id) 
WHERE ((INSTR(CAST(LOWER(case_texts.action) AS BINARY), CAST('jellyfish' AS BINARY)) > 0))

The problem is that the test_case_texts are joined in a separate table (which is how multiple versions are kept). Anyone know how to essentially say WHERE case_text_version = MAX(case_text_version)?


Status: UNCONFIRMED → NEW
Ever confirmed: true
What about something to this effect:

... WHERE case_text_version = (Select MAX(case_text_version) FROM test_cases t1 WHERE t1.case_id = test_cases.case_id)
You need to log in before you can comment on or make changes to this bug.