Hello, could you let me know how can I use the class objects created in fixtures in Hooks?? Scenario would be i want to execute a method from login page object created in fixtures into before hooks for the scenario contains tag xyz
Hi you can implement same logic like import base test inside hooks and and access it with fixture something like this import { chromium, firefox } from '@playwright/test'; import { createBdd } from 'playwright-bdd'; import { test } from '../fixtures/fixture'; const { Before, After, BeforeAll, AfterAll, } = createBdd(test); Before(async({page, ecomLoginPage})=>{ // await page.goto('ecommerce-playground.lambdatest.io/') await ecomLoginPage.navigateToUrl('ecommerce-playground.lambdatest.io/') }); After(async()=>{ console.log("This is a After.") }); BeforeAll(async({browser})=>{ const page = firefox.launch(); }); AfterAll(async()=>{ console.log("This is a AfterAll.") });
Hi Sunny can invoke your page like this way Before(async({page})=>{ await page.goto('ecommerce-playground.lambdatest.io/') }); it should work, there is still some work need to be done for hooks
great set of videos and knowledge, thank you so much. For the next session can you please focus on deckerazation and gitlab integration
Please provide the next lecture with before all..
When you add the next video can you please cover how to use Storage State in BeforeAll hook
Hi, will you please explain how to use 'Fekers' to generate the random data instead of hot coding and some of the utils if possible?
Hi your videos are so helpful guess you have missed reporting part how to generate cucumber- html - reporter
Please post the next video
Your tutorials are very helpful. can you make tutorials in API testing in playwright BDD as well
Hi, your tutorial is very helpful. Can we achieve test.only and test.skip through BDD?
Yes you can please review this video here ua-cam.com/video/X_GHi4SEqWA/v-deo.htmlsi=xbkJHBCQ7aY8FKcW
Hello, could you let me know how can I use the class objects created in fixtures in Hooks?? Scenario would be i want to execute a method from login page object created in fixtures into before hooks for the scenario contains tag xyz
Hi you can implement same logic like import base test inside hooks and and access it with fixture something like this
import { chromium, firefox } from '@playwright/test';
import { createBdd } from 'playwright-bdd';
import { test } from '../fixtures/fixture';
const { Before, After, BeforeAll, AfterAll, } = createBdd(test);
Before(async({page, ecomLoginPage})=>{
// await page.goto('ecommerce-playground.lambdatest.io/')
await ecomLoginPage.navigateToUrl('ecommerce-playground.lambdatest.io/')
});
After(async()=>{
console.log("This is a After.")
});
BeforeAll(async({browser})=>{
const page = firefox.launch();
});
AfterAll(async()=>{
console.log("This is a AfterAll.")
});
Hi i am not able to use beforeAll hooks..and facing this issue "worker fixture can not depend on a test fixture. How to resolve..kindly help
Hi Sunny can invoke your page like this way Before(async({page})=>{
await page.goto('ecommerce-playground.lambdatest.io/')
}); it should work, there is still some work need to be done for hooks