I am used to using Typescript with Playwright. But my Team always ask if I can write my tests in C#. So my questions are:
Is Playwright C# worth using?
Do you have full functionality as with Typescript?
Are there any benefits over Typescript?
I am used to using Typescript with Playwright. But my Team always ask if I can write my tests in C#. So my questions are:
Is Playwright C# worth using?
Do you have full functionality as with Typescript?
Are there any benefits over Typescript?
I have used both.
The decision to do so was nearly entirely down to what the developers were using and the skills of other QAs who’d be contributing.
In terms of Playwright C# - I’ve found it has practically all of the same features as the Typescript version.
I wouldn’t say there’s any benefits if you only look at Playwright itself. It was maybe a bit slower on the C# side versus Typescript. But the benefits come down to better harmony with the rest of the team.
Thank you @moorpheus, that’s what I thought, but it’s hard to find a lot of info on it.
the other debate I have is my team use mstest, but I am used to nunit. Playwright recommends nunit over mstest. do you know if there is much difference between the 2? and should I be arguing to use the recommended?
I can’t answer that one I’m afraid. Like you, I’m used to nunit and that’s what we used on the Playwright C# work.
The official docs are good for Playwright C# - Installation | Playwright .NET
It’s just a programming language.
So are there any benefits over Typescript? I think your team is asking you to write it in C# because they develop and understand C#. The biggest benefit that you can have here is that your team will actually support you doing this. They’ll have the ability to aid you in your journey through test automation.
My question would be: Why did you start in Typescript when your team works in C#?
Who knows, maybe the devs will write and edit your tests also
You cannot have a better environment then that!
As Moorpheus said, there isn’t much of a difference.
Thanks @kristof, I have only ever used Typescript or JavaScript for UI testing. Mainly because when I have been in test teams that’s how it was done even though the applications were written in C#. the reasoning was always that’s what you should use for UI testing.
I’m pretty flexible with stuff like this, so if using C# is more beneficial for the devs in my team then I’m happy to do it. I just didn’t know if there were any trade-offs in using C# over Typescript. but as both you and moorpheus have said it doesn’t seem like there is.
Out of curiosity, is C# the language the product is written in too? Some added benefits you might find: more participation in code review and improved mocking and typing.
Participating in code reviews really helped me catch things early and correct logic issues before tickets even got to me and reading dev code improved my understanding of the language. Additionally, when my devs started using similar testing tools, they were more inclined to follow better mocking practices that the automation engineers could utilize for their own tests.