mirror of
https://github.com/TheCoolQATeam/online-inspection-tracker.git
synced 2026-06-04 21:03:44 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2914802177 | ||
|
|
1e110a8579 | ||
|
|
b427f0526c | ||
|
|
ec9fecfc32 | ||
|
|
62c3dc2ec4 | ||
|
|
5fb66847c6 | ||
|
|
659009a817 | ||
|
|
7f7d845795 | ||
|
|
1660892f44 | ||
|
|
1f91edbe62 | ||
|
|
7e02e69c84 | ||
|
|
8d901d9022 | ||
|
|
5ba7783ae3 | ||
|
|
97bc2cdbe4 | ||
|
|
1f24bc39cf | ||
|
|
fe5eeab849 | ||
|
|
ca2a446516 | ||
|
|
ab39ac7172 | ||
|
|
3193baf21f | ||
|
|
674ed4ce97 | ||
|
|
3f5270ef4c | ||
|
|
7394d994cd | ||
|
|
da94b500e0 |
304
README.MD
304
README.MD
@ -1,77 +1,267 @@
|
||||
## 项目名称
|
||||
线上UI自动化巡检项目
|
||||
# 线上UI自动化巡检项目
|
||||
|
||||
[English Version](README_EN.MD)
|
||||
|
||||
## 目录
|
||||
- [项目简介](#项目简介)
|
||||
- [功能特性](#功能特性)
|
||||
- [演示地址](#演示地址)
|
||||
- [致谢](#致谢)
|
||||
- [技术架构](#技术架构)
|
||||
- [快速开始](#快速开始)
|
||||
- [环境要求](#环境要求)
|
||||
- [Docker部署](#docker部署)
|
||||
- [本地开发部署](#本地开发部署)
|
||||
- [使用指南](#使用指南)
|
||||
- [添加巡检用例](#添加巡检用例)
|
||||
- [配置告警通知](#配置告警通知)
|
||||
- [查看巡检结果](#查看巡检结果)
|
||||
- [巡检规则](#巡检规则)
|
||||
- [项目结构](#项目结构)
|
||||
- [常见问题](#常见问题)
|
||||
- [贡献指南](#贡献指南)
|
||||
- [联系方式](#联系方式)
|
||||
- [许可证](#许可证)
|
||||
|
||||
## 项目简介
|
||||
|
||||
## 简介
|
||||
本项目是一个线上UI自动化巡检工具,旨在帮助开发人员和测试人员快速、高效地检测线上Web应用的UI界面是否存在异常。通过自动化巡检,可以及时发现并修复潜在的问题,提升用户体验和产品质量。
|
||||
|
||||
## demo
|
||||
- 地址:https://check.itest.ren/ @zdx0122
|
||||
-
|
||||
- 欢迎各位开发者提供已部署的项目供大家访问使用,共享巡检资源
|
||||
该项目利用Playwright自动化测试框架,定期访问配置的网页URL,检查页面是否正常加载,并进行像素级别的页面对比,确保线上页面与基准图片保持一致。
|
||||
|
||||
## 功能特点
|
||||
- 自动化巡检:定时或实时执行巡检任务,无需人工干预。
|
||||
- 多种巡检规则:支持标题对比,页面视觉回归。
|
||||
- 实时反馈:巡检结果实时展示,包括问题截图、问题描述和定位信息。
|
||||
- 跨平台支持:支持主流浏览器和操作系统,满足不同环境需求。
|
||||
## 使用说明
|
||||
### 安装与部署
|
||||
- 克隆本项目至本地。
|
||||
- Docker部署,参考 doc/docker 部署手册.md
|
||||
- 本地启动
|
||||
- 基础环境:nodejs、jdk1.8、maven
|
||||
- mysql: 建表语句db/ddl.sql
|
||||
- online-server springboot项目,安装依赖后,一键启动即可,访问地址:访问地址:http://127.0.0.1:9091/
|
||||
- online-client vue项目,访问地址:http://127.0.0.1:5173/
|
||||
```
|
||||
npm install //安装依赖
|
||||
npm run dev // 启动
|
||||
```
|
||||
### 巡检用例录入
|
||||
- 点击左侧菜单“H5用例”
|
||||
- 点击“新增”按钮
|
||||
- 填写用例信息,包括H5页面标题、巡检URL地址、业务线、钉钉/企微/飞书告警群机器人的key值等
|
||||
- 提交
|
||||
## 功能特性
|
||||
|
||||
### 巡检规则
|
||||
- 每5分钟执行一次巡检任务
|
||||
- 巡检内容
|
||||
- 页面可用性检测(白屏)
|
||||
- 页面像素比对(相似度<60%)
|
||||
- 用例执行时长统计
|
||||
- 🤖 **自动化巡检**:定时执行巡检任务,无需人工干预
|
||||
- 🔍 **多种检测方式**:
|
||||
- 页面可用性检测(白屏检测)
|
||||
- 页面像素级别对比(视觉回归测试)
|
||||
- 页面标题验证
|
||||
- 📊 **实时结果展示**:可视化展示巡检结果,包含详细统计数据
|
||||
- 🚨 **即时告警通知**:支持钉钉、企业微信、飞书等多种通知方式
|
||||
- 🖼️ **截图对比**:自动保存问题页面截图,便于问题分析
|
||||
- ⚙️ **灵活配置**:支持自定义巡检频率、告警阈值等参数
|
||||
- 📱 **响应式界面**:基于Vue3构建的现代化前端界面
|
||||
|
||||
## 演示地址
|
||||
|
||||
### 巡检结果
|
||||
- 巡检结果将实时展示在指定页面中。
|
||||
- 菜单“巡检记录”,可以查看今日巡检记录。
|
||||
- 菜单“数据看板”,可以近一段时间用例执行数据。
|
||||
- 地址1: https://check.itest.ren/ @zdx0122
|
||||
- 地址2: https://check.aolifu.org/ @Oliverwqcwrw
|
||||
|
||||
欢迎各位开发者提供已部署的项目供大家访问使用,共享巡检资源。
|
||||
|
||||
## 致谢
|
||||
|
||||
本项目被收录在阮一峰老师的《科技爱好者周刊》第324期:[http://www.ruanyifeng.com/blog/2024/11/weekly-issue-324.html](http://www.ruanyifeng.com/blog/2024/11/weekly-issue-324.html)
|
||||
|
||||
感谢TesterHome社区公众号的帮助推广:[https://mp.weixin.qq.com/s/994En7SFl2TqXBuGvA-WQw](https://mp.weixin.qq.com/s/994En7SFl2TqXBuGvA-WQw)
|
||||
|
||||
感谢所有为项目贡献的开发者和使用者,以及提供演示环境的合作伙伴。
|
||||
|
||||
## 技术架构
|
||||
|
||||
| 组件 | 技术栈 |
|
||||
|------|--------|
|
||||
| 后端 | Java 8, Spring Boot 2.7.15, MyBatis |
|
||||
| 前端 | Vue 3, TypeScript, Ant Design Vue |
|
||||
| 自动化测试 | Playwright 1.11.0, TestNG |
|
||||
| 数据库 | MySQL 5.7+ |
|
||||
| 构建工具 | Maven, NPM |
|
||||
| 容器化 | Docker, Docker Compose |
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 环境要求
|
||||
|
||||
#### Docker部署方式
|
||||
- Docker 20.0+
|
||||
- Docker Compose 1.29+
|
||||
|
||||
#### 本地开发部署方式
|
||||
- **node version >= 20.0.0**
|
||||
- JDK 1.8
|
||||
- Maven 3.6+
|
||||
- MySQL 5.7+
|
||||
|
||||
### Docker部署
|
||||
|
||||
1. 克隆项目代码:
|
||||
```bash
|
||||
git clone https://github.com/TheCoolQATeam/online-inspection-tracker.git
|
||||
cd online-inspection-tracker
|
||||
```
|
||||
|
||||
2. 修改配置:
|
||||
编辑[docker/web/default.conf](docker/web/default.conf)文件,将`server_name 127.0.0.1`中的`127.0.0.1`替换为您的服务器IP。
|
||||
|
||||
3. 启动服务:
|
||||
```bash
|
||||
cd docker
|
||||
docker-compose -f docker-compose-arm64.yml up
|
||||
```
|
||||
|
||||
4. 访问应用:
|
||||
启动完成后,在浏览器中访问 `http://你的服务器IP:5173/`
|
||||
|
||||
### 本地开发部署
|
||||
|
||||
1. 克隆项目代码:
|
||||
```bash
|
||||
git clone https://github.com/TheCoolQATeam/online-inspection-tracker.git
|
||||
cd online-inspection-tracker
|
||||
```
|
||||
|
||||
2. 初始化数据库:
|
||||
```bash
|
||||
# 创建数据库
|
||||
mysql -u root -p -e "CREATE DATABASE online_inspection_tracker;"
|
||||
|
||||
# 执行DDL脚本创建表
|
||||
mysql -u root -p online_inspection_tracker < ../db/ddl.sql
|
||||
```
|
||||
|
||||
3. 启动后端服务:
|
||||
```bash
|
||||
cd online-server
|
||||
# 修改application.yml中的数据库连接配置
|
||||
mvn spring-boot:run
|
||||
```
|
||||
|
||||
4. 启动前端服务:
|
||||
```bash
|
||||
# node版本需要20.0.0以上
|
||||
cd online-client
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
5. 访问应用:
|
||||
- 后端API:http://127.0.0.1:9091/
|
||||
- 前端界面:http://127.0.0.1:5173/
|
||||
|
||||
## 使用指南
|
||||
|
||||
### 添加巡检用例
|
||||
|
||||
1. 在左侧导航栏点击"H5用例"
|
||||
2. 点击"新增"按钮
|
||||
3. 填写以下信息:
|
||||
- 页面标题:用于标识该巡检用例
|
||||
- 巡检URL地址:需要检测的网页地址
|
||||
- 业务线:用于分组管理
|
||||
- 告警通知配置:配置钉钉/企业微信/飞书机器人key(可选)
|
||||
4. 点击提交
|
||||
|
||||
### 配置告警通知
|
||||
|
||||
项目支持三种通知方式:
|
||||
|
||||
1. **钉钉机器人**:
|
||||
- 在钉钉群中添加自定义机器人
|
||||
- 获取Webhook地址中的access_token值
|
||||
- 在用例配置中填写告警机器人key
|
||||
|
||||
2. **企业微信机器人**:
|
||||
- 在企业微信群中添加机器人
|
||||
- 获取Webhook地址中的key值
|
||||
- 在用例配置中填写告警机器人key
|
||||
|
||||
3. **飞书机器人**:
|
||||
- 在飞书群中添加Webhook机器人
|
||||
- 获取Webhook地址中的token值
|
||||
- 在用例配置中填写告警机器人key
|
||||
|
||||
### 查看巡检结果
|
||||
|
||||
1. **巡检记录**:
|
||||
- 在左侧导航栏点击"巡检记录"
|
||||
- 可查看当天所有用例的执行情况
|
||||
|
||||
2. **数据看板**:
|
||||
- 在左侧导航栏点击"数据看板"
|
||||
- 可查看历史统计数据和趋势图表
|
||||
|
||||
## 巡检规则
|
||||
|
||||
系统默认每5分钟执行一次巡检任务,检测内容包括:
|
||||
|
||||
1. **页面可用性检测**:
|
||||
- 检查页面是否能正常访问
|
||||
- 检测是否存在白屏现象
|
||||
|
||||
2. **页面像素比对**:
|
||||
- 对比当前页面与基准图片的相似度
|
||||
- 当相似度低于60%时触发告警
|
||||
|
||||
3. **用例执行时长统计**:
|
||||
- 记录每次巡检的响应时间
|
||||
- 用于性能监控和趋势分析
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
.
|
||||
├── db # 数据库脚本
|
||||
├── docker # Docker配置文件
|
||||
├── docs # 文档资料
|
||||
├── online-client # 前端Vue项目
|
||||
│ ├── src
|
||||
│ │ ├── api # API接口封装
|
||||
│ │ ├── components # 公共组件
|
||||
│ │ ├── views # 页面视图
|
||||
│ │ └── ...
|
||||
│ └── ...
|
||||
├── online-server # 后端Spring Boot项目
|
||||
│ ├── src
|
||||
│ │ ├── controller # 控制器层
|
||||
│ │ ├── service # 服务层
|
||||
│ │ ├── mapper # 数据访问层
|
||||
│ │ └── ...
|
||||
│ └── ...
|
||||
└── ...
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 如何巡检需要登录的页面?
|
||||
|
||||
开源前考虑过这个问题,卡点主要是在登录信息泄露的安全风险上,所以开源版本未做这个功能。
|
||||
但可以在内部团队自行实现,自行实现容易考虑好安全风险,更加可控、合规。
|
||||
|
||||
自行实现是很简单的,主要原理是playwright支持浏览器上下文进行隔离测试,详情可参考:
|
||||
[Issue #3](https://github.com/TheCoolQATeam/online-inspection-tracker/issues/3)
|
||||
|
||||
### 异常用例告警
|
||||
- 页面标题比对错误,告警通知(需配置群机器人key)
|
||||
- 页面像素比对相似度<60%,告警通知(需配置群机器人key)
|
||||
## 技术栈
|
||||
- 编程语言:JAVA
|
||||
- 框架:SpringBoot
|
||||
- 自动化测试工具:playwright + testNg
|
||||
- 数据库:MySQL(5.7)
|
||||
- 前端技术:vue3
|
||||
## 贡献指南
|
||||
欢迎各位开发者贡献代码、文档和建议。在提交贡献之前,请遵循以下步骤:
|
||||
|
||||
Fork本项目至你的GitHub仓库。
|
||||
在你的仓库中创建并切换到新的开发分支。
|
||||
进行代码修改、添加文档或提交其他贡献。
|
||||
提交你的更改并推送至你的GitHub仓库。
|
||||
发起Pull Request至本项目的主分支。
|
||||
欢迎各位开发者贡献代码、文档和建议!
|
||||
|
||||
### 如何贡献
|
||||
|
||||
1. Fork本项目至你的GitHub仓库
|
||||
2. 在你的仓库中创建并切换到新的开发分支
|
||||
3. 进行代码修改、添加文档或提交其他贡献
|
||||
4. 提交你的更改并推送至你的GitHub仓库
|
||||
5. 发起Pull Request至本项目的主分支
|
||||
|
||||
我们将对提交的Pull Request进行审查和测试,一旦通过,将合并至主分支并发布新版本。
|
||||
|
||||
### 贡献巡检资源
|
||||
受机器资源限制,demo站点仅能使用少量URL供大家体验,欢迎各位开发者提供已部署的项目供大家访问使用,共享巡检资源
|
||||
|
||||
受机器资源限制,demo站点仅能使用少量URL供大家体验,欢迎各位开发者提供已部署的项目供大家访问使用,共享巡检资源。
|
||||
|
||||
## 联系方式
|
||||
|
||||
如有任何疑问、建议或需求,欢迎通过以下方式与我们联系:
|
||||
|
||||
- GitHub仓库留言
|
||||
- GitHub仓库提交ISSUE
|
||||
- 邮箱:zdx0122@gmail.com
|
||||
- 微信号:zdx0122,请备注"开源巡检"
|
||||
- 微信群交流
|
||||
- 添加微信zdx0122拉群(请备注:巡检开源,进群)
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#TheCoolQATeam/online-inspection-tracker&Date)
|
||||
|
||||
## 许可证
|
||||
|
||||
本项目采用Apache许可证。在使用本项目时,请遵守相关许可协议。
|
||||
82
README_EN.MD
Normal file
82
README_EN.MD
Normal file
@ -0,0 +1,82 @@
|
||||
## Project Name
|
||||
Online UI Automated Inspection Project
|
||||
|
||||
## Overview
|
||||
This project is an online UI automated inspection tool designed to help developers and testers quickly and efficiently detect any abnormalities in the UI interfaces of online web applications. Through automated inspections, potential issues can be identified and resolved promptly, enhancing user experience and product quality.
|
||||
|
||||
## demo
|
||||
- URL: https://check.itest.ren/ @zdx0122
|
||||
-
|
||||
- We welcome developers to provide deployed projects for public access and shared inspection resources.
|
||||
|
||||
## Features
|
||||
- Automated Inspection: Scheduled or real-time inspection tasks without manual intervention.
|
||||
- Multiple Inspection Rules: Supports title comparison and visual regression testing of pages.
|
||||
- Real-time Feedback: Inspection results are displayed in real-time, including screenshots of issues, problem descriptions, and localization information.
|
||||
- Cross-platform Support: Compatible with mainstream browsers and operating systems to meet diverse environmental needs.
|
||||
## Usage Instructions
|
||||
### Installation and Deployment
|
||||
- Clone this project to your local machine.。
|
||||
- For Docker deployment, refer to doc/docker 部署手册.md
|
||||
- Local Startup
|
||||
- Basic Environment:nodejs、jdk1.8、maven
|
||||
- mysql: Use the table creation statements in db/ddl.sql
|
||||
- online-server (Spring Boot project): After installing dependencies, start with one click. Access URL: http://127.0.0.1:9091/
|
||||
- online-client (Vue project): Access URL: http://127.0.0.1:5173/
|
||||
```
|
||||
npm install // to install dependencies
|
||||
npm run dev // to start
|
||||
```
|
||||
### Inspection Case Entry
|
||||
- Click on the "H5 用例" menu on the left.
|
||||
- Click the "新增" button
|
||||
- Fill in case information, including the H5 page title, inspection URL, business line, and DingTalk/WeChat Work/Feishu group robot key.
|
||||
- Submit
|
||||
|
||||
### Inspection Rules
|
||||
- Inspection tasks are executed every 5 minutes.
|
||||
- Inspection Content
|
||||
- Page availability check (white screen).
|
||||
- Page pixel comparison (similarity < 60%).
|
||||
- Case execution duration statistics.
|
||||
|
||||
|
||||
### Inspection Results
|
||||
- Inspection results are displayed in real-time on the designated page.
|
||||
- The "巡检记录" menu allows you to view today's inspection records.
|
||||
- The "数据看板" menu provides insights into case execution data over a recent period.
|
||||
|
||||
### Abnormal Case Alerts
|
||||
- Alerts are sent for incorrect page title comparisons (requires group robot key configuration).
|
||||
- Alerts are sent for page pixel comparison similarities below 60% (requires group robot key configuration).
|
||||
## Technology Stack
|
||||
- Programming Language: Java.
|
||||
- Framework: Spring Boot.
|
||||
- Automated Testing Tool: Playwright + TestNG.
|
||||
- Database: MySQL (5.7).
|
||||
- Frontend Technology: Vue 3.
|
||||
## Contribution Guidelines
|
||||
We welcome contributions in the form of code, documentation, and suggestions from all developers. Before submitting your contributions, please follow these steps:
|
||||
|
||||
Fork this project to your GitHub repository.
|
||||
Create and switch to a new development branch in your repository.
|
||||
Make code modifications, add documentation, or submit other contributions.
|
||||
Commit your changes and push them to your GitHub repository.
|
||||
Initiate a Pull Request to the main branch of this project.
|
||||
We will review and test the submitted Pull Request. Once approved, it will be merged into the main branch and a new version will be released.
|
||||
|
||||
### Contribution of Inspection Resources
|
||||
Due to limited machine resources, the demo site can only use a few URLs for public experience. We welcome developers to provide deployed projects for public access and shared inspection resources.
|
||||
|
||||
## Contact Information
|
||||
For any questions, suggestions, or needs, please contact us through the following channels:
|
||||
|
||||
- GitHub Repository Comment
|
||||
- Email:zdx0122@gmail.com
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#TheCoolQATeam/online-inspection-tracker&Date)
|
||||
|
||||
## License
|
||||
This project is licensed under the Apache License. Please adhere to the relevant license agreement when using this project.
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
FROM openjdk:8u342
|
||||
FROM openjdk:8-jre
|
||||
|
||||
# 切换apt源为http清华源
|
||||
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
|
||||
@ -35,7 +35,7 @@ RUN dpkg -i /google-chrome-stable_current_amd64.deb
|
||||
|
||||
MAINTAINER inspection
|
||||
EXPOSE 9091
|
||||
LABEL version="1.0.1" description="moonbox springboot镜像" by="inspection"
|
||||
LABEL version="1.0.1" description="线上巡检server镜像" by="inspection"
|
||||
|
||||
COPY onlineInspect.jar /inspection/
|
||||
|
||||
|
||||
Binary file not shown.
@ -1,95 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
|
||||
AppName=onlineInspect.jar
|
||||
|
||||
# JVM参数
|
||||
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
||||
APP_HOME=`pwd`
|
||||
LOG_PATH=$APP_HOME/logs/$AppName.log
|
||||
|
||||
if [ "$1" = "" ];
|
||||
then
|
||||
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status|package} \033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$AppName" = "" ];
|
||||
then
|
||||
echo -e "\033[0;31m 未输入应用名 \033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function start()
|
||||
{
|
||||
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
|
||||
|
||||
if [ x"$PID" != x"" ]; then
|
||||
echo "$AppName is running..."
|
||||
else
|
||||
BUILD_ID=dontKillMe
|
||||
nohup java $JVM_OPTS -jar ./target/$AppName --spring.profiles.active=publish> /dev/null 2>&1 &
|
||||
echo "Start $AppName success..."
|
||||
fi
|
||||
}
|
||||
|
||||
function stop()
|
||||
{
|
||||
echo "Stop $AppName"
|
||||
|
||||
PID=""
|
||||
query(){
|
||||
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
|
||||
}
|
||||
|
||||
query
|
||||
if [ x"$PID" != x"" ]; then
|
||||
kill -TERM $PID
|
||||
echo "$AppName (pid:$PID) exiting..."
|
||||
while [ x"$PID" != x"" ]
|
||||
do
|
||||
sleep 1
|
||||
query
|
||||
done
|
||||
echo "$AppName exited."
|
||||
else
|
||||
echo "$AppName already stopped."
|
||||
fi
|
||||
}
|
||||
|
||||
function restart()
|
||||
{
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
function status()
|
||||
{
|
||||
PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
|
||||
if [ $PID != 0 ];then
|
||||
echo "$AppName is running..."
|
||||
else
|
||||
echo "$AppName is not running..."
|
||||
fi
|
||||
}
|
||||
|
||||
function package()
|
||||
{
|
||||
stop
|
||||
/opt/soft/apache-maven-3.2.5/bin/mvn clean package -Ppublish -Dmaven.test.skip=true
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start;;
|
||||
stop)
|
||||
stop;;
|
||||
restart)
|
||||
restart;;
|
||||
status)
|
||||
status;;
|
||||
package)
|
||||
package;;
|
||||
*)
|
||||
|
||||
esac
|
||||
@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
|
||||
# ./bootstrap.sh start 启动 stop 停止 restart 重启 status 状态 package 打包构建
|
||||
AppName=onlineInspect.jar
|
||||
|
||||
# JVM参数
|
||||
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
||||
APP_HOME=`pwd`
|
||||
LOG_PATH=$APP_HOME/logs/$AppName.log
|
||||
LOG_PATH=$APP_HOME/$AppName.log
|
||||
|
||||
if [ "$1" = "" ];
|
||||
then
|
||||
@ -27,7 +27,7 @@ function start()
|
||||
echo "$AppName is running..."
|
||||
else
|
||||
BUILD_ID=dontKillMe
|
||||
nohup java $JVM_OPTS -jar ./target/$AppName --spring.profiles.active=test> /dev/null 2>&1 &
|
||||
nohup java $JVM_OPTS -jar ../target/$AppName >> $LOG_PATH 2>&1 &
|
||||
echo "Start $AppName success..."
|
||||
fi
|
||||
}
|
||||
@ -76,7 +76,8 @@ function status()
|
||||
function package()
|
||||
{
|
||||
stop
|
||||
/opt/soft/apache-maven-3.2.5/bin/mvn clean package -Ptest -Dmaven.test.skip=true
|
||||
cd ..
|
||||
mvn clean package -Dmaven.test.skip=true
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.onlines.config;
|
||||
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -11,7 +10,7 @@ import java.io.IOException;
|
||||
|
||||
@WebFilter(filterName = "corsFilter")
|
||||
public class CORSFilter implements Filter{
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(CORSFilter.class);
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
logger.info("初始化filter==========================");
|
||||
|
||||
@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
public class TriggerUrlJob implements InitializingBean {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(TriggerUrlJob.class);
|
||||
@Autowired
|
||||
private OnlinesSaleController onlinesSaleController;
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.onlines.listeners;
|
||||
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import com.onlines.mapper.PlanResultTestMapper;
|
||||
import com.onlines.onlineSaleTest.SpringWrapper;
|
||||
import com.onlines.pojo.PlanResultTest;
|
||||
@ -17,7 +16,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class MyReporter implements IReporter {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(MyReporter.class);
|
||||
private static PlanResultTestMapper testPlanResultMapper = SpringWrapper.getBean(PlanResultTestMapper.class);
|
||||
|
||||
private int testsPass = 0;
|
||||
|
||||
@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.microsoft.playwright.*;
|
||||
import com.microsoft.playwright.options.Geolocation;
|
||||
import com.microsoft.playwright.options.LoadState;
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import com.onlines.listeners.MyReporter;
|
||||
import com.onlines.mapper.CaseResponseMapper;
|
||||
import com.onlines.mapper.OnlinesPatrolMapper;
|
||||
@ -34,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
@Listeners({MyReporter.class})
|
||||
public class AutoCheckHtml {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(AutoCheckHtml.class);
|
||||
ImageComp imageComp = new ImageComp();
|
||||
private static OnlinesPatrolMapper onlinesPatrolMapper = SpringWrapper.getBean(OnlinesPatrolMapper.class);
|
||||
private static CaseResponseMapper caseResponseMapper = SpringWrapper.getBean(CaseResponseMapper.class);
|
||||
|
||||
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import com.onlines.entiry.CaseInfoDto;
|
||||
import com.onlines.entiry.DataReqDto;
|
||||
import com.onlines.entiry.OnlineSaleDto;
|
||||
@ -21,7 +20,7 @@ import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class OnlinesPatrolServiceImpl implements IOnlinesPatrolService {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesPatrolServiceImpl.class);
|
||||
@Autowired
|
||||
private OnlinesPatrolMapper onlinesPatrolMapper;
|
||||
|
||||
|
||||
@ -2,12 +2,11 @@ package com.onlines.utils;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.ITestResult;
|
||||
public class DingUtil {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(DingUtil.class);
|
||||
public static String setMsgContent(ITestResult result){
|
||||
|
||||
String caseDescription = result.getMethod().getDescription();
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.onlines.utils;
|
||||
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -10,7 +9,7 @@ import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
public class ImageComp {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(ImageComp.class);
|
||||
// 改变成二进制码
|
||||
public static String[][] getPX(String args) throws MalformedURLException {
|
||||
logger.info("getPX:" + args);
|
||||
|
||||
@ -2,12 +2,11 @@ package com.onlines.utils;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.onlines.controller.OnlinesSaleController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.ITestResult;
|
||||
public class WechatUtil {
|
||||
private static final Logger logger= LoggerFactory.getLogger(OnlinesSaleController.class);
|
||||
private static final Logger logger= LoggerFactory.getLogger(WechatUtil.class);
|
||||
public static String setMsgContent(ITestResult result){
|
||||
String caseDescription = result.getMethod().getDescription();
|
||||
Object[] caseParameters = result.getParameters();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user