mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
more cleanup
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { test as base, expect, waitForLoadingDone } from './fixtures.electron.packaged';
|
||||
import { Page } from '@playwright/test';
|
||||
import { showTestName, clearTestName } from './test-overlay';
|
||||
import { join } from 'path';
|
||||
|
||||
const { runningQuotes } = require('./basic-mcp');
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { test, expect, waitForLoadingDone } from './fixtures.electron.packaged';
|
||||
|
||||
const LLM_TIMEOUT = 90000;
|
||||
const LLM_TIMEOUT = 30000;
|
||||
const PLAYWRIGHT_DEEPLINK =
|
||||
'goose://extension?cmd=npx&arg=-y&arg=@playwright/mcp@latest&id=playwright&name=Playwright&description=Modern%20web%20testing%20and%20automation';
|
||||
|
||||
test.describe('Goose App Extensions', () => {
|
||||
test.describe('Goose App Extensions', {tag: '@release'}, () => {
|
||||
test('install playwright extension and run a google cats search', async ({ goosePage }) => {
|
||||
const mainWindow = goosePage;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { test, expect, waitForLoadingDone } from './fixtures.electron.packaged';
|
||||
|
||||
const LLM_TIMEOUT = 30000;
|
||||
|
||||
test.describe('Goose App', () => {
|
||||
test.describe('Goose App', {tag: '@release'}, () => {
|
||||
test('goose conversation', async ({ goosePage }) => {
|
||||
const mainWindow = goosePage;
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
const isVideoRecording = () => process.env.PW_ELECTRON_VIDEO === '1';
|
||||
|
||||
// Helper function to show test name overlay
|
||||
async function showTestName(mainWindow: any, testName: string, providerName?: string) {
|
||||
await mainWindow.evaluate(({ name, provider }: { name: string, provider?: string }) => {
|
||||
// Remove any existing overlay
|
||||
const existing = document.getElementById('test-overlay');
|
||||
if (existing) existing.remove();
|
||||
|
||||
// Create new overlay
|
||||
const overlay = document.createElement('div');
|
||||
overlay.id = 'test-overlay';
|
||||
overlay.style.cssText = `
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
padding: 12px 16px;
|
||||
border-radius: 6px;
|
||||
font-family: monospace;
|
||||
font-size: 14px;
|
||||
z-index: 2147483647; // maximum z-index integer value
|
||||
pointer-events: none !important;
|
||||
text-align: center;
|
||||
max-width: 80%;
|
||||
white-space: pre-wrap;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
`;
|
||||
|
||||
const testText = `Running: ${name}`;
|
||||
const providerText = provider ? `\nProvider: ${provider}` : '';
|
||||
overlay.textContent = testText + providerText;
|
||||
|
||||
// Insert at the beginning of <html> to ensure it's above everything
|
||||
document.documentElement.insertBefore(overlay, document.documentElement.firstChild);
|
||||
|
||||
// Force a repaint to ensure the overlay is visible
|
||||
overlay.getBoundingClientRect();
|
||||
}, { name: testName, provider: providerName });
|
||||
|
||||
// Hold overlay visible so it's readable in the video
|
||||
if (isVideoRecording()) {
|
||||
await mainWindow.waitForTimeout(1500);
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to clear test name overlay
|
||||
async function clearTestName(mainWindow: any) {
|
||||
// Pause before clearing so the final state is captured in the video
|
||||
if (isVideoRecording()) {
|
||||
await mainWindow.waitForTimeout(1000);
|
||||
}
|
||||
await mainWindow.evaluate(() => {
|
||||
const overlay = document.getElementById('test-overlay');
|
||||
if (overlay) overlay.remove();
|
||||
});
|
||||
}
|
||||
|
||||
export { showTestName, clearTestName };
|
||||
Reference in New Issue
Block a user