towerops/e2e/tests/activity-feed.spec.ts
Graham McIntire d5b0f38ed6
feat: add remaining e2e tests and fix 'too many open files' error
- Added e2e tests for auth flows (registration, login, password reset, TOTP)
- Added e2e tests for onboarding and organization creation
- Added e2e tests for team collaboration (org switching, invitations)
- Added e2e tests for activity feed
- Added e2e tests for device graphs (sensors, time ranges, interfaces)
- Added e2e tests for MikroTik backup comparison
- Added e2e tests for sites map (geographic view)
- Added e2e tests for network trace tool

- Fixed 'too many open files' error by configuring Phoenix code reloader
  to ignore deps/, _build/, node_modules/, e2e/, and other non-source directories
- This prevents the file system watcher from monitoring unnecessary files
2026-03-06 17:08:27 -06:00

74 lines
2.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Activity Feed', () => {
test('can access organization activity feed', async ({ page }) => {
await page.goto('/activity');
await expect(page).toHaveURL(/\/activity/);
await expect(page.locator('body')).toBeVisible();
});
test('shows activity entries', async ({ page }) => {
await page.goto('/activity');
// Look for activity items
const activityEntry = page.locator(
'[data-activity], .activity-item, [role="listitem"]'
).first();
if (await activityEntry.isVisible({ timeout: 2000 }).catch(() => false)) {
await expect(activityEntry).toBeVisible();
}
});
test('can filter activity by type', async ({ page }) => {
await page.goto('/activity');
// Look for filter controls
const filterControl = page.locator(
'select[name*="type"], button:has-text("Filter"), [role="tab"]'
).first();
if (await filterControl.isVisible({ timeout: 2000 }).catch(() => false)) {
await expect(filterControl).toBeVisible();
}
});
test('can filter activity by date range', async ({ page }) => {
await page.goto('/activity');
// Look for date filters
const dateFilter = page.locator(
'input[type="date"], button:has-text("Date")'
).first();
if (await dateFilter.isVisible({ timeout: 2000 }).catch(() => false)) {
await expect(dateFilter).toBeVisible();
}
});
test('shows activity details', async ({ page }) => {
await page.goto('/activity');
// Look for activity metadata (user, timestamp, action)
const activityMeta = page.locator(
':has-text("ago"), time, [data-timestamp]'
).first();
if (await activityMeta.isVisible({ timeout: 2000 }).catch(() => false)) {
await expect(activityMeta).toBeVisible();
}
});
test('can search activity', async ({ page }) => {
await page.goto('/activity');
// Look for search input
const searchInput = page.locator('input[type="search"], input[placeholder*="Search"]').first();
if (await searchInput.isVisible({ timeout: 2000 }).catch(() => false)) {
await searchInput.fill('test');
await page.waitForTimeout(500);
}
});
});