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
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;
This discussion was converted from issue #2525 on April 16, 2024 15:24.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What are you trying to achieve?
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.
What do you get instead?
I could get the test completion status only using "event.all.after" event. I can't close the instantiated codeceptjs instance by code.
# paste output here
Details
Beta Was this translation helpful? Give feedback.
All reactions