51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { login } from './helpers/auth';
|
|
|
|
test.describe('Accounting', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await login(page);
|
|
});
|
|
|
|
test('chart of accounts page loads', async ({ page }) => {
|
|
await page.goto('/accounting');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
|
});
|
|
|
|
test('accounting sub-nav visible', async ({ page }) => {
|
|
await page.goto('/accounting');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('a').filter({ hasText: /Expenses/ }).first()).toBeVisible();
|
|
});
|
|
|
|
test('journal entries page loads', async ({ page }) => {
|
|
await page.goto('/accounting/journal-entries');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
|
});
|
|
|
|
test('expenses page loads', async ({ page }) => {
|
|
await page.goto('/accounting/expenses');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
|
});
|
|
|
|
test('company accounts page loads', async ({ page }) => {
|
|
await page.goto('/accounting/company-accounts');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
|
});
|
|
|
|
test('financial reports page loads', async ({ page }) => {
|
|
await page.goto('/accounting/reports');
|
|
await page.waitForTimeout(3000);
|
|
await expect(page.locator('text=Trial Balance').first()).toBeVisible({ timeout: 15000 });
|
|
});
|
|
|
|
test('accounting link in sidebar', async ({ page }) => {
|
|
await page.goto('/dashboard');
|
|
await page.waitForTimeout(2000);
|
|
await expect(page.locator('a[href="/accounting"]')).toBeVisible();
|
|
});
|
|
});
|