Canner / WrenAI

🚀 Open-source SQL AI Agent for Text-to-SQL. Make Text2SQL Easy! 🙌
https://getwren.ai/oss
GNU Affero General Public License v3.0
1.76k stars 161 forks source link

Add E2E tests for ClickHouse Data Source #702

Open fredalai opened 1 day ago

fredalai commented 1 day ago

Summary

We need contributors to help develop end-to-end (E2E) tests for the ClickHouse data source. The goal is to cover the entire onboarding process—from connecting ClickHouse to reaching the home page after successful data source setup.

Description

The goal is to ensure the entire onboarding flow for ClickHouse works as expected, including:

Develop

Note:

References:

princetoday commented 15 hours ago

I would like to work on this issue. Please assign it to me.

fredalai commented 7 hours ago

@princetoday assigned~! :D

princetoday commented 4 hours ago

import { test, expect } from '@playwright/test';

test.describe('ClickHouse Data Source Onboarding', () => {

test('should connect to ClickHouse and reach the home page', async ({ page }) => {

// Navigate to data source page
await page.goto('http://your-app-url/data-source-setup');

// Step 1: Select ClickHouse as a data source
await page.click('text=Select Data Source');
await page.click('text=ClickHouse');

// Step 2: Fill in connection details
await page.fill('input[name="host"]', 'localhost');
await page.fill('input[name="port"]', '9000');
await page.fill('input[name="username"]', 'default');
await page.fill('input[name="password"]', 'password');

// Submit the connection details
await page.click('button[type="submit"]');

// Step 3: Select all tables as data models
await page.waitForSelector('text=Select Tables');
await page.click('button:has-text("Select All")');
await page.click('button:has-text("Next")');

// Step 4: Accept recommended relationships
await page.waitForSelector('text=Recommended Relationships');
await page.click('button:has-text("Accept All")');

// Step 5: Verify successful onboarding
await page.waitForURL('http://your-app-url/home');
expect(page.url()).toBe('http://your-app-url/home');

});

}); something like this??