Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdias committed Sep 29, 2024
1 parent 68ba846 commit e6232f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
19 changes: 8 additions & 11 deletions examples/quick-start-llm-python/tests/e2e/ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ const chatgptTraceBasedTest = require('./definitions/chatgpt');

const { runTracebasedTest } = require('./tracetest');

const timeToWait = 10_000; // 10 seconds

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

test('generated summarized test for Gemini', async ({ page }) => {
// Go to Streamlit app
await page.goto('http://localhost:8501/');
Expand All @@ -25,14 +19,17 @@ test('generated summarized test for Gemini', async ({ page }) => {
// Click on button to call summarization rule
await page.getByRole('button', { name: 'Summarize' }).click();

// Wait for time
await sleep(timeToWait);
// Wait link to appear
await page.getByText('Trace ID').waitFor({ state: 'visible' });

// Capture TraceID
const traceIDLabel = await page.getByRole('link', { name: 'Trace ID' });
expect(traceIDLabel).toHaveText('Trace ID');
const traceIDElement = await page.getByRole('link');
console.log(traceIDElement.innerHTML());

// const traceIDLabel = await page.getByRole('link', { name: 'Trace ID' });
// expect(traceIDLabel).toHaveText('Trace ID');

console.log(traceIDLabel);
// console.log(traceIDLabel);

// const traceID = (traceIDLabel || '').replace('Trace ID:', '').trim();

Expand Down
3 changes: 2 additions & 1 deletion examples/quick-start-llm-python/tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
// reporter: 'html',
reporter: 'list',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
Expand Down

0 comments on commit e6232f6

Please sign in to comment.