Files
WrenAI/wren-ui/e2e
Andy YenandFreda Lai aa8ca23257 Feature: Support MS SQL Server data source (#443)
* 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>
2024-06-26 17:23:17 +08:00
..
2024-06-24 20:20:41 +08:00

How to run e2e test locally

  1. Make sure you have start all Wren AI services. (How to start)

  2. Create a e2e.config.json file under wren-ui/e2e folder 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,
      },
    };
    
  3. Build UI before starting e2e server

    yarn build
    

    Ensure 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.

  4. Run test

    yarn test:e2e
    

    Run 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