Skip to content

Commit d74e359

Browse files
committed
chore: daily development
1 parent 6f7dd79 commit d74e359

File tree

9 files changed

+71
-23
lines changed

9 files changed

+71
-23
lines changed

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
},
2121
"devDependencies": {
2222
"@types/node": "22.10.2",
23+
"autoprefixer": "^10.4.20",
24+
"postcss": "^8.4.49",
25+
"tailwindcss": "^3.4.17",
2326
"typescript": "^5.7.2"
2427
}
2528
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
"canyon-extension": "Canyon Extension",
3+
"canyon-uploader": "Canyon Uploader",
4+
"canyon-sdk": "Canyon SDK",
5+
};
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# sdk
1+
# Canyon Extension
2+
3+
Canyon Extension 是一个Chrome插件,用于帮助您在手工测试过程中收集覆盖率数据。
4+
5+
## 安装
6+
7+
点击 [Chrome Web Store](https://chrome.google.com/webstore/detail/canyon-extension/oh)下载安装 Canyon Extension。
8+
9+
## 使用
10+
11+
1. 打开您的项目页面。
12+
2. 点击 Canyon Extension 的 poup。
13+
3. 配置上报选项。
14+
4. 开始测试。

pages/documentation/end-to-end-testing/playwright.mdx

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Playwright
22

3-
## 介绍
4-
53
Playwright是一个用于浏览器自动化的Node.js库,Canyon提供了一个方法继承,用于在playwright运行过程中收集覆盖率数据。
64

75
## 使用
86

9-
### 继承playwright的test方法
7+
### 收集
108

119
```js
1210
import * as fs from 'fs';
@@ -42,10 +40,9 @@ export const expect = test.expect;
4240

4341
```
4442

45-
### 覆盖率数据
46-
4743
运行完playwright用例后,会在`.canyon_output`目录下生成覆盖率数据文件。
4844

45+
4946
### 上报
5047

5148
我们提供了一个 [uploader](https://github.com/canyon-project/uploader) 工具,它会扫描`.canyon_output`文件夹,用于将覆盖率数据上报到Canyon平台。

pages/documentation/getting-started/first-coverage.mdx

+21-12
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@ import { Steps,Callout,Cards } from 'nextra/components'
22

33
# 上报第一个覆盖率数据
44

5-
## CRN、xtaro项目自动接入
5+
## 从模板快速启动
66

7-
为了方便CRN接入,我们与MPAAS平台合作,提供了自动插桩的功能。__无需修改代码。__
7+
### 部署到 Vercel
8+
9+
您可以先创建自己的 demo 站点,然后通过单击以下链接将其部署到 Vercel:
10+
11+
<a
12+
className="mt-3 inline-flex"
13+
target="_blank"
14+
href="https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fcanyon-project%2Fcanyon-babel-template&showOptionalTeamCreation=false"
15+
>
16+
![](https://vercel.com/button)
17+
</a>
18+
19+
### 克隆模版
20+
21+
You can also manually fork the
22+
[template repository](https://github.com/canyon-project/canyon-babel-template).
823

9-
具体请查看 [CRN接入文档](/documentation/crn-coverage)
1024

1125
## 以新项目开始
1226

@@ -22,7 +36,7 @@ import { Steps,Callout,Cards } from 'nextra/components'
2236
[babel](https://babeljs.io/docs/config-files#configuration-file-types)中添加`canyon``istanbul`插件。
2337
```js {3,4}
2438
module.exports = {
25-
plugins: progress.env.NODE_ENV === 'production' ? [
39+
plugins: progress.env.GITLAB_BRANCH === 'production' ? [
2640
'canyon',
2741
'istanbul',
2842
]:[],
@@ -32,16 +46,11 @@ import { Steps,Callout,Cards } from 'nextra/components'
3246
插件会拖慢开发环境的编译速度,所以您需要控制插件生效的条件。
3347
</Callout>
3448

35-
配置完成后启动项目,在控制打印window.__coverage__。如果跟下图一样那么代码插桩成功。
49+
配置完成后启动项目,在控制打印 **window.\_\_coverage\_\_** 。如果跟下图一样那么代码插桩成功。
3650

3751
![coverage-canyon-console](/static/documentation/getting-started/first-coverage/coverage-canyon-console.png)
3852

3953

40-
<Callout>
41-
提示:Canyon插件只会在`NODE_ENV=production`时生效,并且会生成覆盖率map文件至`.canyon_output`中,所以您需要在.gitignore中忽略`.canyon_output`文件夹。
42-
</Callout>
43-
44-
4554
### CI 环境变量
4655

4756
在CI环境中,我们需要配置一些环境变量,用于上报覆盖率数据。
@@ -64,15 +73,15 @@ import { Steps,Callout,Cards } from 'nextra/components'
6473

6574

6675

67-
3. hit 和 map 数据分离
76+
3. hit 和 map 数据分离(可选)
6877

6978
UI自动化会会产生大量覆盖率数据,为了减少数据传输量,我们建议您将 [hit 数据与 map 数据分离](/test)
7079

7180

7281

7382
### 覆盖率数据上报
7483

75-
覆盖率数据存在于浏览器中,我们提供了以下几种方式上报数据
84+
此时覆盖率数据处与浏览器中,随着用户的操作或者UI自动化case执行,数据会不断积累。我们需要将数据上报到Canyon后端服务
7685

7786
<Cards>
7887
<Cards.Card

pages/index.css

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.nextra-banner-container{
2-
height: 70px !important;
3-
/*background-color: #fff !important;*/
4-
/*color: #333;*/
5-
}
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

postcss.config.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
};
7+
8+
export default config;
Loading

tailwind.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
5+
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
6+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
7+
8+
// Or if using `src` directory:
9+
"./src/**/*.{js,ts,jsx,tsx,mdx}",
10+
],
11+
theme: {
12+
extend: {},
13+
},
14+
plugins: [],
15+
}

0 commit comments

Comments
 (0)