Regalamiunsorriso/faceai/tests/e2e/global-setup.js
MaddoScientisto 2218c9a84c
All checks were successful
Publish FaceAI Container / publish (push) Successful in 2m42s
End to end tests
2026-04-12 19:31:12 +02:00

27 lines
No EOL
841 B
JavaScript

const {
FACEAI_BASE_URL,
SIMULATOR_URL,
dockerCompose,
prepareHostState,
runCommand,
waitForHttp
} = require('./faceai-test-utils');
module.exports = async () => {
await prepareHostState();
await dockerCompose(['down', '-v', '--remove-orphans'], { allowFailure: true });
await runCommand('npm', ['run', 'build']);
await dockerCompose(['up', '--build', '-d']);
await waitForHttp(`${FACEAI_BASE_URL}/health`, ({ response, parsedBody }) => {
return response.ok && parsedBody && parsedBody.ok === true;
});
await waitForHttp(`${FACEAI_BASE_URL}/api/health/queue`, ({ response, parsedBody }) => {
return response.ok && parsedBody && parsedBody.ok === true;
});
await waitForHttp(SIMULATOR_URL, ({ response, bodyText }) => {
return response.ok && bodyText.includes('FaceAI Legacy Simulator');
});
};