Skip to content
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

[WIP] Improved passing step options #4733

Open
wants to merge 4 commits into
base: 3.x
Choose a base branch
from
Open

[WIP] Improved passing step options #4733

wants to merge 4 commits into from

Conversation

DavertMik
Copy link
Contributor

@DavertMik DavertMik commented Jan 10, 2025

This PR should improve how we pass step options from test

There will be a userland function to pass options to steps:

const { stepConfig } = require('codeceptjs/effects');

not sure of name, maybe stepOpts, or whatever

-I.limitTime(5).click('Link')
+I.click('Link', stepConfig().timeout(5))
-I.retry(5).click('Link')
+I.click('Link', stepConfig().retry(5))

Also it can be used to pass additional options into helper:

I.see('sign in', stepConfig({ ignoreCase: true }));

Alternative syntax:

const { step } = require('codecepts/effects')

I.click('Link', step.retry(5))
I.click('Link', step.timeout(5))
I.see('sign in', step.opts({ ignoreCase: true }));

@DavertMik DavertMik requested a review from kobenguyent January 10, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants