mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-02 02:57:23 +00:00
feat(testing): Fixed CI config for playwright
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user