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

feat: add support for custom step timeout #385

Merged
merged 1 commit into from
Jun 1, 2020
Merged

Conversation

lukebjerring
Copy link
Contributor

Add support for passing in a config param, matching the signature of cucumber-js, to set the step
timeout in cypress.

e.g.

Given('a long running step', { timeout: 60000 }, () => { ... });

It is possible to do this by calling cy.then({timeout: 60000}, () => {...}) inside the implementation function, but that's inconsistent with the signature for cucumberjs, which feels more intuitive.

Add support for passing in a config param, matching the signature of cucumber-js, to set the step
timeout in cypress.
@lgandecki
Copy link
Collaborator

Looks good, thanks!

@lgandecki
Copy link
Collaborator

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@donaldpipowitch
Copy link

It looks like this MR broke TypeScript for us at this line:

https:/TheBrainFamily/cypress-cucumber-preprocessor/pull/385/files#diff-c3cd9d7865893aca768bfb5cecbcfd9bR50

export function defineParameterType(): void;

Is the change in the MR correct? Because we use the following snippet in our code:

import { defineParameterType } from 'cypress-cucumber-preprocessor/steps';
import * as faker from 'faker';

defineParameterType({
  name: 'faker',
  regexp: /.*/,
  transformer(s) {
    return faker.fake(s).replace(/^"|"$/g, '');
  },
});

(As you can see defineParameterType takes 1 argument here.)

@lgandecki
Copy link
Collaborator

sorry, you are definitely right. I wonder if it makes sense to keep some of the types here since the types are available here: https:/DefinitelyTyped/DefinitelyTyped/blob/master/types/cypress-cucumber-preprocessor/steps/index.d.ts ?
I'm trying to decide between fixing the types here, or deleting them altogether. Having two sources of truths bothers me though.

@donaldpipowitch
Copy link

Thank you for the fast response and trying to solve this.

@lgandecki
Copy link
Collaborator

do you have any opinion about the way to move forward with this problem? :)

@donaldpipowitch
Copy link

My personal preference would be:

  1. Have all types inside cypress-cucumber-preprocessor.
  2. Have all types inside @types/cypress-cucumber-preprocessor.
    ....
  3. Have a mix :)

@lgandecki
Copy link
Collaborator

For now I've updated the types inside the cypress-cucumber-preprocessor, as per your preference. ;-)
Thanks for the report here and sorry it took a bit. Trying to dig out from my busy todolist..

@donaldpipowitch
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants