-
Notifications
You must be signed in to change notification settings - Fork 8
feat:支持e2e,以及功能文档优化 #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,25 @@ | ||
| # 文档 | ||
| # Docs Playground | ||
|
|
||
| ## Playwright E2E | ||
|
|
||
| ### Install | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| pnpm exec playwright install | ||
| ``` | ||
|
|
||
| ### Run tests | ||
|
|
||
| ```bash | ||
| pnpm test:e2e | ||
| ``` | ||
|
|
||
| ### Optional modes | ||
|
|
||
| ```bash | ||
| pnpm test:e2e:headed | ||
| pnpm test:e2e:ui | ||
| pnpm test:e2e:report | ||
| pnpm test:e2e:codegen | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 自动匹配 | ||
| ## 自动匹配 | ||
|
|
||
| 内置自动匹配功能,通过 :show-no-data-tip=false 隐藏面板的无数据提示,通过 search 监听搜索事件,change 监听搜索值变化事件。 | ||
|
|
||
| <preview path="../search-box/auto-match.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| ## 基础用法 | ||
| ## 基础用法 | ||
|
|
||
| 通过 items 配置搜索数据项 | ||
|
|
||
| <preview path="../search-box/basic-usage.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 自定义默认搜索项 | ||
| ## 自定义默认搜索项 | ||
|
|
||
| 通过 default-field 属性可以设置自定义默认搜索项。 | ||
|
|
||
| <preview path="../search-box/default-field.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 没有筛选项时的占位文本 | ||
| ## 没有筛选项时的占位文本 | ||
|
|
||
| 通过 empty-placeholder 属性可以设置没有筛选项时的占位文本。 | ||
|
|
||
| <preview path="../search-box/empty-placeholder.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## help 提示场景 | ||
| ## help 提示场景 | ||
|
|
||
| 通过 show-help 属性可以控制是否显示帮助图标,默认为 true。当设置为 false 时,不会显示帮助图标,使用 help 事件回调可自定义弹窗内容。 | ||
|
|
||
| <preview path="../search-box/help.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 数据项占位文本 | ||
| ## 数据项占位文本 | ||
|
|
||
| 通过 item.placeholder 属性可以设置数据项的占位文本。当数据项为空时,会显示该占位文本;item.editAttrDisabeld 可以设置编辑状态下此属性类型不可切换。 | ||
|
|
||
| <preview path="../search-box/item-placeholder.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 面板最大高度 | ||
| ## 面板最大高度 | ||
|
|
||
| 通过 panel-max-height 属性可以设置下拉面板的最大高度。 | ||
|
|
||
| <preview path="../search-box/panel-max-height.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 潜在匹配项 | ||
| ## 潜在匹配项 | ||
|
|
||
| 通过 potential-options 配置潜在匹配项。 | ||
|
|
||
| <preview path="../search-box/potential-match.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 切分输入值 | ||
| ## 切分输入值 | ||
|
|
||
| 通过 split-input-value 属性可以自定义输入值的切分符,默认为逗号。当输入值包含切分符时,会按照切分符自动切分成多个关键字。 | ||
|
|
||
| <preview path="../search-box/split-input-value.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| ## 默认包含筛选项 | ||
| ## 默认包含筛选项 | ||
|
|
||
| 通过 model-value/v-model 配置默认选中标签项。 | ||
|
|
||
| <preview path="../search-box/v-model.vue"></preview> | ||
| ### Data Source | ||
|
|
||
| <<< ../search-box/data-source.ts | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { defineConfig, devices } from '@playwright/test' | ||
| import { fileURLToPath } from 'node:url' | ||
| import path from 'node:path' | ||
|
|
||
| const port = 4174 | ||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
|
||
| export default defineConfig({ | ||
| testDir: './search-box', | ||
| testMatch: '*.spec.ts', | ||
| timeout: 60_000, | ||
| fullyParallel: false, | ||
| forbidOnly: !!process.env.CI, | ||
| retries: process.env.CI ? 2 : 0, | ||
| reporter: process.env.CI ? [['github'], ['html', { open: 'never' }]] : [['list'], ['html']], | ||
| use: { | ||
| baseURL: `http://127.0.0.1:${port}/`, | ||
| trace: 'on-first-retry', | ||
| screenshot: 'only-on-failure', | ||
| video: 'retain-on-failure' | ||
| }, | ||
| webServer: { | ||
| command: `pnpm docs:dev --host 127.0.0.1 --port ${port}`, | ||
| cwd: __dirname, | ||
| port, | ||
| timeout: 120_000, | ||
| reuseExistingServer: false, | ||
| env: { | ||
| ...process.env, | ||
| VITE_BASE_URL: '/' | ||
| } | ||
| }, | ||
| projects: [ | ||
| { | ||
| name: 'chromium', | ||
| use: { ...devices['Desktop Chrome'] } | ||
| } | ||
| ] | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.