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

Cannot import "And" Cucumber keyword, getting erro (0 , import_cypress_cucumber_preprocessor.And) is not a function #839

Closed
3 tasks done
FatmaHameed opened this issue Sep 22, 2022 · 4 comments

Comments

@FatmaHameed
Copy link

FatmaHameed commented Sep 22, 2022

Current behavior

When imported "And" using import { Given, When, And, Then } from '@badeball/cypress-cucumber-preprocessor', the Cypress test stopped with TypeError: import_cypress_cucumber_preprocessor.And) is not a function.

Desired behavior

I want to be able to import and use "And" keyword.

I have solved this issue currently by uninstalling the latest version of @badeball/cypress-cucumber-preprocessor, and then installing a previous version (11.4.0) as this version worked fine with "And" keyword

Test code to reproduce

import { Given, When, And, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('I visit {string}', (url) => {
  cy.visit(url);
});

When('I click on register link', () => {
  home.clickRegisterLink();
});

And('I type', (datatable) => {
  datatable.hashes().forEach((data) => {
    register.typeFirstName(data.firstname);
    register.typeLastName(data.lastname);
    register.typeUsername(data.username);
    register.typePassword(data.password);
  });
});

Versions

  • **Cypress version10.8.0:
  • **Preprocessor version13.0.1:
  • **Node.js version14.4.0:
  • **Node-semver version1.0.0:

Checklist

  • I've read the FAQ.
  • I've read Instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

These has been deprecated and removed in v13.0.0, ref. #821. TLDR: use Given, When or Then.

JoanEsquivel pushed a commit to JoanEsquivel/cypress-cucumber-boilerplate that referenced this issue Sep 23, 2022
@nursulnbc
Copy link

These has been deprecated and removed in v13.0.0, ref. #821. TLDR: use Given, When or Then.

Why deprecated? Let's bring it back

@shieldsi
Copy link

shieldsi commented Sep 8, 2023

Are the any plans to bring the And keyword back?

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

No branches or pull requests

4 participants