-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4acb54
commit 18a1be1
Showing
1 changed file
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
//add specific modules required | ||
const {test, expect} = require('@playwright/test') | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
test ('Visit Site', async ({page}) => { | ||
//visit DemoBlaze | ||
await page.goto('https://www.demoblaze.com/index.html') | ||
//Check Site Title | ||
await expect(page).toHaveTitle('demoblaze') | ||
}) | ||
// async keyword waits for the page to load and run steps sequentailly which is necesary | ||
//for testing | ||
test('visit site', async ({ page }) => { | ||
await page.goto('https://www.demoblaze.com'); | ||
|
||
// Expect a title "to contain" a substring. | ||
await expect(page).toHaveTitle(/blaze/); | ||
}); | ||
|
||
test('view cart', async ({ page }) => { | ||
await page.goto('https://www.demoblaze.com'); | ||
|
||
// Click the get started link. | ||
await page.getByRole('link',{name:'Cart'}).click(); | ||
|
||
// Expects the URL to contain intro. | ||
await expect(page).toHaveURL(/.*cart/); | ||
}); |