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

Set test names/reference in testSuite:New.vi #40

Open
chrisb2244 opened this issue Feb 12, 2019 · 3 comments
Open

Set test names/reference in testSuite:New.vi #40

chrisb2244 opened this issue Feb 12, 2019 · 3 comments
Assignees

Comments

@chrisb2244
Copy link

In testSuite:New we can collect the same test case with some different inputs (for me, different classes in the same object hierarchy) and then run the same test case for the different inputs without code duplication (apologies for the default icons - it's the same test case with two values of a boolean).
image

However, in the GUI, there's no good way to see which might be which (that I know of... maybe there is?)
image

Would it be possible to make a modification to allow changing the line that appears in the GUI.
Then we could have something like
image
and with/without library/class names (either would be fine, shown here with library but not class which is probably pretty inconsistent and so maybe a bad combination)
image
(apologies this time for Paint skills)

I suppose a workaround is to have a testCase with a dynamic dispatch "Get Class to Test.vi" and then child classes which just provide the class constant, and implement all the tests in the parent. I haven't tried this to know what the outcome will be in VI Tester but it sounds possible and might give me the appropriate child class names in the GUI... if this is the usual method then my apologies for the unnecessary issue!

@chrisb2244
Copy link
Author

Having just tested this, the behaviour when using two almost empty classes inheriting from the implemented ServerWriterTestCase.lvclass, with just a boolean returning DD VI, is to give a testSuite with no tests (presumably because the actual testCases have no tests, as found by listAllTestMethods.vi) and then have the testCase appear alone, and operate with the default data value (false).

@chrisb2244
Copy link
Author

This modification can be made by adding a section of code to GraphicalTestRunner.lvlib:Initialize Tests on Tree and a new String private data member with read/write accessors in TestCase.lvclass (for test cases - for Suites, I imagine the same thing could be done).

Example images are shown below:
image
(Initialize Tests on Tree.vi)

image
TestCase.lvclass, private data and class members in Dependencies (I just edited the installed files, not the source and rebuilt)

image
New.vi in TestSuite.lvclass, using the same class twice and the Write Accessor for "customName".

image
GUI Runner showing the two test cases. Other cases still have the usual class name format. All tests are found and still run. Double-clicking on the tests in "test-a" and "test-b" still open the correct VIs.

Are these values (in the GUI Runner) only cosmetic? If so, is this a valid way to edit their appearance?

@jimkring
Copy link
Contributor

Hi @chrisb2244. This is a very good idea -- I can see how having different display names for each instance of a TestCase or TestSuite would be very helpful. I've wanted this, too. I'll review the details of your proposal in more depth, soon. Please do feel free to keep posting your thoughts and ideas about this. I read all the posts :-)

@jimkring jimkring self-assigned this Feb 12, 2019
Daklu added a commit to Daklu/JKI-VI-Tester that referenced this issue Aug 9, 2019
Added testCaseInstanceName field and public accessors to TestCase class.
Added private vi Get Test Instance Name.vi to GraphicalTestRunner.lvlib.
Modified Initialize Tests On Tree.vi to use the instance name returned by
  Get Test Instance Name.vi instead of just using the class name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants