mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-24 21:05:29 +00:00
@@ -12,6 +12,10 @@ const isPg = (context: NcContext) => context.dbType === 'pg';
|
||||
|
||||
const isEE = () => process.env.EE === 'true';
|
||||
|
||||
// run all the tests for PG; disable some tests for mysql, sqlite to reduce CI time
|
||||
//
|
||||
const enableQuickRun = () => (process.env.CI ? process.env.E2E_DB_TYPE : process.env.E2E_DEV_DB_TYPE) !== 'pg';
|
||||
|
||||
const pg_credentials = (context: NcContext) => ({
|
||||
user: 'postgres',
|
||||
host: 'localhost',
|
||||
@@ -65,4 +69,4 @@ async function sqliteExec(query) {
|
||||
}
|
||||
}
|
||||
|
||||
export { sqliteExec, mysqlExec, isMysql, isSqlite, isPg, pgExec, isEE };
|
||||
export { sqliteExec, mysqlExec, isMysql, isSqlite, isPg, pgExec, isEE, enableQuickRun };
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import setup, { NcContext, unsetup } from '../../../setup';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
const dateTimeData = [
|
||||
{
|
||||
@@ -57,6 +58,7 @@ const dateTimeData = [
|
||||
];
|
||||
|
||||
test.describe('DateTime Column', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let context: NcContext;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import setup, { unsetup } from '../../../setup';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
// Storing one additional dummy value "10" at end of every input array
|
||||
// this will trigger update to previously committed data
|
||||
@@ -41,6 +42,8 @@ const durationData = [
|
||||
];
|
||||
|
||||
test.describe('Duration column', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import setup, { NcContext, unsetup } from '../../../setup';
|
||||
import { isPg, isSqlite } from '../../../setup/db';
|
||||
import { enableQuickRun, isPg, isSqlite } from '../../../setup/db';
|
||||
|
||||
// Add formula to be verified here & store expected results for 5 rows
|
||||
// Column data from City table (Sakila DB)
|
||||
@@ -157,6 +157,8 @@ const formulaDataByDbType = (context: NcContext, index: number) => {
|
||||
};
|
||||
|
||||
test.describe('Virtual Columns', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Api } from 'nocodb-sdk';
|
||||
import { rowMixedValue } from '../../../setup/xcdb-records';
|
||||
import dayjs from 'dayjs';
|
||||
import { createDemoTable } from '../../../setup/demoTable';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
let dashboard: DashboardPage, toolbar: ToolbarPage;
|
||||
let context: any;
|
||||
@@ -111,6 +112,7 @@ async function verifyFilter(param: {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: Numerical', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
async function numBasedFilterTest(dataType, eqString, isLikeString) {
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'numberBased' });
|
||||
@@ -299,6 +301,7 @@ test.describe('Filter Tests: Numerical', () => {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: Text based', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
async function textBasedFilterTest(dataType, eqString, isLikeString) {
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'textBased' });
|
||||
@@ -418,6 +421,7 @@ test.describe('Filter Tests: Text based', () => {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: Select based', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
async function selectBasedFilterTest(dataType, is, anyof, allof) {
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'selectBased' });
|
||||
@@ -536,6 +540,7 @@ function getUTCEpochTime(date) {
|
||||
}
|
||||
|
||||
test.describe('Filter Tests: Date based', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
const today = getUTCEpochTime(new Date());
|
||||
const tomorrow = getUTCEpochTime(new Date(new Date().setDate(new Date().getDate() + 1)));
|
||||
const yesterday = getUTCEpochTime(new Date(new Date().setDate(new Date().getDate() - 1)));
|
||||
@@ -843,6 +848,7 @@ test.describe('Filter Tests: Date based', () => {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: AddOn', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
async function addOnFilterTest(dataType) {
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'addOnTypes', networkResponse: false });
|
||||
@@ -948,6 +954,7 @@ test.describe('Filter Tests: AddOn', () => {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
async function linkToAnotherRecordFilterTest() {
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'Country', networkResponse: false });
|
||||
@@ -1093,6 +1100,7 @@ test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
|
||||
//
|
||||
|
||||
test.describe('Filter Tests: Toggle button', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
/**
|
||||
* Steps
|
||||
*
|
||||
@@ -1176,6 +1184,7 @@ test.describe('Filter Tests: Toggle button', () => {
|
||||
});
|
||||
|
||||
test.describe('Filter Tests: Filter groups', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
/**
|
||||
* Steps
|
||||
*
|
||||
|
||||
@@ -3,8 +3,10 @@ import { airtableApiBase, airtableApiKey } from '../../../constants';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { quickVerify } from '../../../quickTests/commonTest';
|
||||
import setup, { NcContext, unsetup } from '../../../setup';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
test.describe('Import', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let context: NcContext;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import setup, { NcContext, unsetup } from '../../../setup';
|
||||
import { isMysql, isPg, isSqlite, mysqlExec, pgExec, sqliteExec } from '../../../setup/db';
|
||||
import { enableQuickRun, isMysql, isPg, isSqlite, mysqlExec, pgExec, sqliteExec } from '../../../setup/db';
|
||||
import { MetaDataPage } from '../../../pages/Dashboard/ProjectView/Metadata';
|
||||
|
||||
test.describe('Meta sync', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let context: NcContext;
|
||||
let dbExec;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import setup, { NcContext, unsetup } from '../../../setup';
|
||||
import { Api, ProjectListType, UITypes } from 'nocodb-sdk';
|
||||
import { isEE, isMysql, isPg, isSqlite } from '../../../setup/db';
|
||||
import { enableQuickRun, isEE, isMysql, isPg, isSqlite } from '../../../setup/db';
|
||||
import { getKnexConfig } from '../../utils/config';
|
||||
import { getBrowserTimezoneOffset } from '../../utils/general';
|
||||
import config from '../../../playwright.config';
|
||||
@@ -110,6 +110,7 @@ async function connectToExtDb(context: any, dbName: string, api: Api<any>) {
|
||||
|
||||
// serial : as we are creating an external db, we need to run the tests sequentially
|
||||
test.describe.serial('Timezone-XCDB : Japan/Tokyo', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let api: Api<any>, records: any[];
|
||||
let context: any;
|
||||
@@ -214,6 +215,7 @@ test.describe.serial('Timezone-XCDB : Japan/Tokyo', () => {
|
||||
// Change browser timezone & locale to Asia/Hong-Kong
|
||||
//
|
||||
test.describe.serial('Timezone-XCDB : Asia/Hong-kong', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -282,6 +284,7 @@ test.describe.serial('Timezone-XCDB : Asia/Hong-kong', () => {
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
test.describe.serial('Timezone-XCDB : Asia/Hong-kong', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let gApi: Api<any>, records: any[];
|
||||
let context: any;
|
||||
@@ -471,6 +474,7 @@ function getDateTimeInUTCTimeZone(dateString: string) {
|
||||
}
|
||||
|
||||
test.describe.serial('Timezone- ExtDB : DateTime column, Browser Timezone same as server timezone', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let api: Api<any>;
|
||||
let context: any;
|
||||
@@ -830,6 +834,7 @@ test.describe.serial('Timezone- ExtDB : DateTime column, Browser Timezone same a
|
||||
});
|
||||
|
||||
test.describe.serial('Timezone- ExtDB : DateTime column, Browser Timezone set to HKT', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let api: Api<any>;
|
||||
let context: any;
|
||||
@@ -970,6 +975,7 @@ test.describe.serial('Timezone- ExtDB : DateTime column, Browser Timezone set to
|
||||
});
|
||||
|
||||
test.describe.serial('Timezone- ExtDB (MySQL Only) : DB Timezone configured as HKT', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage;
|
||||
let api: Api<any>;
|
||||
let context: any;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Api, UITypes } from 'nocodb-sdk';
|
||||
import { rowMixedValue } from '../../../setup/xcdb-records';
|
||||
import { GridPage } from '../../../pages/Dashboard/Grid';
|
||||
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
|
||||
import { isSqlite } from '../../../setup/db';
|
||||
import { enableQuickRun, isSqlite } from '../../../setup/db';
|
||||
|
||||
const validateResponse = false;
|
||||
|
||||
@@ -44,6 +44,7 @@ async function undo({ page, dashboard }: { page: Page; dashboard: DashboardPage
|
||||
}
|
||||
|
||||
test.describe('Undo Redo', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage, context: any, api: Api<any>, table: any;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -351,6 +352,7 @@ test.describe('Undo Redo', () => {
|
||||
});
|
||||
|
||||
test.describe('Undo Redo - Table & view rename operations', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage, context: any, api: Api<any>, table: any;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -465,6 +467,7 @@ test.describe('Undo Redo - Table & view rename operations', () => {
|
||||
});
|
||||
|
||||
test.describe('Undo Redo - LTAR', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage, grid: GridPage, context: any, api: Api<any>, cityTable: any, countryTable: any;
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page, isEmptyProject: true });
|
||||
@@ -640,6 +643,7 @@ test.describe('Undo Redo - LTAR', () => {
|
||||
});
|
||||
|
||||
test.describe('Undo Redo - Select based', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let dashboard: DashboardPage, /*grid: GridPage,*/ context: any, api: Api<any>, table: any;
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page, isEmptyProject: true });
|
||||
|
||||
@@ -5,7 +5,7 @@ import makeServer from '../../../setup/server';
|
||||
import { WebhookFormPage } from '../../../pages/Dashboard/WebhookForm';
|
||||
import { isSubset } from '../../../tests/utils/general';
|
||||
import { Api, UITypes } from 'nocodb-sdk';
|
||||
import { isEE, isMysql, isSqlite } from '../../../setup/db';
|
||||
import { enableQuickRun, isEE, isMysql, isSqlite } from '../../../setup/db';
|
||||
|
||||
const hookPath = 'http://localhost:9090/hook';
|
||||
|
||||
@@ -103,6 +103,7 @@ async function buildExpectedResponseData(type, value, oldValue?) {
|
||||
}
|
||||
|
||||
test.describe.serial('Webhook', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
let api: Api<any>;
|
||||
|
||||
// start a server locally for webhook tests
|
||||
|
||||
@@ -4,6 +4,7 @@ import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
|
||||
import { createDemoTable } from '../../../setup/demoTable';
|
||||
import { TopbarPage } from '../../../pages/Dashboard/common/Topbar';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
const validateResponse = false;
|
||||
|
||||
@@ -26,6 +27,8 @@ async function undo({ page, dashboard }: { page: Page; dashboard: DashboardPage
|
||||
}
|
||||
|
||||
test.describe('GroupBy CRUD Operations', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage, toolbar: ToolbarPage, topbar: TopbarPage;
|
||||
let context: any;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
|
||||
import setup, { unsetup } from '../../../setup';
|
||||
import { isMysql } from '../../../setup/db';
|
||||
import { enableQuickRun, isMysql } from '../../../setup/db';
|
||||
import { UITypes } from 'nocodb-sdk';
|
||||
|
||||
test.describe('Toolbar operations (GRID)', () => {
|
||||
@@ -28,6 +28,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Create a GroupBy and Verify With Sort, Filter, Hide', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
// Open Table
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
@@ -160,6 +161,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Create Two GroupBy and Verify With Sort, Filter, Hide', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
// Open Table
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
@@ -302,6 +304,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Create Three GroupBy and Verify With Sort, Filter, Hide', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
// Open Table
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
@@ -451,6 +454,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Update GroupBy and Verify', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
if (isMysql(context)) {
|
||||
@@ -504,6 +508,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Change View and Verify GroupBy', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
// Open GroupBy Menu
|
||||
@@ -529,6 +534,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Duplicate View and Verify GroupBy', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
await dashboard.viewSidebar.createGridView({ title: 'Film Grid' });
|
||||
|
||||
@@ -552,6 +558,7 @@ test.describe('Toolbar operations (GRID)', () => {
|
||||
});
|
||||
|
||||
test('Delete GroupBy and Verify', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
await dashboard.treeView.openTable({ title: 'Film' });
|
||||
|
||||
// Open GroupBy Menu
|
||||
|
||||
@@ -7,10 +7,12 @@ import { Api, UITypes } from 'nocodb-sdk';
|
||||
import { LoginPage } from '../../../pages/LoginPage';
|
||||
import { getDefaultPwd } from '../../../tests/utils/general';
|
||||
import { WorkspacePage } from '../../../pages/WorkspacePage';
|
||||
import { isEE } from '../../../setup/db';
|
||||
import { enableQuickRun, isEE } from '../../../setup/db';
|
||||
|
||||
// todo: Move most of the ui actions to page object and await on the api response
|
||||
test.describe('Form view', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage;
|
||||
let form: FormPage;
|
||||
let context: any;
|
||||
@@ -248,6 +250,8 @@ test.describe('Form view', () => {
|
||||
});
|
||||
|
||||
test.describe('Form view with LTAR', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage;
|
||||
let loginPage: LoginPage;
|
||||
let wsPage: WorkspacePage;
|
||||
@@ -402,6 +406,8 @@ test.describe('Form view with LTAR', () => {
|
||||
});
|
||||
|
||||
test.describe('Form view', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
let api: Api<any>;
|
||||
|
||||
@@ -2,6 +2,7 @@ import { test } from '@playwright/test';
|
||||
import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { SurveyFormPage } from '../../../pages/Dashboard/SurveyForm';
|
||||
import setup, { unsetup } from '../../../setup';
|
||||
import { enableQuickRun } from '../../../setup/db';
|
||||
|
||||
test.describe('Share form', () => {
|
||||
let dashboard: DashboardPage;
|
||||
@@ -18,6 +19,8 @@ test.describe('Share form', () => {
|
||||
});
|
||||
|
||||
test('Survey', async () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
// close 'Team & Auth' tab
|
||||
await dashboard.closeTab({ title: 'Team & Auth' });
|
||||
await dashboard.treeView.openTable({ title: 'Country' });
|
||||
|
||||
@@ -3,12 +3,14 @@ import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
|
||||
|
||||
import setup, { unsetup } from '../../../setup';
|
||||
import { isPg, isSqlite } from '../../../setup/db';
|
||||
import { enableQuickRun, isPg, isSqlite } from '../../../setup/db';
|
||||
import { TopbarPage } from '../../../pages/Dashboard/common/Topbar';
|
||||
|
||||
const filmRatings = ['G', 'PG', 'PG-13', 'R', 'NC-17'];
|
||||
|
||||
test.describe('View', () => {
|
||||
if (enableQuickRun()) test.skip();
|
||||
|
||||
let dashboard: DashboardPage, toolbar: ToolbarPage, topbar: TopbarPage;
|
||||
let context: any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user