-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shared-steps unable to find page instance #91
Comments
I think this is an issue with timing of The docs and examples need to be updated, since the currently recommended pattern can be problematic. Implementing #61 would be ideal, I suppose. for (const browserType of BrowserTypes) {
defineFeature(feature, (test) => {
const scenarioContext = {};
beforeAll(async () => {
scenarioContext.browser = await playwright[browserType].launch({ headless: false }).catch((log: any) => console.log(log));
scenarioContext.page = await browser.newPage().catch((log: any) => console.log(log));
});
afterAll(() => {
// scenarioContext.browser.close().catch((log: any) => console.log(log))
});
afterEach(async () => {
// await scenarioContext.page.waitFor(3000)
});
beforeEach(async () => {
await scenarioContext.page.goto('xxxx.com/', {
waitUntil: 'networkidle0',
});
});
test('I can try common steps', async ({ given }) => {
landing_page(given, scenarioContext);
});
});
} |
unable to identify the step_definition from shared file, calling the function in steps file @bencompton |
@bencompton , tried the above example, didn't work. Any update or insight on this please ? |
@lakshmanp21 you should check out cucumber-jest. it's a transformer for jest that allows you to use the cucumber api with jest. Because it's using the cucumber js api, it supports declaring step definitions once and they can be used in any feature file. |
I am using cucumber-jest as suggested, though the issue (above) exists |
The text was updated successfully, but these errors were encountered: