question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow Overriding the Test Name

See original GitHub issue

Description

It would be very handy if we could control the TestName so we could create nice human-readable test names that show up in the test explorer.

Test frameworks like Mocha support this 😊. One example.

Reference: SO Post

Expected behavior

[TestMethod("My user friendly test name with special characters like | or * or \\ etc.")]
public void MyTest()
{
    ...
}

or

[TestMethod()]
[TestName("My user friendly test name with special characters like | or * or \\ etc.")]
public void MyTest()
{
    ...
}

Actual behavior

The method name is the test name 😪.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:18 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
nohwndcommented, Aug 26, 2020

@mdpopescu was fixed in #715

1reaction
mdpopescucommented, Jul 19, 2020

Nice, I just discovered this!

One observation: the parameter description on the constructor here is incorrect:

/// <param name="displayName">Message specifies reason for ignoring.</param>
public TestMethodAttribute(string displayName)

It was probably copied from Ignore and hasn’t been changed correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I override the test method name that appears on ...
I suspect the answer lies in writing a TestListenerAdapter that somehow overrides the ITestResult.getTestNameMethod() method? That is the holy ...
Read more >
Can somebody give me simple example to override test ...
Basically, in the @BeforeMethod, pass a Object[] that contains the test name and then apply the name change within that before method. Haven't ......
Read more >
The BeanDefinitionOverrideException in Spring Boot
The main purpose is to notice the duplicate bean names in advance to prevent overriding beans accidentally. Therefore, if our Spring Boot ...
Read more >
Guide to Overriding Spring Boot Properties for Testing
With this blog post, we'll explore the various mechanisms for developers to override properties when testing their Spring Boot applications.
Read more >
Override Spring Boot Configuration Properties For Tests
Learn about several approaches to override your Spring Boot configuration properties (@Value) when writing tests for your application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found