Skip to content

Commit 9ea3506

Browse files
authored
Merge pull request #92 from sidclawhq/fix/browser-specs-v2-landing-and-auth
fix(browser-tests): V2 landing assertions, real auth selectors, demo specs split out
2 parents ff0042c + 5d6f7dd commit 9ea3506

5 files changed

Lines changed: 37 additions & 28 deletions

File tree

playwright.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ export default defineConfig({
5959
name: 'e2e',
6060
dependencies: ['setup'],
6161
testMatch: 'specs/**/*.spec.ts',
62+
// The demo specs target the vertical demo apps (ports 3003-3005),
63+
// which this config does not manage. Run them explicitly with the
64+
// demo apps up: npx playwright test --project=demos
65+
testIgnore: 'specs/demo/**',
66+
},
67+
{
68+
name: 'demos',
69+
dependencies: ['setup'],
70+
testMatch: 'specs/demo/**/*.spec.ts',
6271
},
6372
],
6473
});

tests/browser/global-setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ setup('create admin session', async ({ browser }) => {
2929
} else {
3030
// Fall back to email signup
3131
await page.goto('http://localhost:3000/signup');
32-
await page.fill('input[name="name"]', 'E2E Admin');
33-
await page.fill('input[name="email"]', 'e2e-admin@test.com');
34-
await page.fill('input[name="password"]', 'E2ETest2026!');
32+
await page.fill('#name', 'E2E Admin');
33+
await page.fill('#email', 'e2e-admin@test.com');
34+
await page.fill('#password', 'E2ETest2026!');
3535
await page.click('button[type="submit"]');
3636
await page.waitForURL('**/dashboard**', { timeout: 15000 });
3737
}

tests/browser/helpers/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { Page } from '@playwright/test';
22

33
export async function loginAsNewUser(page: Page, name: string, email: string, password: string) {
44
await page.goto('/signup');
5-
await page.fill('input[name="name"]', name);
6-
await page.fill('input[name="email"]', email);
7-
await page.fill('input[name="password"]', password);
5+
await page.fill('#name', name);
6+
await page.fill('#email', email);
7+
await page.fill('#password', password);
88
await page.click('button[type="submit"]');
99
await page.waitForURL('**/dashboard**', { timeout: 15000 });
1010
}

tests/browser/helpers/selectors.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export const selectors = {
1515

1616
// Auth
1717
auth: {
18-
nameInput: 'input[name="name"]',
19-
emailInput: 'input[name="email"]',
20-
passwordInput: 'input[name="password"]',
18+
nameInput: '#name',
19+
emailInput: '#email',
20+
passwordInput: '#password',
2121
submitButton: 'button[type="submit"]',
2222
githubButton: '[data-testid="github-oauth"]',
2323
googleButton: '[data-testid="google-oauth"]',
@@ -29,7 +29,7 @@ export const selectors = {
2929
createButton: '[data-testid="create-agent"]',
3030
table: '[data-testid="agent-table"]',
3131
row: '[data-testid="agent-row"]',
32-
nameInput: 'input[name="name"]',
32+
nameInput: '#name',
3333
descriptionInput: 'textarea[name="description"]',
3434
ownerNameInput: 'input[name="owner_name"]',
3535
ownerRoleInput: 'input[name="owner_role"]',

tests/browser/specs/01-landing-page.spec.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,43 @@ import { expectNoHorizontalOverflow } from '../helpers/assertions';
55
const LANDING_URL = 'http://localhost:3002';
66

77
test.describe('Landing Page', () => {
8-
test('loads with hero section containing approval/accountability/agentic', async ({ page }) => {
8+
test('loads with V2 hero: "the missing control plane for agentic AI"', async ({ page }) => {
99
await page.goto(LANDING_URL);
1010

1111
const h1 = page.locator('h1');
1212
await expect(h1).toBeVisible();
1313

1414
const text = await h1.textContent();
15-
expect(text?.toLowerCase()).toContain('approval');
16-
expect(text?.toLowerCase()).toContain('accountability');
15+
expect(text?.toLowerCase()).toContain('control plane');
1716
expect(text?.toLowerCase()).toContain('agentic');
1817
});
1918

20-
test('"Get Started Free" button links to signup', async ({ page }) => {
19+
test('"Start Free" CTA links to signup', async ({ page }) => {
2120
await page.goto(LANDING_URL);
2221

23-
const cta = page.locator('a', { hasText: 'Get Started Free' });
22+
const cta = page.locator('a', { hasText: 'Start Free' }).first();
2423
await expect(cta).toBeVisible();
2524

2625
const href = await cta.getAttribute('href');
2726
expect(href).toContain('signup');
2827
});
2928

30-
test('"View on GitHub" links to github.com/sidclawhq', async ({ page }) => {
29+
test('links to github.com/sidclawhq', async ({ page }) => {
3130
await page.goto(LANDING_URL);
3231

33-
const ghLink = page.locator('a', { hasText: 'View on GitHub' });
32+
// Multiple GitHub links exist (nav, developer section, footer) — assert
33+
// at least one resolves to the org.
34+
const ghLink = page.locator('a[href*="github.com/sidclawhq"]').first();
3435
await expect(ghLink).toBeVisible();
35-
36-
const href = await ghLink.getAttribute('href');
37-
expect(href).toContain('github.com/sidclawhq');
3836
});
3937

40-
test('pricing section shows "5 agents" text', async ({ page }) => {
38+
test('compliance bar names FINRA and the EU AI Act', async ({ page }) => {
39+
// The V2 page has no pricing section; the compliance trust bar is its
40+
// regulated-market signal.
4141
await page.goto(LANDING_URL);
4242

43-
const pricing = page.locator('#pricing');
44-
await expect(pricing).toBeVisible();
45-
46-
await expect(pricing.locator('text=5 agents')).toBeVisible();
43+
await expect(page.locator('text=FINRA').first()).toBeVisible();
44+
await expect(page.locator('text=EU AI Act').first()).toBeVisible();
4745
});
4846

4947
test('has dark theme (#0A0A0B background)', async ({ page }) => {
@@ -67,10 +65,12 @@ test.describe('Landing Page', () => {
6765
await expectNoHorizontalOverflow(page);
6866
});
6967

70-
test('stats cite NeuralTrust source', async ({ page }) => {
68+
test('hero pitches identity, policy, approval, and audit', async ({ page }) => {
69+
// The V2 page dropped the NeuralTrust stat; the four-primitives pitch is
70+
// the stable content anchor.
7171
await page.goto(LANDING_URL);
7272

73-
const citation = page.locator('text=NeuralTrust');
74-
await expect(citation).toBeVisible();
73+
const heroCopy = page.locator('text=tamper-evident audit').first();
74+
await expect(heroCopy).toBeVisible();
7575
});
7676
});

0 commit comments

Comments
 (0)