You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] Is there a way to programmattically handle codeceptjs instance? #2525
I have a Job queue and an API server setup. once a trigger received from the user, api server will insert a job in the queue.
Queue listener will pickup the job and for every job, I have to run few test cases using CodeceptJS custom runner. I will execute the next job's testcases only after the current job's codecept instance is completed.
Basically I would like to have something like "codecept.close()" this in CodeCeptJS.
I could get the test completion status only using "event.all.after" event. I can't close the instantiated codeceptjs instance by code.
Provide console output if related. Use --verbose mode for more details.
# paste output here
Provide test source code if related
const{container: Container,codecept: Codecept, event}=require('codeceptjs');const{dataStore}=require('../helper');const{app, runner, flags}=require('../config').config;constpath=require('path');classCustomRunner{config=require(path.join(app.projectDirectory,'/config/codecept.conf')).config;opts={steps: runner.steps,debug: runner.debug};testFiles=path.join(app.projectDirectory,runner.testFiles);run(){// create runnerconstcodecept=newCodecept(this.config,this.opts);// initialize codeceptjs in current dircodecept.initGlobals(__dirname);// create helpers, support files, mochaContainer.create(this.config,this.opts);// initialize listenerscodecept.runHooks();// run bootstrap function from config// load testscodecept.loadTests(this.testFiles);// run testscodecept.run();}}if(!flags.isDebugMode){newCustomRunner().run();}module.exports=CustomRunner;
Activity