GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Inventionyin/UItest

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
constants
constants
 
 
data
data
 
 
docs
docs
 
 
fixtures
fixtures
 
 
helpers
helpers
 
 
pages
pages
 
 
reporters
reporters
 
 
scripts
scripts
 
 
tests
tests
 
 
types
types
 
 
utils
utils
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
debug-login.js
debug-login.js
 
 
open-allure-report.bat
open-allure-report.bat
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
playwright.config.ts
playwright.config.ts
 
 
run-ui-report-allure-headed.bat
run-ui-report-allure-headed.bat
 
 
run-ui-report-allure.bat
run-ui-report-allure.bat
 
 
run-ui-report-headed.bat
run-ui-report-headed.bat
 
 
run-ui-report.bat
run-ui-report.bat
 
 
tsconfig.json
tsconfig.json
 
 
ui-automation-conversation-summary.md
ui-automation-conversation-summary.md
 
 
双击打开Allure报告.bat
双击打开Allure报告.bat
 
 
双击运行UI自动化并生成Allure报告.bat
双击运行UI自动化并生成Allure报告.bat
 
 
双击运行UI自动化并生成Allure报告_有头模式.bat
双击运行UI自动化并生成Allure报告_有头模式.bat
 
 
双击运行UI自动化并生成Allure报告_有头模式_自动双开.bat
双击运行UI自动化并生成Allure报告_有头模式_自动双开.bat
 
 
双击运行UI自动化并生成Allure报告_自动双开.bat
双击运行UI自动化并生成Allure报告_自动双开.bat
 
 
双击运行UI自动化并生成报告.bat
双击运行UI自动化并生成报告.bat
 
 
双击运行UI自动化并生成报告_有头模式.bat
双击运行UI自动化并生成报告_有头模式.bat
 
 
双击运行UI自动化并生成报告_有头模式_自动双开.bat
双击运行UI自动化并生成报告_有头模式_自动双开.bat
 
 
双击运行UI自动化并生成报告_自动双开.bat
双击运行UI自动化并生成报告_自动双开.bat
 
 
提示词记录.md
提示词记录.md
 
 

Repository files navigation

元气购 UI 自动化测试仓库

UItest CI

这是一个基于 Playwright + TypeScript 的前端 UI 自动化测试项目,目标系统是本地运行的“元气购”电商前端。

默认目标地址:

  • 前端:http://localhost:5173
  • 登录页:/login

项目已经不是空骨架,而是一套可运行、可扩展、可交付的测试工程,包含:

  • Page Object 分层
  • fixtures 公共夹具
  • data 测试数据模板
  • helpers 公共等待/断言/报告封装
  • Playwright HTML 报告
  • Allure 报告
  • 中文双击运行脚本
  • GitHub Actions 基线检查

当前覆盖范围

当前已覆盖的核心页面与流程包括:

  • 首页
  • 底部导航
  • 登录 / 注册 / 找回密码
  • 搜索
  • 商品详情
  • 购物车
  • 结算
  • 我的页面
  • 订单 / 收藏 / 消息 / 售后 / 物流 / 评价
  • 未登录访问受保护页面时的重定向

工程约束

本仓库固定遵守以下规则:

  • locator 只允许出现在 pages/**/*.page.ts
  • tests/**/*.spec.ts 只消费 Page Object 与 data/*.ts
  • 不允许在 spec 中直接访问私有 page
  • 不以 waitForTimeout() 作为主要等待手段
  • 保留 pages / fixtures / helpers / data / constants / types 分层

目录结构

docs/         技术文档、测试设计、交付材料
tests/        测试用例
pages/        Page Object
fixtures/     Playwright fixtures
helpers/      等待、配置、断言、报告辅助
data/         测试数据模板
constants/    路由、消息、超时常量
types/        通用类型定义
utils/        重试与日志等基础工具
scripts/      报告执行脚本
reporters/    自定义报告器

快速开始

1. 安装依赖

npm install

2. 准备环境变量

复制 .env.example 为 .env,再按你的本地环境修改:

BASE_URL=http://localhost:5173
LOGIN_PATH=/login
TEST_USERNAME=YOUR_TEST_USERNAME
TEST_PASSWORD=YOUR_TEST_PASSWORD
HEADLESS=false
DEFAULT_TIMEOUT=15000
EXPECT_TIMEOUT=10000

说明:

  • TEST_USERNAME / TEST_PASSWORD 留空或保留占位值时,依赖真实账号的场景会自动跳过
  • BASE_URL 默认就是本地前端地址,前后端都启动后可以直接跑

3. 基线检查

npm run typecheck
npx playwright test --list
npm run test:contracts

4. 执行测试

npm test

常用命令:

npm run test:smoke
npm run test:core
npm run test:permission

报告使用

Playwright 报告

执行:

npm run test:report

产物位置:

  • playwright-report/index.html
  • output/reports/latest-test-report.md
  • output/reports/latest-test-report.json
  • output/reports/report-guide-zh.html

适用场景:

  • latest-test-report.md 适合快速看摘要
  • playwright-report/index.html 适合看失败细节、Trace、截图

Allure 报告

执行:

npm run test:allure

产物位置:

  • allure-results/
  • allure-report/

补充说明:

  • 现在所有通过 fixture 注入的 Page Object 方法,都会自动写入 Allure 步骤
  • 每个步骤会自动附带截图凭证
  • 失败步骤也会先截图再抛错

Windows 双击脚本

仓库内已经提供中文双击脚本:

  • 双击运行UI自动化并生成报告.bat
  • 双击运行UI自动化并生成报告_有头模式.bat
  • 双击运行UI自动化并生成Allure报告.bat
  • 双击运行UI自动化并生成Allure报告_有头模式.bat
  • 双击打开Allure报告.bat

适合不想敲命令时直接双击执行。

GitHub Actions

仓库已提供基础 CI:

  • typecheck
  • npx playwright test --list
  • npx playwright test tests/contracts

说明:

  • 这套 CI 默认验证的是“工程基线是否健康”
  • 不直接在 GitHub 上跑真实业务 UI 场景,因为业务场景依赖你的本地或指定测试环境
  • 如果后续要接入测试环境地址、测试账号、自动化部署环境,可以在现有 workflow 基础上继续扩展

适合分享给别人什么

如果要把执行结果发给别人,建议发:

  • playwright-report/
  • output/reports/

如果对方还要自己重新生成 Allure,再补发:

  • allure-results/

验证建议

每次改动后,建议至少执行:

npm run typecheck
npx playwright test --list
npm run test:contracts

在接入真实环境后,再执行:

npx playwright test

版本交付

首版交付说明见:

  • docs/release-notes-v1.0.0.md

如果你要继续往外展示或交作业,推荐下一步补:

  • GitHub Releases
  • Actions 状态徽标
  • .env 字段说明表
  • 针对真实测试环境的夜间定时任务

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.