Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
feat(Smoke/Health): update API smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
webrooster committed Jun 19, 2023
1 parent 9f8be13 commit 1023fb7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
32 changes: 26 additions & 6 deletions __e2e__/HealthCheck.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,35 @@ dotenv.config();
test.use({ storageState: './__e2e__/data/noAuth.json' });

test.describe('@healthcheck', () => {
test('healthcheck - testing mumble app', async ({ page }) => {
test('health check - mumble app', async ({ page }) => {
const response = await page.request.get('https://app-yeahyeahyeah-cbvb5d3h6a-oa.a.run.app');
await expect(response).toBeOK();
const result = response.status();
expect(result, 'should be 200').toBe(200);
});

test('healthcheck - testing qwacker', async ({ page }) => {
const response = await page.request.get(
'https://qwacker-api-http-prod-4cxdci3drq-oa.a.run.app/posts?offset=0&limit=100&creator=201444056083988737'
test('health check - qwacker API', async ({ page }) => {
const response = await page.request.get('https://qwacker-api-http-prod-4cxdci3drq-oa.a.run.app');
const result = response.status();
expect(result, 'should be 404').toBe(404);
});

test('health check - zitadel', async ({ page }) => {
const response = await page.request.get('https://cas-fee-advanced-ocvdad.zitadel.cloud');
const result = response.status();
expect(result, 'should be 200').toBe(200);
});

test('smoke test - qwacker API post', async ({ page }) => {
const response: any = await page.request.get(
'https://qwacker-api-http-prod-4cxdci3drq-oa.a.run.app/posts?offset=0&limit=1&creator=201161756305785089'
);
await expect(response).toBeOK();

const apiResponse = await response.json();
console.log(apiResponse.data);

expect(response.status()).toBe(200);
expect(apiResponse.data[0].id).not.toBe('');
expect(apiResponse.data[0].creator).toBe('201161756305785089');
expect(apiResponse.data[0].text).not.toBe('');
});
});
1 change: 0 additions & 1 deletion playwright.checks.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default defineConfig({
trace: 'on-first-retry',
viewport: null,
headless: true,
screenshot: 'only-on-failure',
},
projects: [
{
Expand Down

0 comments on commit 1023fb7

Please sign in to comment.