Skip to content

Commit 0f89cd4

Browse files
improve assertions
1 parent a0da632 commit 0f89cd4

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

tests/example.spec.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,42 @@ test.only('Purshace article', async ({ page }) => {
1919

2020
await ai('click continue button', { page, test })
2121
await ai('finish purchase', { page, test })
22-
const element = await page.locator('.checkout_complete_container')
23-
expect(element).toBeVisible()
22+
var statusPurchase = await ai('the purchase was successful?', { page, test })
23+
console.log(statusPurchase)
24+
expect(statusPurchase).toEqual(true)
2425

2526
await page.pause()
2627

2728
});
2829

30+
test('Purshace article not complete info', async ({ page }) => {
31+
await ai('go to this page https://www.saucedemo.com/', { page, test })
32+
await ai('insert username as standard_user', { page, test })
33+
await ai('insert password as secret_sauce in the password field', { page, test })
34+
await ai('click buton login', { page, test })
35+
await ai('add to the cart the 2 articles', { page, test })
36+
await page.pause()
37+
38+
await ai('go to te cart', { page, test })
39+
await ai('checkout purchase', { page, test })
40+
await ai('fill form with real information', { page, test })
41+
await page.pause()
42+
43+
var statusPurchase = await ai('the purchase was successful?', { page, test })
44+
console.log(statusPurchase)
45+
expect(statusPurchase).toEqual(true)
46+
47+
await page.pause()
48+
49+
});
50+
51+
test('Spanish login', async ({ page }) => {
52+
await ai('visita la pagina https://www.saucedemo.com/', { page, test })
53+
await ai('inserta username standard_user', { page, test })
54+
await ai('inserta password secret_sauce in the password field', { page, test })
55+
await ai('clic en el boton login', { page, test })
56+
await ai('agrega dos articulos', { page, test })
57+
await page.pause()
58+
59+
});
2960

0 commit comments

Comments
 (0)