提交 1db31cc7 编写于 作者: H hdx

component: 调整自动化测试用法

上级 caccd454
......@@ -42,11 +42,15 @@ describe('Checkbox.uvue', () => {
})
it('checked', async () => {
const cb = await page.$('.cb')
expect(await cb.property('checked')).toBe(true)
// TODO
const newValue1 = await cb.property('checked')
expect(newValue1.toString()).toBe(true + '')
await page.setData({
checked: false,
})
expect(await cb.property('checked')).toBe(false)
// TODO
const newValue2 = await cb.property('checked')
expect(newValue2.toString()).toBe(false + '')
})
it('color', async () => {
const cb = await page.$('.cb')
......
......@@ -40,11 +40,14 @@ describe('Radio.uvue', () => {
})
it('checked', async () => {
const radio = await page.$('.r')
expect(await radio.property('checked')).toBe(true)
// TODO
const newValue1 = await radio.property('checked')
expect(newValue1.toString()).toBe(true + '')
await page.setData({
checked: false,
})
expect(await radio.property('checked')).toBe(false)
const newValue2 = await radio.property('checked')
expect(newValue2.toString()).toBe(false + '')
})
it('color', async () => {
const radio = await page.$('.r')
......
......@@ -15,7 +15,9 @@ describe('slider', () => {
// TODO 暂时仅获取第一个
const slider1 = await page.$('.slider')
expect(await slider1.property('value')).toBe(sliderValue)
// TODO
const newValue = await slider1.property('value')
expect(newValue.toString()).toBe(sliderValue + '')
// const slider100 = await page.$$('.slider')
// for (let i = 0; i < slider100.length; i++) {
......
......@@ -15,7 +15,9 @@ describe('slider', () => {
sliderValue: sliderValue,
})
await page.waitFor(100)
expect(await slider.property('value')).toBe(sliderValue)
// TODO
const newValue = await slider.property('value')
expect(newValue.toString()).toBe(sliderValue + '')
})
it('color', async () => {
const slider = await page.$('.slider-custom-color-and-size')
......
......@@ -29,13 +29,17 @@ describe('switch', () => {
checked: false,
})
await page.waitFor(100)
expect(await switch_element.property('checked')).toBe(false)
// TODO
const newValue1 = await switch_element.property('checked')
expect(newValue1.toString()).toBe(false + '')
await page.setData({
checked: true,
})
await page.waitFor(100)
expect(await switch_element.property('checked')).toBe(true)
// TODO
const newValue2 = await switch_element.property('checked')
expect(newValue2.toString()).toBe(true + '')
})
it('color', async () => {
const switch_element = await page.$('.switch-color')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册