feat(testing): Fixed CI config for playwright

This commit is contained in:
Muhammed Mustafa
2022-10-07 11:03:16 +05:30
parent 5fe1ee53dc
commit 3c39515f63
4 changed files with 28 additions and 28 deletions

View File

@@ -1,27 +1,27 @@
import axios from 'axios';
const extPgProject = {
title: 'pgExtREST',
bases: [
{
type: 'pg',
config: {
client: 'pg',
connection: {
host: 'localhost',
port: '5432',
user: 'postgres',
password: 'password',
database: 'postgres',
},
searchPath: ['public'],
},
inflection_column: 'camelize',
inflection_table: 'camelize',
},
],
external: true,
};
// const extPgProject = {
// title: 'pgExtREST',
// bases: [
// {
// type: 'pg',
// config: {
// client: 'pg',
// connection: {
// host: 'localhost',
// port: '5432',
// user: 'postgres',
// password: 'password',
// database: 'postgres',
// },
// searchPath: ['public'],
// },
// inflection_column: 'camelize',
// inflection_table: 'camelize',
// },
// ],
// external: true,
// };
const extMysqlProject = {
title: 'externalREST',
@@ -47,7 +47,7 @@ const extMysqlProject = {
const createProjects = async (token) => {
return await Promise.all(
[extPgProject, extMysqlProject].map(async (projectAttr) => {
[extMysqlProject].map(async (projectAttr) => {
const response = await axios.post(
'http://localhost:8080/api/v1/db/meta/projects/',
projectAttr,

View File

@@ -4,7 +4,6 @@ import Knex from 'knex';
import NocoCache from '../../../cache/NocoCache';
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2';
import createProjects from './createProjects';
import { isPgSakilaToBeReset, resetPgSakila } from './resetPgSakila';
import createUser from './createUser';
import resetMeta from './resetMeta';
import { isMysqlSakilaToBeReset, resetMysqlSakila } from './resetMysqlSakila';
@@ -20,9 +19,9 @@ export class TestResetService {
try {
await NcConnectionMgrv2.destroyAll();
if (await isPgSakilaToBeReset()) {
await resetPgSakila();
}
// if (await isPgSakilaToBeReset()) {
// await resetPgSakila();
// }
if (await isMysqlSakilaToBeReset()) {
await resetMysqlSakila();

View File

@@ -96,7 +96,7 @@ const config: PlaywrightTestConfig = {
],
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
outputDir: './playwright-report',
outputDir: './output',
/* Run your local dev server before starting the tests */
// webServer: {

View File

@@ -4,6 +4,7 @@ import { DashboardPage } from '../pages/Dashboard';
const setup = async ({page}: {page: Page}) => {
const response = await axios.get('http://localhost:8080/api/v1/meta/test/reset');
console.log("setup:res:", response);
if(response.status !== 200) {
console.error('Failed to reset test data', response);
throw new Error('Failed to reset test data');