Comments (2)
Hello @stevepkuo , thanks for reporting!
But this is a bit weird... I just tried in the current version and it worked..
If you could try with the newest version (0.6.0 ) that would be great, maybe I messed up the versions.
But if the problem still persists - could you make a simple reproduction?
I've tried:
let dataToBeLoaded;
let differentDataToBeLoaded;
given("I require a file", () => {
dataToBeLoaded = require("./requiringFilesData");
});
given("I require a different file", () => {
differentDataToBeLoaded = require("./requiringDifferentFilesData");
});
then("I can access theirs data", () => {
expect(dataToBeLoaded.IAmImported).to.equal(true);
expect(differentDataToBeLoaded.IAmAlsoImported).to.equal(true);
});
and also
const dataToBeLoaded = require("./requiringFilesData");
const differentDataToBeLoaded = require("./requiringDifferentFilesData");
given("I require a file", () => {
});
given("I require a different file", () => {
});
then("I can access theirs data", () => {
expect(dataToBeLoaded.IAmImported).to.equal(true);
expect(differentDataToBeLoaded.IAmAlsoImported).to.equal(true);
});
Feature file:
Feature: Requiring Files
Scenario: Require Two Files
Given I require a file
And I require a different file
Then I can access theirs data
the files I require are trivial:
module.exports = {
IAmAlsoImported: true
};
and the second one exports "IAmImported: true" in it
from cypress-cucumber-preprocessor.
Sorry, it was a mistake on my part. I didn't realize that for my team's project, plugins/index.js was ignoring/overwriting cypress-cucumber-preprocessor's index.js which contains the exact fix I wanted. Once I accounted for that, and used version 0.6.0, the problem went away.
from cypress-cucumber-preprocessor.
Related Issues (20)
- No longer possible to use Step() in beforeEach and afterEach hooks HOT 1
- Type support for named hooks HOT 1
- Tests don't run when I migrated from cypress-cucumber-preprocessor to @badeball/cypress-cucumber-preprocessor HOT 2
- If you run Cucumber and standard Cypress you cannot use not tags HOT 2
- Invalid or unexpected token when using createEsbuildPlugin HOT 6
- diagnostics - Cypress.env is not a function when referring to env object as const HOT 7
- Error occured for cypress+cucumber HOT 2
- Error 'glob.escape is not a function' in Headless Mode with Cypress Cucumber Preprocessor 19.1.0 and Node 18.12.0 HOT 10
- negative filters should allow to opt-in/out for non-feature files HOT 2
- Dry run: static code analyses with fallback to evaluation
- Compatibility Issues and Deprecation Warnings with Outdated @cypress/browserify-preprocessor HOT 3
- Cannot see error logs details in Cypress UI debugger HOT 1
- Emit meta information like cucumber-js
- cypress-cucumber-preprocessor support cypress-vite HOT 4
- esbuild always get installed even we want to use webpack HOT 1
- Merge reports obtained through parallelization using Cypress Cloud
- Error: Unexpected state in specEnvelopesHandler: initial (this might be a bug, please report at ...) HOT 8
- Feature request: Add videos to Cypress' cucumber reports HOT 2
- Avoid writing implicit messages report
- Error occured while using cypress+BDD HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-cucumber-preprocessor.