test: add initial Cypress e2e test infrastructure
Smoke tests for verifying Cypress runs, plus basic API tests for health and sessions endpoints.
This commit is contained in:
30
cypress/e2e/api/health.cy.js
Normal file
30
cypress/e2e/api/health.cy.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
describe('Session Manager API', () => {
|
||||
describe('Health Check', () => {
|
||||
it('should respond to the health endpoint', () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
url: '/api/health',
|
||||
failOnStatusCode: false,
|
||||
}).then((response) => {
|
||||
// The endpoint should exist and return a response
|
||||
expect(response.status).to.be.oneOf([200, 503]);
|
||||
expect(response.body).to.be.an('object');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Sessions API', () => {
|
||||
it('should list sessions', () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
url: '/api/sessions',
|
||||
failOnStatusCode: false,
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.be.an('object');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user