Comments (7)
The solution to this is the following:
public class XUnitLogger : AbstractLogger
{
private readonly ITestOutputHelper output;
public XUnitLogger(ITestOutputHelper output, LogSeverity severity = LogSeverity.Trace)
:base(severity)
{
this.output = output;
}
public override void Close()
{
// This logger needs no closing
}
protected override void LogRaw(string message, LogSeverity severity = LogSeverity.Info)
{
if(severity >= LowestSeverity)
output.WriteLine(message);
}
}
public class MyTest
{
private readonly ITestOutputHelper output;
public MyTest(ITestOutputHelper output)
{
this.output = output;
}
[Fact]
public void EditIcon_ShouldPutRowInEditMode()
{
var test = new Actor("Customer", new XUnitLogger(output));
}
}
Given the recent architecture changes, where should I place this? At first I considered placing this under Boa.Constrictor.Screenplay
however it would require adding an xUnit dependency. Would it be more appropriate to start a Boa.Constrictor.xUnit
project?
from boa-constrictor.
@thePantz feel free to fork the repository, get working, and send a pull request!
from boa-constrictor.
@thePantz, this is good stuff. You're absolutely right about the dependency issue. I think I agree with your assessment that we'd want a separate project and package for xUnit to support this.
My questions for you:
- Is this something you'd want to do?
- Do you want this to be part of the main Boa Constrictor repository?
I'd love to collaborate with you on this if you're up for the challenge!
from boa-constrictor.
Yes! I would be happy to contribute! I figure it's a general enough use case that will be useful to others.
Although, I noticed #20 the other day and was wondering if this is still valuable or if it will soon be obsolete
from boa-constrictor.
#20 is still valid but not planned at the moment. I'd say move forward with this xUnit logger for now. We can change things in the future.
from boa-constrictor.
(I'm here to answer questions and offer help along the way if you need it, too!)
from boa-constrictor.
This work was completed as part of #248 !
from boa-constrictor.
Related Issues (20)
- [FEATURE]: Resolve warning CS0618: 'IWebElement.GetProperty(string)' is obsolete: 'Use the GetDomProperty method instead.'
- [FEATURE]: Publish .snupkg alongside .nupkg HOT 1
- [FEATURE]: A function which only searches for displayed elements HOT 6
- [FEATURE]: Update Boa Constrictor to target .NET 7
- [QUESTION]: HOT 7
- [DOCS]: Create separate READMEs for each NuGet package
- [DOCS]: Add Sarah's Screenplay talk to the videos page
- [FEATURE]: Playwright HOT 3
- [FEATURE]: Marker interfaces HOT 3
- [FEATURE]: Use a WebDriver that's not Selenium HOT 4
- [FEATURE]: Move request dumping methods to AbstractRestSharpAbility HOT 1
- [FEATURE]: HOT 1
- Questions written to the `Actor` log do not include the `Actor` prefix. HOT 1
- As a developer, `attempts to` should be logged as `Trace`, so that the Screenplay log can be easily filtered. HOT 2
- [FEATURE]: TestLogger additional argument to add key value pair properties to Test Log json output HOT 1
- [FEATURE]: Improvements to RestSharp dumping HOT 1
- [FEATURE]: Add support for RestAssured.Net HOT 7
- [QUESTION]: Design-first approach with Screenplay pattern HOT 1
- [FEATURE]: Improve xUnit Logging capabilities HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boa-constrictor.