cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.01k stars 1.09k forks source link

Where and how do you set Global expect timeout in cucumber-js runner ? #2355

Closed samplehub closed 7 months ago

samplehub commented 7 months ago

Hello ,

According to Playwright documentation , expect timeout can be changed or set globally in config file as below.

import { defineConfig } from '@playwright/test';

export default defineConfig({ expect: { timeout: 10 * 1000, }, });

But when using cucumber-js runner , playwright.config.ts wont be initiated and doesn't impact the timeout.

Could any one please let me know where and how to set the global expect timeout in Cucumber-js runner or hooks file?? Thanks

davidjgoss commented 7 months ago

You can set timeouts globally or for individual hooks and steps per https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/timeouts.md.

This will apply to your whole hook or step. Cucumber has no awareness of what you're doing inside of those steps e.g. calls to Playwright Test or similar - any timeouts for those specifically would need to be dealt with as part of those libraries.