Skip to content

Commit

Permalink
[playwright] feat: Page object examples
Browse files Browse the repository at this point in the history
  • Loading branch information
helloitsdave committed May 11, 2024
1 parent 5572ae8 commit 4c15d82
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions playwright/tests/note.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { test, expect, Page } from '@playwright/test';
import { faker } from '@faker-js/faker';
import LoginPage from '../pages/LoginPage';
import NotesPage from '../pages/NotesPage';

const TIMESTAMP = Date.now();
const NOTE_TITLE = `My note ${TIMESTAMP}`;
const NOTE_CONTENT = `My note content ${TIMESTAMP}`;
const EDITED_NOTE_TITLE = `Edited note ${TIMESTAMP}`;
const EDITED_NOTE_CONTENT = `Edited note content ${TIMESTAMP}`;

let page: Page;
let loginPage: LoginPage;
let notesPage: NotesPage;

const timeout = 60 * 1000;
const NOTE_TITLE = faker.lorem.sentence();
const NOTE_CONTENT = faker.lorem.lines({ min: 1, max: 5 });
const EDITED_NOTE_TITLE = faker.lorem.sentence();
const EDITED_NOTE_CONTENT = faker.lorem.lines({ min: 1, max: 5 });

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
Expand Down

0 comments on commit 4c15d82

Please sign in to comment.