forked from opentiny/tiny-vue
test(text-popup):[text-popup] update text-popup E2E test (#1119)
This commit is contained in:
parent
541aa9d1cb
commit
185eb8b84d
|
@ -4,7 +4,7 @@ test('Textpopup 基本用法', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#basic-usage')
|
await page.goto('text-popup#basic-usage')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#basic-usage')
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 清空value值', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#clear-value')
|
await page.goto('text-popup#clear-value')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#clear-value')
|
||||||
const button = preview.getByRole('button', { name: '点击清除' })
|
const button = preview.getByRole('button', { name: '点击清除' })
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 提示占位文本', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#placeholder')
|
await page.goto('text-popup#placeholder')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#placeholder')
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 只读', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#readonly')
|
await page.goto('text-popup#readonly')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#readonly')
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 分隔符', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#separtor')
|
await page.goto('text-popup#separtor')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#separtor')
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 基本用法', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#value')
|
await page.goto('text-popup#value')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#value')
|
||||||
const small = preview.locator('input')
|
const small = preview.locator('input')
|
||||||
const larger = preview.locator('textarea')
|
const larger = preview.locator('textarea')
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default {
|
||||||
'demoId': 'readonly',
|
'demoId': 'readonly',
|
||||||
'name': { 'zh-CN': '只读', 'en-US': 'Read-only' },
|
'name': { 'zh-CN': '只读', 'en-US': 'Read-only' },
|
||||||
'desc': {
|
'desc': {
|
||||||
'zh-CN': '<p>可通过 <code>readonly</code> 设置是否只读。</p>\n',
|
'zh-CN': '<p>通过 <code>readonly</code> 设置是否只读。</p>\n',
|
||||||
'en-US': '<p>You can use <code>readonly</code> to set whether to read only. </p>\n'
|
'en-US': '<p>You can use <code>readonly</code> to set whether to read only. </p>\n'
|
||||||
},
|
},
|
||||||
'codeFiles': ['readonly.vue']
|
'codeFiles': ['readonly.vue']
|
||||||
|
@ -31,7 +31,7 @@ export default {
|
||||||
'demoId': 'separtor',
|
'demoId': 'separtor',
|
||||||
'name': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
|
'name': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
|
||||||
'desc': {
|
'desc': {
|
||||||
'zh-CN': '<p>可通过 <code>separtor</code> 设置分隔符,在文本框中输入回车就是分隔符的位置。</p>\n',
|
'zh-CN': '<p>通过 <code>separtor</code> 设置分隔符,在文本框中输入回车就是分隔符的位置。</p>\n',
|
||||||
'en-US':
|
'en-US':
|
||||||
'<p>You can use <code>separtor</code> to set the separator. Enter the position of the separator in the text box and press Enter. </p>\n'
|
'<p>You can use <code>separtor</code> to set the separator. Enter the position of the separator in the text box and press Enter. </p>\n'
|
||||||
},
|
},
|
||||||
|
@ -41,7 +41,7 @@ export default {
|
||||||
'demoId': 'value',
|
'demoId': 'value',
|
||||||
'name': { 'zh-CN': '绑定值', 'en-US': 'Bound Value' },
|
'name': { 'zh-CN': '绑定值', 'en-US': 'Bound Value' },
|
||||||
'desc': {
|
'desc': {
|
||||||
'zh-CN': '<p>可通过 <code>value</code> 或 <code>v-model</code> 设置绑定值。</p>\n',
|
'zh-CN': '<p>通过 <code>value</code> 或 <code>v-model</code> 设置绑定值。</p>\n',
|
||||||
'en-US': '<p>You can set the binding value using <code>value</code> or <code>v-model</code>. </p>\n'
|
'en-US': '<p>You can set the binding value using <code>value</code> or <code>v-model</code>. </p>\n'
|
||||||
},
|
},
|
||||||
'codeFiles': ['value.vue']
|
'codeFiles': ['value.vue']
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
||||||
'demoId': 'width',
|
'demoId': 'width',
|
||||||
'name': { 'zh-CN': '宽度', 'en-US': 'Width' },
|
'name': { 'zh-CN': '宽度', 'en-US': 'Width' },
|
||||||
'desc': {
|
'desc': {
|
||||||
'zh-CN': '<p>可通过 <code>width</code> 设置宽度。</p>\n',
|
'zh-CN': '<p>通过 <code>width</code> 设置宽度。</p>\n',
|
||||||
'en-US': '<p>You can set the width through <code>width</code>. </p>\n'
|
'en-US': '<p>You can set the width through <code>width</code>. </p>\n'
|
||||||
},
|
},
|
||||||
'codeFiles': ['width.vue']
|
'codeFiles': ['width.vue']
|
||||||
|
@ -79,7 +79,7 @@ export default {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'defaultValue': '',
|
'defaultValue': '',
|
||||||
'desc': {
|
'desc': {
|
||||||
'zh-CN': '设置输入框内的提示占位文本',
|
'zh-CN': '输入框内的提示占位文本',
|
||||||
'en-US': 'Set the prompt placeholder text in the text box.'
|
'en-US': 'Set the prompt placeholder text in the text box.'
|
||||||
},
|
},
|
||||||
'demoId': 'placeholder'
|
'demoId': 'placeholder'
|
||||||
|
@ -87,21 +87,21 @@ export default {
|
||||||
{
|
{
|
||||||
'name': 'readonly',
|
'name': 'readonly',
|
||||||
'type': 'boolean',
|
'type': 'boolean',
|
||||||
'defaultValue': '该属性的默认值为 false',
|
'defaultValue': 'false',
|
||||||
'desc': { 'zh-CN': '设置是否只读', 'en-US': 'Set whether to read only' },
|
'desc': { 'zh-CN': '是否只读', 'en-US': 'Set whether to read only' },
|
||||||
'demoId': 'readonly'
|
'demoId': 'readonly'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'width',
|
'name': 'width',
|
||||||
'type': 'number , string',
|
'type': 'number , string',
|
||||||
'defaultValue': '该属性的默认值为 150',
|
'defaultValue': '150',
|
||||||
'desc': { 'zh-CN': '设置宽度', 'en-US': 'Set width' },
|
'desc': { 'zh-CN': '宽度', 'en-US': 'Set width' },
|
||||||
'demoId': 'width'
|
'demoId': 'width'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'separtor',
|
'name': 'separtor',
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'defaultValue': '该属性的默认值为 ,',
|
'defaultValue': '',
|
||||||
'desc': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
|
'desc': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
|
||||||
'demoId': 'separtor'
|
'demoId': 'separtor'
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ test('Textpopup 宽度', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('text-popup#width')
|
await page.goto('text-popup#width')
|
||||||
|
|
||||||
const preview = page.locator('#preview')
|
const preview = page.locator('#width')
|
||||||
const textPopup = preview.locator('.tiny-text-popup')
|
const textPopup = preview.locator('.tiny-text-popup')
|
||||||
|
|
||||||
await expect(textPopup).toHaveCSS('width', '500px')
|
await expect(textPopup).toHaveCSS('width', '500px')
|
||||||
|
|
Loading…
Reference in New Issue