upskill-event-manager/wordpress-dev/tests/e2e/check-page-contents.test.ts

40 lines
No EOL
1.5 KiB
TypeScript

import { STAGING_URL, PATHS, TIMEOUTS } from './config/staging-config';
import { test, expect } from '@playwright/test';
test.describe('Page Content Verification', () => {
test('verify login page structure', async ({ page }) => {
// Visit the login page
await page.goto('https://upskill-staging.measurequick.com/community-login/');
// Get the page content
const pageContent = await page.content();
// Log the page content for debugging
console.log('Page content:', pageContent.substring(0, 500) + '...');
// Check if the content has a login form
const hasLoginForm = pageContent.includes('login') || pageContent.includes('Login');
expect(hasLoginForm).toBeTruthy();
// Take a screenshot of the page
await page.screenshot({ path: 'login-page.png' });
});
test('verify dashboard page structure', async ({ page }) => {
// Visit the dashboard page
await page.goto('https://upskill-staging.measurequick.com/hvac-dashboard/');
// Get the page content
const pageContent = await page.content();
// Log the page content for debugging
console.log('Page content:', pageContent.substring(0, 500) + '...');
// Check if the content has dashboard elements
const hasDashboardContent = pageContent.includes('dashboard') || pageContent.includes('Dashboard');
expect(hasDashboardContent).toBeTruthy();
// Take a screenshot of the page
await page.screenshot({ path: 'dashboard-page.png' });
});
});