Skip to content

Commit a5341c0

Browse files
committed
Run e2e package instead of e2e2 for dojo
1 parent fd99057 commit a5341c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+157
-143
lines changed

.github/workflows/dojo-e2e.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ jobs:
5252
run: node ./scripts/prep-dojo-everything.js -e2e
5353

5454
- name: Install e2e dependencies
55-
working-directory: typescript-sdk/apps/dojo/e2e2
55+
working-directory: typescript-sdk/apps/dojo/e2e
5656
run: |
57-
pnpm install --frozen-lockfile
58-
pnpm dlx playwright install --with-deps
57+
pnpm install
5958
6059
- name: write langgraph env files
6160
working-directory: typescript-sdk/integrations/langgraph
@@ -71,20 +70,21 @@ jobs:
7170
echo "LANGSMITH_API_KEY=${LANGSMITH_API_KEY}" >> python/ag_ui_langgraph/.env
7271
7372
- name: Run dojo+agents and tests
74-
working-directory: typescript-sdk/apps/dojo/e2e2
73+
working-directory: typescript-sdk/apps/dojo/e2e
7574
env:
7675
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
7776
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
77+
BASE_URL: http://localhost:9999
7878
run: |
7979
node ../scripts/run-dojo-everything.js &
8080
npx wait-port 9999
8181
sleep 10
82-
pnpm exec playwright test --reporter=dot
82+
pnpm test
8383
8484
- name: Upload traces
8585
if: always() # Uploads artifacts even if tests fail
8686
uses: actions/upload-artifact@v4
8787
with:
8888
name: playwright-traces
89-
path: typescript-sdk/apps/dojo/e2e2/test-results/
89+
path: typescript-sdk/apps/dojo/e2e/test-results/
9090
retention-days: 7

typescript-sdk/apps/dojo/e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"description": "Scheduled Playwright smoke tests for CopilotKit demo apps",
66
"scripts": {
7+
"postinstall": "playwright install --with-deps",
78
"test": "playwright test",
89
"test:ui": "playwright test --ui"
910
},
Lines changed: 61 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
import { defineConfig } from "@playwright/test";
1+
import { defineConfig, ReporterDescription } from "@playwright/test";
22
import { generateSimpleLayout } from "./slack-layout-simple";
33

4+
5+
6+
function getReporters(): ReporterDescription[] {
7+
const videoReporter: ReporterDescription = [
8+
"./reporters/s3-video-reporter.ts",
9+
{
10+
outputFile: "test-results/video-urls.json",
11+
uploadVideos: true,
12+
},
13+
];
14+
15+
const s3Reporter: ReporterDescription = [
16+
"./node_modules/playwright-slack-report/dist/src/SlackReporter.js",
17+
{
18+
slackWebHookUrl: process.env.SLACK_WEBHOOK_URL,
19+
sendResults: "always", // always send results
20+
maxNumberOfFailuresToShow: 10,
21+
layout: generateSimpleLayout, // Use our simple layout
22+
},
23+
];
24+
25+
let reporters: ReporterDescription[] = [];
26+
27+
const addVideoAndSlack = process.env.SLACK_WEBHOOK_URL && process.env.AWS_S3_BUCKET_NAME;
28+
if (process.env.CI) {
29+
reporters = [
30+
["github"],
31+
["html", { open: "never" }],
32+
];
33+
if (addVideoAndSlack) {
34+
reporters.push(videoReporter, s3Reporter);
35+
}
36+
37+
return reporters;
38+
}
39+
40+
if (addVideoAndSlack) {
41+
return [
42+
videoReporter,
43+
s3Reporter,
44+
["html", { open: "never" }]
45+
];
46+
}
47+
48+
return [
49+
["./clean-reporter.js"],
50+
["html", { open: "never" }],
51+
];
52+
}
53+
54+
function getBaseUrl(): string {
55+
if (process.env.BASE_URL) {
56+
return new URL(process.env.BASE_URL).toString();
57+
}
58+
console.error("BASE_URL is not set");
59+
process.exit(1);
60+
}
61+
462
export default defineConfig({
563
timeout: process.env.CI ? 300_000 : 120_000, // 5min in CI, 2min locally for AI tests
664
workers: 1, // Serial execution to avoid race conditions and AI service conflicts
@@ -20,6 +78,7 @@ export default defineConfig({
2078
actionTimeout: 60_000, // 1 minute for AI-driven actions (clicking, filling)
2179
// Test isolation - ensure clean state between tests
2280
testIdAttribute: "data-testid",
81+
baseURL: getBaseUrl(),
2382
},
2483
expect: {
2584
timeout: 90_000, // 1.5 minutes for AI-generated content to appear
@@ -38,53 +97,5 @@ export default defineConfig({
3897
},
3998
},
4099
],
41-
reporter: process.env.CI
42-
? [
43-
["github"],
44-
["html", { open: "never" }],
45-
// S3 video uploader (runs first to upload videos)
46-
[
47-
"./reporters/s3-video-reporter.ts",
48-
{
49-
outputFile: "test-results/video-urls.json",
50-
uploadVideos: true,
51-
},
52-
],
53-
// Slack notifications (runs after videos are uploaded)
54-
[
55-
"./node_modules/playwright-slack-report/dist/src/SlackReporter.js",
56-
{
57-
slackWebHookUrl: process.env.SLACK_WEBHOOK_URL,
58-
sendResults: "always", // always send results
59-
maxNumberOfFailuresToShow: 10,
60-
layout: generateSimpleLayout, // Use our simple layout
61-
},
62-
],
63-
]
64-
: process.env.SLACK_WEBHOOK_URL && process.env.AWS_S3_BUCKET_NAME
65-
? [
66-
// Full local testing with S3 + Slack (when both are configured)
67-
[
68-
"./reporters/s3-video-reporter.ts",
69-
{
70-
outputFile: "test-results/video-urls.json",
71-
uploadVideos: true,
72-
},
73-
],
74-
[
75-
"./node_modules/playwright-slack-report/dist/src/SlackReporter.js",
76-
{
77-
slackWebHookUrl: process.env.SLACK_WEBHOOK_URL,
78-
sendResults: "always",
79-
maxNumberOfFailuresToShow: 10,
80-
layout: generateSimpleLayout,
81-
},
82-
],
83-
["html", { open: "never" }],
84-
]
85-
: [
86-
// Standard local testing
87-
["./clean-reporter.js"],
88-
["html", { open: "never" }],
89-
],
100+
reporter: getReporters(),
90101
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- '.'

typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test("[Agno] Agentic Chat sends and receives a greeting message", async ({
1111
}) => {
1212
await retryOnAIFailure(async () => {
1313
await page.goto(
14-
"https://ag-ui-dojo-nine.vercel.app/agno/feature/agentic_chat"
14+
"/agno/feature/agentic_chat"
1515
);
1616

1717
const chat = new AgenticChatPage(page);
@@ -31,7 +31,7 @@ test("[Agno] Agentic Chat provides stock price information", async ({
3131
}) => {
3232
await retryOnAIFailure(async () => {
3333
await page.goto(
34-
"https://ag-ui-dojo-nine.vercel.app/agno/feature/agentic_chat"
34+
"/agno/feature/agentic_chat"
3535
);
3636

3737
const chat = new AgenticChatPage(page);
@@ -54,7 +54,7 @@ test("[Agno] Agentic Chat retains memory of previous questions", async ({
5454
}) => {
5555
await retryOnAIFailure(async () => {
5656
await page.goto(
57-
"https://ag-ui-dojo-nine.vercel.app/agno/feature/agentic_chat"
57+
"/agno/feature/agentic_chat"
5858
);
5959

6060
const chat = new AgenticChatPage(page);
@@ -72,7 +72,7 @@ test("[Agno] Agentic Chat retains memory of previous questions", async ({
7272
await chat.sendMessage("What was my first question");
7373
await chat.assertUserMessageVisible("What was my first question");
7474
await waitForAIResponse(page);
75-
75+
7676
// Check if the agent remembers the first question about AAPL stock price
7777
await chat.assertAgentReplyVisible(/Hi/i);
7878
});
@@ -83,7 +83,7 @@ test("[Agno] Agentic Chat retains memory of user messages during a conversation"
8383
}) => {
8484
await retryOnAIFailure(async () => {
8585
await page.goto(
86-
"https://ag-ui-dojo-nine.vercel.app/agno/feature/agentic_chat"
86+
"/agno/feature/agentic_chat"
8787
);
8888

8989
const chat = new AgenticChatPage(page);

typescript-sdk/apps/dojo/e2e/tests/agnoTests/toolBasedGenUIPage.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
22
import { ToolBaseGenUIPage } from "../../pages/agnoPages/ToolBaseGenUIPage";
33

44
const pageURL =
5-
"https://ag-ui-dojo-nine.vercel.app/agno/feature/tool_based_generative_ui";
5+
"/agno/feature/tool_based_generative_ui";
66

77
test('[Agno] Haiku generation and display verification', async ({
88
page,

typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test("[CrewAI] Agentic Chat sends and receives a message", async ({
1111
}) => {
1212
await retryOnAIFailure(async () => {
1313
await page.goto(
14-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/agentic_chat"
14+
"/crewai/feature/agentic_chat"
1515
);
1616

1717
const chat = new AgenticChatPage(page);
@@ -31,7 +31,7 @@ test("[CrewAI] Agentic Chat changes background on message and reset", async ({
3131
}) => {
3232
await retryOnAIFailure(async () => {
3333
await page.goto(
34-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/agentic_chat"
34+
"/crewai/feature/agentic_chat"
3535
);
3636

3737
const chat = new AgenticChatPage(page);
@@ -79,7 +79,7 @@ test("[CrewAI] Agentic Chat retains memory of user messages during a conversatio
7979
}) => {
8080
await retryOnAIFailure(async () => {
8181
await page.goto(
82-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/agentic_chat"
82+
"/crewai/feature/agentic_chat"
8383
);
8484

8585
const chat = new AgenticChatPage(page);

typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticGenUI.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test.describe("Agent Generative UI Feature", () => {
88
const genUIAgent = new AgenticGenUIPage(page);
99

1010
await page.goto(
11-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/agentic_generative_ui"
11+
"/crewai/feature/agentic_generative_ui"
1212
);
1313

1414
await genUIAgent.openChat();
@@ -39,7 +39,7 @@ test.describe("Agent Generative UI Feature", () => {
3939
const genUIAgent = new AgenticGenUIPage(page);
4040

4141
await page.goto(
42-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/agentic_generative_ui"
42+
"/crewai/feature/agentic_generative_ui"
4343
);
4444

4545
await genUIAgent.openChat();

typescript-sdk/apps/dojo/e2e/tests/crewAITests/humanInTheLoopPage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test.describe("Human in the Loop Feature", () => {
99
const humanInLoop = new HumanInLoopPage(page);
1010

1111
await page.goto(
12-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/human_in_the_loop"
12+
"/crewai/feature/human_in_the_loop"
1313
);
1414

1515
await humanInLoop.openChat();
@@ -52,7 +52,7 @@ test.describe("Human in the Loop Feature", () => {
5252
const humanInLoop = new HumanInLoopPage(page);
5353

5454
await page.goto(
55-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/human_in_the_loop"
55+
"/crewai/feature/human_in_the_loop"
5656
);
5757

5858
await humanInLoop.openChat();

typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test.describe("Predictive Status Updates Feature", () => {
1515

1616
// Update URL to new domain
1717
await page.goto(
18-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/predictive_state_updates"
18+
"/crewai/feature/predictive_state_updates"
1919
);
2020

2121
await predictiveStateUpdates.openChat();
@@ -52,7 +52,7 @@ test.describe("Predictive Status Updates Feature", () => {
5252

5353
// Update URL to new domain
5454
await page.goto(
55-
"https://ag-ui-dojo-nine.vercel.app/crewai/feature/predictive_state_updates"
55+
"/crewai/feature/predictive_state_updates"
5656
);
5757

5858
await predictiveStateUpdates.openChat();

0 commit comments

Comments
 (0)