Closed ZHChen8397 closed 6 years ago
I haven't any experience with electron or electron-spectrum, but I think so. Yadda isn't doing anything particularly clever in the mocha plugin - it just calls describe
and it
, passing them the scenario title and step text. Assuming electron-spectrum works just like mocha if you execute before
or beforeAll
within the feature, scenario and step callbacks I think you'll see the code executing.
There's an example here, but it only uses global setup.
One thing to watch out for - if app.start() isn't synchronous you'll need to find some say to wait until the application has actually started.
Any luck getting it working?
Sure. Sorry for the late comment here. It's just like what you said, execute before, after within features, and it works. the code may like this
new Yadda.FeatureFileSearch('./test//features/mrtFeature').each(function(file) {
featureFile(file, function(feature) {
var library = require('./test/steps/mrt.js');
var yadda = Yadda.createInstance(library);
before(function () {
this.app = new Application({
args: [path.join(__dirname, './')]
})
return this.app.start()
})
scenarios(feature.scenarios, function(scenario) {
steps(scenario.steps, function(step, done) {
yadda.run(step, done);
});
});
after(function () {
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
})
});
});
Hi, I am writing ap electron app and tried to test it with yadda. this is the original index
new Yadda.FeatureFileSearch('./test/features').each(function(file) {
Is it possible that before every feature I can start my app? the code may be like
});