Skip to content

Commit

Permalink
demoblaze view cart
Browse files Browse the repository at this point in the history
  • Loading branch information
PeaceGusenga committed May 1, 2023
1 parent f4acb54 commit 18a1be1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions tests/ProjectBlaze/Test1.spec.js
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/);
});

0 comments on commit 18a1be1

Please sign in to comment.