diff --git a/tests/ProjectBlaze/Test1.spec.js b/tests/ProjectBlaze/Test1.spec.js index 16191b2..8a5bcf1 100644 --- a/tests/ProjectBlaze/Test1.spec.js +++ b/tests/ProjectBlaze/Test1.spec.js @@ -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') -}) \ No newline at end of file +// 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/); + }); \ No newline at end of file