提交 27f83eec 编写于 作者: Y yurj26

test: 优化waitfor 时间

上级 9a487ea3
......@@ -4,7 +4,7 @@ describe('Button.uvue', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
await page.waitFor('view')
})
it('click', async () => {
// TODO 待测试框架支持text的dispatchEvent
......@@ -41,12 +41,10 @@ describe('Button.uvue', () => {
await page.setData({
type_enum_current: 1,
})
await page.waitFor(500)
expect(await btn.property('type')).toBe('primary')
await page.setData({
type_enum_current: 2,
})
await page.waitFor(500)
expect(await btn.property('type')).toBe('warn')
})
it('size', async () => {
......@@ -55,7 +53,6 @@ describe('Button.uvue', () => {
await page.setData({
size_enum_current: 1,
})
await page.waitFor(500)
expect(await btn.property('size')).toBe('mini')
})
it('plain', async () => {
......@@ -64,7 +61,6 @@ describe('Button.uvue', () => {
await page.setData({
plain_boolean: true,
})
await page.waitFor(500)
expect(await btn.property('plain')).toBe(true)
})
it('disabled', async () => {
......@@ -73,7 +69,6 @@ describe('Button.uvue', () => {
await page.setData({
disabled_boolean: true,
})
await page.waitFor(500)
expect(await btn.property('disabled')).toBe(true)
})
})
\ No newline at end of file
})
......@@ -8,7 +8,7 @@ function getData(key = '') {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/checkbox/checkbox')
await page.waitFor(1000)
await page.waitFor('view')
})
describe('Checkbox.uvue', () => {
......@@ -46,7 +46,6 @@ describe('Checkbox.uvue', () => {
await page.setData({
checked: false,
})
await page.waitFor(500)
expect(await cb.property('checked')).toBe(false)
})
it('color', async () => {
......@@ -55,7 +54,6 @@ describe('Checkbox.uvue', () => {
await page.setData({
color: '#63acfc',
})
await page.waitFor(500)
expect(await cb.property('color')).toBe('#63acfc')
})
it('disabled', async () => {
......@@ -64,7 +62,6 @@ describe('Checkbox.uvue', () => {
await page.setData({
disabled: false,
})
await page.waitFor(500)
expect(await cb.property('disabled')).toBe(false)
})
})
......@@ -8,18 +8,18 @@ function getData(key = '') {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/picker-view/picker-view')
await page.waitFor(1000)
await page.waitFor('view')
})
describe('PickerView.uvue', () => {
it('value', async () => {
const el = await page.$('.picker-view')
await page.callMethod('setValue')
await page.callMethod('setValue')
await page.waitFor(1000)
expect(await el.property('value')).toEqual([0, 0, 0])
expect(await getData('result')).toEqual([0, 0, 0])
await page.callMethod('setValue1')
await page.callMethod('setValue1')
await page.waitFor(1000)
expect(await el.property('value')).toEqual([10, 10, 10])
expect(await getData('result')).toEqual([10, 10, 10])
......@@ -35,7 +35,7 @@ describe('PickerView.uvue', () => {
const el = await page.$('.picker-view')
await page.setData({
indicatorStyle: 'height: 100px;',
})
})
await page.waitFor(500)
expect(await el.property('indicatorStyle')).toBe('height: 100px;')
})
......@@ -44,7 +44,6 @@ describe('PickerView.uvue', () => {
await page.setData({
maskTopStyle: 'background: #ffffff;',
})
await page.waitFor(500)
expect(await el.property('mask-top-style')).toBe('background: #ffffff;')
})
it('mask-bottom-style', async () => {
......@@ -52,7 +51,6 @@ describe('PickerView.uvue', () => {
await page.setData({
maskBottomStyle: 'background: #ffffff;',
})
await page.waitFor(500)
expect(await el.property('mask-bottom-style')).toBe('background: #ffffff;')
})
})
......@@ -8,7 +8,7 @@ function getData(key = '') {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/progress/progress')
await page.waitFor(1000)
await page.waitFor('view')
})
describe('Progress.uvue', () => {
......@@ -17,15 +17,15 @@ describe('Progress.uvue', () => {
const p1 = await page.$('.p1')
const p2 = await page.$('.p2')
const p3 = await page.$('.p3')
page.callMethod('setProgress')
await page.waitFor(1000)
page.callMethod('setProgress')
await page.waitFor(500)
expect(await p.property('percent')).toEqual(20)
expect(await p1.property('percent')).toEqual(40)
expect(await p2.property('percent')).toEqual(60)
expect(await p3.property('percent')).toEqual(80)
expect(await getData('curPercent')).toEqual(20)
page.callMethod('clearProgress')
await page.waitFor(1000)
page.callMethod('clearProgress')
await page.waitFor(500)
expect(await p.property('percent')).toEqual(0)
expect(await p1.property('percent')).toEqual(0)
expect(await p2.property('percent')).toEqual(0)
......@@ -42,7 +42,6 @@ describe('Progress.uvue', () => {
await page.setData({
showInfo: false
})
await page.waitFor(500)
expect(await el.property('show-info')).toEqual(false)
})
it('border-radius', async () => {
......@@ -51,7 +50,6 @@ describe('Progress.uvue', () => {
await page.setData({
borderRadius: 5
})
await page.waitFor(500)
expect(await el.property('border-radius')).toEqual(5)
})
it('font-size', async () => {
......@@ -60,7 +58,6 @@ describe('Progress.uvue', () => {
await page.setData({
fontSize: 18
})
await page.waitFor(500)
expect(await el.property('font-size')).toEqual(18)
})
it('stroke-width', async () => {
......@@ -69,7 +66,6 @@ describe('Progress.uvue', () => {
await page.setData({
strokeWidth: 6
})
await page.waitFor(500)
expect(await el.property('stroke-width')).toEqual(6)
})
it('backgroundColor', async () => {
......@@ -78,7 +74,6 @@ describe('Progress.uvue', () => {
await page.setData({
backgroundColor: "#007aff"
})
await page.waitFor(500)
expect(await el.property('background-color')).toEqual('#007aff')
})
})
\ No newline at end of file
})
......@@ -8,7 +8,7 @@ function getData(key = '') {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/radio/radio')
await page.waitFor(1000)
await page.waitFor('view')
})
describe('Radio.uvue', () => {
......@@ -44,7 +44,6 @@ describe('Radio.uvue', () => {
await page.setData({
checked: false,
})
await page.waitFor(500)
expect(await radio.property('checked')).toBe(false)
})
it('color', async () => {
......@@ -53,7 +52,6 @@ describe('Radio.uvue', () => {
await page.setData({
color: '#63acfc',
})
await page.waitFor(500)
expect(await radio.property('color')).toBe('#63acfc')
})
it('disabled', async () => {
......@@ -62,7 +60,6 @@ describe('Radio.uvue', () => {
await page.setData({
disabled: false,
})
await page.waitFor(500)
expect(await radio.property('disabled')).toBe(false)
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册