feat(testing): Added different db support

This commit is contained in:
Muhammed Mustafa
2022-10-11 12:41:40 +05:30
parent d4e7071485
commit 6e575348c8
4 changed files with 9 additions and 5 deletions

View File

@@ -2,9 +2,11 @@ import { Page, TestInfo } from '@playwright/test';
import axios from 'axios';
import { DashboardPage } from '../pages/Dashboard';
const setup = async ({page}: {page: Page}) => {
const setup = async ({page, typeOnLocalSetup}: {page: Page, typeOnLocalSetup?: string}) => {
const type = process.env.CI ? process.env.E2E_TYPE : typeOnLocalSetup;
const response = await axios.post(`http://localhost:8080/api/v1/meta/test/reset`, {
parallelId: process.env.TEST_PARALLEL_INDEX
parallelId: process.env.TEST_PARALLEL_INDEX,
type: type ?? 'sqlite',
});
if(response.status !== 200) {