-
Playwright
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
My project this time was to see if there's a better way for us to do automated browser testing of our Mojolicious web applications. For a long time Selenium has been the de facto standard for browser automation, but these days there are more modern alternatives available, such as Playwright. But how good is Playwright really? Spoiler: It's very good. But keep reading to find out why and at what cost.
And if you've made it this far i've got something special for you, i've prepared a repo on Github with a WebSocket chat application and mixed JavaScript/Perl tests you can use for experiments. It also has a solution for how to set up test fixtures with wrapper scripts. Have fun!
The code is being developed by Microsoft as an Open Source project with Apache-2.0 license and distributed as an NPM package. So all you need is Node, and you can install it with a one-liner.
const assert = require('assert'); const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch({ headless: false, slowMo: 50 }); const context = await browser.newContext(); const page = await context.newPage(); await page.goto('https://mojolicious.org/'); await page.click('text=Documentation'); await page.click('text=Tutorial'); assert.equal(page.url(), 'https://docs.mojolicious.org/Mojolicious/Guides/Tutorial'); await page.screenshot({ path: 'tutorial.png' }); await context.close(); await browser.close(); })();