init 003_test,

This commit is contained in:
2025-05-16 11:13:50 +08:00
parent 3e3e23aa68
commit 2371e40ad2
59 changed files with 1937 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

View File

@@ -0,0 +1,30 @@
import { test, expect } from '@playwright/test';
import { HELLO } from '../_config/helloworld';
test('fresh user should appears sign in page', async ({ page }) => {
await page.goto('http://192.168.222.199:3000/dashboard');
console.log({ HELLO });
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Sign in | Custom | Auth | demo cms/);
});
// test('fresh user login', async ({ page }) => {
// await page.goto('http://192.168.222.199:3000/dashboard');
// // Expect a title "to contain" a substring.
// const emailField = page.getByPlaceholder('e.g. admin@123.com');
// await emailField.press('Enter');
// });
// test('get started link', async ({ page }) => {
// await page.goto('https://playwright.dev/');
// // Click the get started link.
// await page.getByRole('link', { name: 'Get started' }).click();
// // Expects page to have a heading with the name of Installation.
// await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
// });