提交 494a0177 编写于 作者: H hdx

component: 调整自动化测试用法

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