Skip to main content

Playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.

🚀 Usage​

Add the following command to your CI configuration file:

fluentci run --wasm playwright install
fluentci run --wasm playwright test

Commands​

NameDescription
installensure browsers necessary for this version of Playwright are installed
install_depsinstall dependencies necessary to run browsers (will ask for sudo permissions)
screenshotcapture a page screenshot
pdfsave page as pdf
testrun tests with Playwright Test
helpdisplay help for Playwright commands
versiondisplay version of Playwright

Code examples​

Add fluentci-pdk crate to your Cargo.toml:

[dependencies]
fluentci-pdk = "0.2.1"

Use the following code to call a module function:

use fluentci_pdk::dag;

// ...

dag().call(
"https://pkg.fluentci.io/[email protected]?wasm=1",
"install",
vec![],
);

dag().call(
"https://pkg.fluentci.io/[email protected]?wasm=1",
"test",
vec![],
);

CI/CD pipeline integrations​

The following examples show how to integrate FluentCI with popular CI providers to run Playwright tests:

ci.yml
name: ci
on:
push:
branches:
- main
jobs:
tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: playwright
args: |
install
- name: Run playwright tests
run: |
fluentci run --wasm playwright install
fluentci run --wasm playwright test