diff --git a/examples/todos/add-remove.journey.ts b/examples/todos/advanced.journey.ts similarity index 85% rename from examples/todos/add-remove.journey.ts rename to examples/todos/advanced.journey.ts index bb80e031..213dac19 100644 --- a/examples/todos/add-remove.journey.ts +++ b/examples/todos/advanced.journey.ts @@ -7,7 +7,7 @@ import { destroyTaskStep, } from './helpers'; -journey('basic addition and completion of single task', async ({ page }) => { +journey('addition and completion of single task', async ({ page }) => { const testText = "Don't put salt in your eyes"; loadAppStep(page); @@ -18,7 +18,7 @@ journey('basic addition and completion of single task', async ({ page }) => { assertTaskListSizeStep(page, 0); }); -journey('adding and removing a few tasks', async ({ page }) => { +journey('adding and removing multiple tasks', async ({ page }) => { const testTasks = ['Task 1', 'Task 2', 'Task 3']; loadAppStep(page); diff --git a/examples/todos/basics.journey.ts b/examples/todos/basic.journey.ts similarity index 67% rename from examples/todos/basics.journey.ts rename to examples/todos/basic.journey.ts index 22aa3ef2..c24fdff2 100644 --- a/examples/todos/basics.journey.ts +++ b/examples/todos/basic.journey.ts @@ -2,25 +2,25 @@ import { journey, step } from '@elastic/synthetics'; import { deepStrictEqual } from 'assert'; import { join } from 'path'; -journey('check that title is present', async ({ page }) => { - step('go to app', async () => { +journey('check if title is present', async ({ page }) => { + step('launch app', async () => { const path = 'file://' + join(__dirname, 'app', 'index.html'); await page.goto(path); }); - step('check title is present', async () => { + step('assert title', async () => { const header = await page.$('h1'); deepStrictEqual(await header.textContent(), 'todos'); }); }); -journey('check that input placeholder is correct', async ({ page }) => { - step('go to app', async () => { +journey('check if input placeholder is correct', async ({ page }) => { + step('launch app', async () => { const path = 'file://' + join(__dirname, 'app', 'index.html'); await page.goto(path); }); - step('check title is present', async () => { + step('assert placeholder value', async () => { const input = await page.$('input.new-todo'); deepStrictEqual( await input.getAttribute('placeholder'), diff --git a/examples/todos/helpers.ts b/examples/todos/helpers.ts index bb69aedd..b86ed1cd 100644 --- a/examples/todos/helpers.ts +++ b/examples/todos/helpers.ts @@ -1,10 +1,9 @@ -import { step } from '@elastic/synthetics'; +import { step, Page } from '@elastic/synthetics'; import * as assert from 'assert'; import { join } from 'path'; -import { Page } from 'playwright-core'; export const loadAppStep = (page: Page) => { - step('go to app', async () => { + step('launch app', async () => { const path = 'file://' + join(__dirname, 'app', 'index.html'); await page.goto(path); }); diff --git a/examples/todos/package.json b/examples/todos/package.json index 4de5c6a1..0ba404d0 100644 --- a/examples/todos/package.json +++ b/examples/todos/package.json @@ -5,7 +5,6 @@ "scripts": {}, "license": "MIT", "dependencies": { - "@elastic/synthetics": "*", - "playwright-core": "=1.6.2" + "@elastic/synthetics": "file:../../" } } diff --git a/src/index.ts b/src/index.ts index b44d5d2f..b5037e4b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,3 +55,13 @@ export async function run(options: RunOptions) { } export { beforeAll, afterAll, journey, step, before, after } from './core'; +/** + * Export all the driver related types to be consumed + * and used by suites + */ +export type { + Page, + ChromiumBrowser, + ChromiumBrowserContext, + CDPSession, +} from 'playwright-chromium';