1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "testCode": """import { test, expect } from '@playwright/test';
9 test('has title', async ({ page }) => {
10 await page.goto('https://playwright.dev/');
11 // Expect a title \"to contain\" a substring.
12 await expect(page).toHaveTitle(/Playwright/);
13 });
14 test('get started link', async ({ page }) => {
15 await page.goto('https://playwright.dev/');
16 // Click the get started link.
17 await page.getByRole('link', { name: 'Get started' }).click();
18 // Expects the URL to contain intro.
19 await expect(page).toHaveURL(/.*intro/);
20 });""" }
21
22
23run = client.actor("jindrich.bar/playwright-test").call(run_input=run_input)
24
25
26print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
27for item in client.dataset(run["defaultDatasetId"]).iterate_items():
28 print(item)
29
30