5 ms·
For those of you wondering at home: Playwright for .NET is the official language port of Playwright, a Node.js based library to automate Chromium, Firefox and
by jbgreer 5y ago
For those of you wondering at home:
Playwright for .NET is the official language port of Playwright, a Node.js based library to automate Chromium, Firefox and WebKit with a single API.
- Scarbutt 5y agoStill requires nodejs though, it is more a wrapper than a port.
- inglor 5y agoIt's not really a wrapper - it's a client in client/server architecture - the difference is important because it means that .NET is a first-class citizen here (like selenium and unlike tools like puppeteer-sharp) and that updates propagate to all languages automatically. The downside is indeed that you need a "server running".
- Scarbutt 5y agoNice, just saw there is an official Java and Python version too.
- dustinmoris 5y agoSo what's the point of it then? Why add more layers of unnecessary abstraction? Why don't just use the node.js library then?
- AlfeG 5y agoBecause for some teams it's easier to write tests in plain C# with NUnit/xUnit libs.
- dustinmoris 5y agoBut why? Why shoehorn everything into a single technology? Is it so that certain people never have to learn anything else in their entire life anymore?
- deleted 5y ago[deleted]
- ithrow 5y agoProjects written in java/c#/python don't have to write their own ad-hoc http api in nodejs to access playwright from their language.
- GordonS 5y agoWell, a pretty good reason is that C# is statically typed, which a lot of developers prefer. It's arguably a much more powerful language than JavaScript too. Personally, I work with both C# and JavaScript, and I'd happily use the C# version of Playwright to write and run UI tests.
- a1sabau 5y agoTypescript adds static type definitions to javascript. Microsoft's own VSCode is written in typescript. Being able to gradually move from one to another as you augment your existing code with type definitions makes it easier to integrate typescript in existing projects.
- ithrow 5y agoWell, a pretty good reason is that C# is statically typed, which a lot of developers prefer. Don't know, everyday I see more and more C# devs preferring Typescript for new projects.
- AlfeG 5y agoSo there is some people that move backend apps from C# to Typescript? really?
- GordonS 5y agoFor the frontend of a SPA, sure, I prefer Typescript over JavaScript for that kind of thing. But for the backend (APIs, services, whatever), I'd personally still go with C# any day - it really is a wonderful language, and the available tooling is fantastic.
- losvedir 5y agoMight be easier to set up the backend before testing the front end. You could use your existing models and code to create data in the DB for instance, and then use the web browser to test that things are working. What's the alternative? Prepare the backend via exclusive frontend operations? That has its own issues like possibly being impossible (e.g. maybe making an admin isn't exposed to the webapp) or being slow, or not being able to create data in a "legacy" state that the current frontend can't do. Or maybe use C# to create and teardown the data, but then call out to a nodejs process in the middle of the test? I am legitimately curious how you would test a C# app exclusively from nodejs.
- Xen0byte 5y agoI put that in the original title, but I think it got edited out by a mod. :)