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

Using the @title token for polarion test case title #65

Closed
spoore1 opened this issue Jul 20, 2016 · 9 comments
Closed

Using the @title token for polarion test case title #65

spoore1 opened this issue Jul 20, 2016 · 9 comments
Milestone

Comments

@spoore1
Copy link
Contributor

spoore1 commented Jul 20, 2016

Can we have the option (via command line arg) to use the test case Test token for the polarion test case title on import?

I would like to use this instead of using the python module, class, method/function names.

@sthirugn
Copy link
Contributor

Can you please explain the use case by showing the command that you are trying to use?

@spoore1
Copy link
Contributor Author

spoore1 commented Jul 20, 2016

Well, I hadn't actually started running it for this particular query yet.

Here's an example though:

# cat test_simple.py 
class TestExample(object):
    def test_case_0001(self):
        """ Test Case 0001
        @casecomponent: ipa
        @Setup:
        1. Install OS
        @Steps:
        1. Run something one time
        @Assert:
        1. something works
        """
        pass

Then I run this:

# betelgeuse test-case --collect-only --path test_simple.py <project>
Creating test case test_case_0001 for requirement: Simple.
Linking test case test_case_0001 to requirement: Simple.

I'm looking for a way to tell betelgeuse to use "Test Case 0001" for the test case title in polarion instead of test_case_0001.

So, I was thinking something like:

# betelgeuse test-case --use-test-name --collect-only --path test_simple.py <project>
Creating test case "Test Case 0001" for requirement: Simple.
Linking test case "Test Case 0001" to requirement: Simple.

@elyezer
Copy link
Collaborator

elyezer commented Jul 20, 2016

I think a good solution would be to add an option that allows you specify a polarion field to be mapped to the first line of the docstring. This way we have the flexibility of defining what to map for the first line.

Worth mention that it will only grab the first line not the first paragraph. On the Betelgeuse code this will be checked before assigning any token, so if the field is present on the docstring as a token it will be overridden.

@spoore1
Copy link
Contributor Author

spoore1 commented Jul 20, 2016

That would work. And like you said would allow more flexibility since I think some people use Description similar to how my team uses Title.

One thing, though. I thought testimony used the first line of docstring as Test now. Are you suggesting that change too?

@elyezer
Copy link
Collaborator

elyezer commented Jul 21, 2016

Short answer, yes.

Long answer, Testimony currently does use the first line as test, but a new option should be added to it since one may not pass the test as being a valid token, currently it will be bypassed and the test token will be created.

@elyezer
Copy link
Collaborator

elyezer commented Jul 21, 2016

I've opened SatelliteQE/testimony#118 to fix on testimony and then bring to Betelgeuse

@elyezer elyezer changed the title Using the @Test token for polarion test case title Using the @title token for polarion test case title Jul 27, 2016
@elyezer elyezer added this to the 0.5.0 milestone Jul 27, 2016
@elyezer
Copy link
Collaborator

elyezer commented Jul 27, 2016

In order to follow all other token definitions Betelgeuse should support a @title token and fill the title if that token is present on the docstring or use the function/method name.

elyezer pushed a commit that referenced this issue Jul 27, 2016
Use the value of `@title` token for the test case title when it is defined on
the docstring, otherwise continue using the function/method name.

Close #65
@spoore1
Copy link
Contributor Author

spoore1 commented Jul 28, 2016

Thanks guys!

@elyezer
Copy link
Collaborator

elyezer commented Aug 1, 2016

@spoore1 thank you for the feature request, it is good to have control over the title.

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

3 participants