TestWise v7.1 Adds Playwright-Test in its Sample Project
Get started with writing and running Playwright tests from scratch in TestWise
If you have been following my updates, you might know that my father and I recently published a new book: Web Test Automation in Action.
I authored the Playwright sections.
The newly-released TestWise v7.1 now includes a few Playwright Test examples in its ‘demo-webapp’ test project. The sample project now contains test scripts for the following test automation frameworks:
Selenium WebDriver + RSpec (Ruby)
Selenium WebDriver + Mocha (JavaScript)
Selenium WebDriver + Pytest (Python)
Selenium WebDriver + Cucumber (Ruby)
Playwright Test (TypeScript)
Install/Update TestWise.
I will walkthrough how to update TestWise’s macOS silicon version, but it works similarly for Windows.
Download the dmg file and drag the app to “Applications”.
2. Open the “Sample Project (web app”).
3. Try to run one “*.spec.ts” test under playwright-test
folder.
Expand the playwright-test
folder, open any spec.ts
under the tests
folder. Run it.
You will get an error. Why? The dependent node packages, e.g. @playwright/test
was not there.
4. Run the npm_install.sh
under the folder, directly in TestWise.
Right-click the npm_install.sh
, and select “Run”.
If you check the folder (from a terminal), you will see the node_modules
folder was created.
5. Run one test (again). This time, works!
The above works on my M4 Mac Mini.
Troubleshooting
When I retried the above on my MacBook Intel, I got an interesting error: “unable to create ‘test-results’ directory”. I even tried to pre-create test-results
directory first, but the Playwright execution process deleted the folder and reported that it “failed to create it”.
Anyway, running sample tests within the app (/Applications/TestWise.app/Contents/Resources/demo-webapp
) might not be a good idea. The workaround is to copy demo-webapp
to new folder where you do have permissions (e.g. ~/tmp
) and run from there.
Also, if you can execute Playwright tests from command line, but not in TestWise, this usually means the execution path setting is not correct.
In my case,