mirror of
https://github.com/Canner/WrenAI.git
synced 2026-10-24 23:57:16 +08:00
* chore: Refactor DuckDB connection handling in projectResolver * abstract the data source actions to data source util * add mssql data source * feat(wren-ui): Add SQL Server Data Source UI * feat(wren-ui/e2e): Add basic tests for SQL Server * better error handling * fix lint issue --------- Co-authored-by: Freda Lai <fredalai00@gmail.com>
How to run e2e test locally
-
Make sure you have start all Wren AI services. (How to start)
-
Create a
e2e.config.jsonfile underwren-ui/e2efolder and replace all data sources needed values in./config.ts.// Replace the default test config with your own e2e.config.json const defaultTestConfig = { bigQuery: { projectId: 'wrenai', datasetId: 'wrenai.tpch_sf1', // The credential file should be under "wren-ui" folder // For example: .tmp/credential.json credentialPath: 'bigquery-credential-path', }, duckDb: { sqlCsvPath: 'https://duckdb.org/data/flights.csv', }, postgreSql: { host: 'postgresql-host', port: '5432', username: 'postgresql-username', password: 'postgresql-password', database: 'postgresql-database', ssl: false, }, }; -
Build UI before starting e2e server
yarn buildEnsure port 3000 is available for E2E testing. The AI service needs WREN_UI_ENDPOINT to connect to this port for accurate and reliable test results.
-
Run test
yarn test:e2eRun test with browser open
yarn test:e2e --headed
How to develop
-
Write test with interactive UI mode
yarn test:e2e --ui -
Write test with debug mode
yarn test:e2e --debug -
Generate test scripts
npx playwright codegen http://localhost:3000