Skip to content

Commit

Permalink
added faker js
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpreetj committed Jul 30, 2022
1 parent 76b2447 commit 58e6d29
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
17 changes: 17 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 @@ -8,6 +8,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@faker-js/faker": "^7.3.0",
"@playwright/test": "^1.22.2",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
Expand Down
3 changes: 2 additions & 1 deletion tests/contact.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test, expect } from '@playwright/test';
import ContactPage from '../pages/contact.page';
import { faker } from '@faker-js/faker';

test.describe('Contact', () => {
let contactPage: ContactPage;
Expand All @@ -11,7 +12,7 @@ test.describe('Contact', () => {
await contactPage.navigate()

// fill out the input fields and submit
await contactPage.submitForm('test name', '[email protected]', '123789123', 'Hello! this is taking advantage of POM');
await contactPage.submitForm(faker.name.findName(), faker.internet.email(), faker.phone.number(), faker.lorem.paragraphs(2));

// verify success message
await expect(contactPage.successTxt).toHaveText('Thanks for contacting us! We will be in touch with you shortly')
Expand Down

0 comments on commit 58e6d29

Please sign in to comment.