Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(memory): add playwright coverage for memory v2

Steven Enamakel1f1d532d69d1
diff --git a/app/test/playwright/specs/memory-v2.spec.ts b/app/test/playwright/specs/memory-v2.spec.ts
index b0f7da259e..987704041b 100644
--- a/app/test/playwright/specs/memory-v2.spec.ts
+++ b/app/test/playwright/specs/memory-v2.spec.ts
@@ -389,14 +389,15 @@ test.describe('Memory v2 — engine active', () => {
});
await expect(page.getByTestId('memory-ask-tab')).toBeVisible();
- // Provider chip: the three CortexDB providers, TinyHumans in use.
+ // Provider chip: one CortexDB card, connected via TinyHumans.
await page.getByTestId('brain-tab-engine').click();
await expect.poll(() => hash(page)).toContain('brain=engine');
await expect(page.getByTestId('memory-engines')).toBeVisible();
await expect(page.getByTestId('memory-engine-builtin')).toBeVisible();
await expect(page.getByTestId('memory-engine-apikey')).toBeVisible();
await expect(page.getByTestId('memory-engine-selfhost')).toBeVisible();
- await expect(page.getByTestId('memory-engine-builtin-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-chip-active-builtin')).toBeVisible();
// 2. Ask: the recall answer and its citation render.
await page.getByTestId('brain-tab-ask').click();
@@ -588,22 +589,23 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
// Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
await openMemory(page, '&brain=engine');
- // Nothing connected: TinyHumans is one click from its card.
- const use = page.getByTestId('memory-engine-builtin-action');
+ // Nothing connected: the card opens on TinyHumans, one click away.
+ const use = page.getByTestId('memory-engine-builtin-submit');
await expect(use).toBeEnabled({ timeout: 20_000 });
await use.click();
await expect.poll(() => fake.paramsOf('memory_engine_set')).toEqual([{ engine: 'tinyhumans' }]);
- await expect(page.getByTestId('memory-engine-builtin-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-chip-active-builtin')).toBeVisible();
});
- test('CortexDB Cloud connects with only a key', async ({ page }) => {
+ test('CortexDB with your API key connects with only a key', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: false });
await bootAuthenticatedPage(page, 'pw-memory-engine-apikey');
// Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
await openMemory(page, '&brain=engine');
- await page.getByTestId('memory-engine-apikey-action').click();
- await expect(page.getByTestId('memory-engine-modal')).toContainText('CortexDB Cloud');
+ await page.getByTestId('memory-engine-apikey').click();
+ await expect(page.getByTestId('memory-engine-panel-apikey')).toBeVisible();
const submit = page.getByTestId('memory-engine-apikey-submit');
await expect(submit).toBeDisabled(); // a key is required
await page.getByTestId('memory-engine-apikey-key').fill('pw-cortex-key');
@@ -612,7 +614,8 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
await expect
.poll(() => fake.paramsOf('memory_engine_set'))
.toEqual([{ engine: 'cortexdb', endpoint: '', api_key: 'pw-cortex-key' }]);
- await expect(page.getByTestId('memory-engine-apikey-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-chip-active-apikey')).toBeVisible();
});
test('CortexDB Local refuses a non-local endpoint and connects a local one', async ({ page }) => {
@@ -621,7 +624,7 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
// Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
await openMemory(page, '&brain=engine');
- await page.getByTestId('memory-engine-selfhost-action').click();
+ await page.getByTestId('memory-engine-selfhost').click();
await expect(page.getByTestId('memory-engine-selfhost-docs')).toBeVisible();
await page.getByTestId('memory-engine-selfhost-key').fill('pw-local-key');
@@ -642,7 +645,8 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
.toEqual([
{ engine: 'cortexdb', endpoint: 'http://localhost:3141', api_key: 'pw-local-key' },
]);
- await expect(page.getByTestId('memory-engine-selfhost-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-status')).toHaveText('In use');
+ await expect(page.getByTestId('memory-engine-chip-active-selfhost')).toBeVisible();
});
test('TinyHumans is not selectable without a TinyHumans account', async ({ page }) => {
@@ -666,12 +670,10 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
await dismissWalkthroughIfPresent(page);
await expect(page.getByTestId('memory-page')).toBeVisible({ timeout: 30_000 });
- await expect(page.getByTestId('memory-engine-builtin-status')).toHaveText('Sign in to use', {
+ await expect(page.getByTestId('memory-engine-builtin-sign-in')).toBeVisible({
timeout: 20_000,
});
- await expect(page.getByTestId('memory-engine-builtin-action')).toBeDisabled();
- await page.getByTestId('memory-engine-builtin-settings').click();
- await expect(page.getByTestId('memory-engine-builtin-sign-in')).toBeVisible();
+ await expect(page.getByTestId('memory-engine-builtin-submit')).toBeDisabled();
expect(fake.paramsOf('memory_engine_set')).toEqual([]);
});
});