From 3c39515f632d84b87a349fe263d498703fa8185e Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 7 Oct 2022 11:03:16 +0530 Subject: [PATCH] feat(testing): Fixed CI config for playwright --- .../test/TestResetService/createProjects.ts | 46 +++++++++---------- .../services/test/TestResetService/index.ts | 7 ++- scripts/playwright/playwright.config.ts | 2 +- scripts/playwright/setup/index.ts | 1 + 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/nocodb/src/lib/services/test/TestResetService/createProjects.ts b/packages/nocodb/src/lib/services/test/TestResetService/createProjects.ts index cf4e03f32d..3fb37435c5 100644 --- a/packages/nocodb/src/lib/services/test/TestResetService/createProjects.ts +++ b/packages/nocodb/src/lib/services/test/TestResetService/createProjects.ts @@ -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, diff --git a/packages/nocodb/src/lib/services/test/TestResetService/index.ts b/packages/nocodb/src/lib/services/test/TestResetService/index.ts index 49e1f29dc4..071447e7f8 100644 --- a/packages/nocodb/src/lib/services/test/TestResetService/index.ts +++ b/packages/nocodb/src/lib/services/test/TestResetService/index.ts @@ -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(); diff --git a/scripts/playwright/playwright.config.ts b/scripts/playwright/playwright.config.ts index 2a0438ac43..1bbcaed916 100644 --- a/scripts/playwright/playwright.config.ts +++ b/scripts/playwright/playwright.config.ts @@ -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: { diff --git a/scripts/playwright/setup/index.ts b/scripts/playwright/setup/index.ts index 5f7f7bd9da..7b264862db 100644 --- a/scripts/playwright/setup/index.ts +++ b/scripts/playwright/setup/index.ts @@ -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');