Skip to content

Commit

Permalink
added real Playwright test code
Browse files Browse the repository at this point in the history
  • Loading branch information
mangs committed Jan 5, 2024
1 parent 611789f commit c4b27e1
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"eslint-plugin-unicorn": "49.0.0"
},
"devDependencies": {
"@playwright/test": "1.40.1",
"@types/node": "20.10.6",
"eslint": "8.56.0",
"jest": "29.7.0",
Expand Down
2 changes: 2 additions & 0 deletions test/eslintNodeConfig/exampleNodeConfigEntrypoint.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code adapted from here: https://nodejs.org/en/learn/getting-started/introduction-to-nodejs#an-example-nodejs-application

// External Imports
import http from 'node:http';

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
console.log('playwright');
// Code adapted from here: https://playwright.dev/docs/writing-tests#first-test

// External Imports
import { expect, test } from '@playwright/test';

// Test Definitions
test.describe('Playwright homepage', () => {
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();

// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
});

0 comments on commit c4b27e1

Please sign in to comment.