Playwright Test Runner avatar
Playwright Test Runner
Try for free

No credit card required

View all Actors
Playwright Test Runner

Playwright Test Runner
Try for free

No credit card required

Run Playwright tests across numerous browser configurations with Apify. Create your tests in seconds and get comprehensive test reports faster than ever.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode




1from apify_client import ApifyClient
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
6# Prepare the Actor input
7run_input = { "testCode": """import { test, expect } from '@playwright/test';    
8    test('has title', async ({ page }) => {      
9      await page.goto('');
10      // Expect a title \"to contain\" a substring.
11      await expect(page).toHaveTitle(/Playwright/);    
12    });
13    test('get started link', async ({ page }) => {
14        await page.goto('');
15        // Click the get started link.
16        await page.getByRole('link', { name: 'Get started' }).click();
17        // Expects the URL to contain intro. 
18        await expect(page).toHaveURL(/.*intro/);    
19    });""" }
21# Run the Actor and wait for it to finish
22run ="").call(run_input=run_input)
24# Fetch and print Actor results from the run's dataset (if there are any)
25for item in client.dataset(run["defaultDatasetId"]).iterate_items():
26    print(item)
Maintained by Community
Actor metrics
  • 2 monthly users
  • 100.0% runs succeeded
  • 0.0 days response time
  • Created in Feb 2023
  • Modified about 1 year ago