feat: 整理目录结构
Some checks failed
/ playwright (push) Has been skipped
/ surge (push) Failing after 36s
/ lint-build-and-check (push) Failing after 55s
/ build-and-deploy-to-vercel (push) Failing after 1m13s
/ depcheck (push) Has been cancelled

This commit is contained in:
严浩
2025-03-25 10:36:19 +08:00
parent 2482608a2e
commit 2df09cf33f
13 changed files with 21 additions and 21 deletions

View File

@ -0,0 +1,9 @@
import { expect, test } from '@playwright/test';
test('接口请求页面', async ({ page }) => {
await page.goto('/Tool/API');
// /fake-api 正常返回。
await expect(page.locator('pre')).toContainText('http://dummyimage.com/200x200');
// // /npm-registry-api 正常返回。
// await expect(page.locator('#app')).toContainText('@vue/babel-plugin-jsx');
});

View File

@ -0,0 +1,18 @@
import { test } from '@playwright/test';
import { consola } from 'consola';
test('页面加载正常', async ({ page }, testInfo) => {
await page.goto('/');
consola.info(`page.url() === ${page.url()}`);
// await expect(page.getByRole('link', { name: '中文-页面.page.vue' })).toBeVisible();
// 截图并将其附加到测试结果
await testInfo.attach('screenshot', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' });
// 查找包含"commit:"文本的元素
const commitElement = page.locator('text=commit:').first();
// 获取元素的文本内容
const innerText = await commitElement.textContent();
consola.debug(`Commit 文本内容: "${innerText}"`);
});