Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
- name: Publish to vsce
run: npx vsce publish --pat ${{ secrets.VSCODE_PUBLISH_PAT }}

- name: Publish to OpenVSIX
run: npx ovsx publish --pat ${{ secrets.OPENVSIX_PUBLISH_TOKEN }}

- name: Extract version from package.json
id: get_version
run: |
Expand Down
38 changes: 37 additions & 1 deletion media/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TestDriverWebview {
this.emptyState = document.getElementById('emptyState');
this.isRunning = false;
this.streamingMessages = new Map();
this.showSuggestedAfterExample = false; // Track if we should show suggested prompts after example

this.init();
}
Expand Down Expand Up @@ -223,6 +224,9 @@ class TestDriverWebview {
case 'showInputAndRunButton':
this.showInputAndRunButton();
break;
case 'showSuggestedPromptsAfterExample':
this.showSuggestedPromptsAfterExample();
break;
case 'error':
this.addMessage(message.data, 'error', '❌');
this.isRunning = false;
Expand Down Expand Up @@ -252,7 +256,11 @@ class TestDriverWebview {
}

addMessage(content, type = 'assistant', _avatar = '🤖') {
this.hideEmptyState();
// Only hide empty state if we're not showing suggested prompts after example
// or if this is a user message (which should always hide empty state)
if (!this.showSuggestedAfterExample || type === 'user') {
this.hideEmptyState();
}

const messageDiv = document.createElement('div');
messageDiv.className = `message ${type}`;
Expand Down Expand Up @@ -328,6 +336,12 @@ class TestDriverWebview {
return;
}

// If we're showing suggested prompts after example, hide them now on first user message
if (this.showSuggestedAfterExample) {
this.hideEmptyState();
this.showSuggestedAfterExample = false;
}

this.addMessage(message, 'user');
this.chatInput.value = '';
this.isRunning = true;
Expand Down Expand Up @@ -670,6 +684,28 @@ class TestDriverWebview {
}
}

showSuggestedPromptsAfterExample() {
// Set flag to show suggested prompts and keep them visible until first user message
this.showSuggestedAfterExample = true;

// Ensure the empty state is visible with suggested prompts
if (this.emptyState) {
this.emptyState.style.display = 'flex';

// Restore the complete empty state HTML with the correct suggested prompts
this.emptyState.innerHTML = `
<img src="${window.mediaSrc}/icon.png" alt="TestDriver" class="helmet-large" />
<h3>Example copied successfully!</h3>
<p>Your test file has been created. Try one of these prompts to get started:</p>
<div class="example-prompts" id="examplePrompts">
<button class="example-prompt" onclick="fillInput('Assert the app loads properly')">Assert the app loaded</button>
<button class="example-prompt" onclick="fillInput('Test the login form with valid credentials')">Test the login form with valid credentials</button>
<button class="example-prompt" onclick="fillInput('Close the browser')">Close the browser</button>
</div>
`;
}
}

focusInput() {
this.chatInput.focus();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"testdriver-activity": [
{
"id": "testdriver-sidebar",
"name": "Chat",
"name": "Agent",
"type": "webview",
"icon": "$(comment-discussion)"
}
Expand Down
5 changes: 5 additions & 0 deletions src/commands/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ async function copyExampleToWorkspace(exampleName: string, workspaceFolder: vsco
fileName: mainFileName
});

// Show suggested prompts after copying example
webview.postMessage({
command: 'showSuggestedPromptsAfterExample'
});

webview.postMessage({
command: 'chatResponse'
});
Expand Down
17 changes: 9 additions & 8 deletions src/utils/sidebarProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
overflow-y: hidden;
white-space: pre;
max-width: 100%;
color: #b3d334 !important;
word-wrap: normal; /* Don't break words in code */
}

Expand All @@ -729,7 +730,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
padding: 0 !important;
margin: 0 !important;
font-family: inherit !important;
color: var(--vscode-editor-foreground) !important;
color: #b3d334 !important;
white-space: pre;
overflow-wrap: normal;
}
Expand All @@ -745,7 +746,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {

.code-block code[class*="language-"] {
background: none !important;
color: var(--vscode-editor-foreground) !important;
color: #b3d334 !important;
}

/* Override Prism.js tokens to use VS Code colors */
Expand All @@ -763,7 +764,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
.token.constant,
.token.symbol,
.token.deleted {
color: var( #b3d334) !important;
color: #b3d334 !important;
}

.token.selector,
Expand All @@ -772,7 +773,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
.token.char,
.token.builtin,
.token.inserted {
color: var(#34d3d3) !important;
color: #b3d334 !important;
}

.token.operator,
Expand All @@ -786,18 +787,18 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
.token.atrule,
.token.attr-value,
.token.keyword {
color: var(#34d3d3) !important;
color: #34d3d3 !important;
}

.token.function,
.token.class-name {
color: var(#DCDCAA) !important;
color: #DCDCAA !important;
}

.token.regex,
.token.important,
.token.variable {
color: var(#9CDCFE) !important;
color: #9CDCFE !important;
}

/* VS Code icon styling */
Expand Down Expand Up @@ -1101,7 +1102,7 @@ export class TestDriverSidebarProvider implements vscode.WebviewViewProvider {
<h3>Welcome to TestDriver.ai</h3>
<p>Your AI-powered testing assistant. Describe what you want to test and I'll help you create automated test steps.</p>
<div class="example-prompts" id="examplePrompts">
<button class="example-prompt" onclick="fillInput('Assert the app loads proplerly')">Assert the app loaded</button>
<button class="example-prompt" onclick="fillInput('Assert the app loads properly')">Assert the app loaded</button>
<button class="example-prompt" onclick="fillInput('Test the login form with valid credentials')">Test the login form with valid credentials</button>
<button class="example-prompt" onclick="fillInput('Close the browser')">Close the browser</button>
</div>
Expand Down
13 changes: 13 additions & 0 deletions testdriver/testdriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 6.0.20
session: 68a3851d07c3e65375e906fe
steps:
- prompt: Assert the app loads proplerly
commands:
- command: hover-text
text: Google Chrome
description: >-
Google Chrome shortcut icon on the desktop with a circular red, green,
yellow, and blue icon
action: double-click
- command: wait
timeout: 3000
Loading