import { test, expect } from '../support/fixtures';

test.describe('Example Test Suite', () => {
    test('should load homepage', async ({ page }) => {
        // Navigating to the base URL
        await page.goto('/');

        // Check that we're on the right page
        // Note: Adjust the title expectation to match your actual app title
        await expect(page).toHaveTitle(/Test01/i);

        // Example of using data-testid selector (preferred)
        // await expect(page.getByTestId('main-container')).toBeVisible();
    });

    test('should create valid user data using factory', async ({ userFactory }) => {
        // This demonstrates using the factory to generate data
        // Even though we don't login yet, it proves the factory works
        const user = await userFactory.createUser();

        expect(user.email).toBeTruthy();
        expect(user.email).toContain('@');
        expect(user.password).toBeTruthy();

        // Console log to debug (remove in real tests)
        console.log('Generated test user:', user.name);
    });
});
