Skip to content
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

fix(demos/checkbox): [checkbox] fix checkbox e2e-test error #2745

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-button.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div>
<tiny-checkbox-group v-model="checked" @change="valueChange">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('事件', async ({ page }) => {
const checkbox = demo.locator('.tiny-checkbox-group > label')

await checkbox.nth(1).click()
await expect(page.getByText('change 事件触发了,选中值为:复选框 1复选框 2')).toBeVisible()
await expect(page.getByText('change 事件触发了,选中值为:复选框 1,复选框 2')).toBeVisible()
await checkbox.nth(0).click()
await expect(page.getByText('change 事件触发了,选中值为:复选框 2')).toBeVisible()
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-events.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" @change="valueChange">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2"></tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-group.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2"></tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checkedData">
<tiny-checkbox label="复选框1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框3" name="name3"></tiny-checkbox>
<tiny-checkbox label="复选框 1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框 3" name="name3"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/checkbox/checked.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checkedData">
<tiny-checkbox label="复选框1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框3" name="name3"></tiny-checkbox>
<tiny-checkbox label="复选框 1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框 3" name="name3"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" fill="#fa9841" text-color="#eee">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/custom-color.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" fill="#fa9841" text-color="#eee">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2" text="复选框2文本"></tiny-checkbox>
<tiny-checkbox label="复选框3" text="复选框3">复选框 3 文本</tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" text="复选框 2 文本"></tiny-checkbox>
<tiny-checkbox label="复选框 3" text="复选框 3">复选框 3 文本</tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/checkbox/description.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2" text="复选框2文本"></tiny-checkbox>
<tiny-checkbox label="复选框3" text="复选框3">复选框 3 文本</tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" text="复选框 2 文本"></tiny-checkbox>
<tiny-checkbox label="复选框 3" text="复选框 3">复选框 3 文本</tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
2 changes: 1 addition & 1 deletion internals/playwright-config/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Config = ({ testDir, baseURL, storageState, devServerCommon }) =>
timeout: 30 * 1000,
expect: {
// 每个 expect() 用例最长时间。
timeout: 15 * 1000,
timeout: 8 * 1000,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reducing the timeout for expect() from 15 seconds to 8 seconds may lead to flaky tests if the operations being tested require more time. Ensure that this change does not negatively impact test stability.

toHaveScreenshot: {
maxDiffPixelRatio: 0.02
}
Expand Down
Loading