End to end tests
This commit is contained in:
parent
c71e4b4cd0
commit
fed82d1ae8
26 changed files with 1016 additions and 37 deletions
27
faceai/tests/e2e/global-setup.js
Normal file
27
faceai/tests/e2e/global-setup.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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');
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue