提交 6b4c1923 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(keepAlive): 优化测试例

上级 b82b0eb1
......@@ -18,12 +18,13 @@ describe('keep-alive', () => {
const showCounterBtn = await page.$('.show-counter')
await showCounterBtn.tap()
await page.waitFor(300)
const activatedNum = await page.$('#activated-num')
expect(await activatedNum.text()).toBe('activated num: 1')
const deactivatedNum = await page.$('#deactivated-num')
expect(await deactivatedNum.text()).toBe('deactivated num: 0')
const shouldExcludeBtns2 = await page.$$('.should-exclude-btn')
expect(await deactivatedNum.text()).toBe('deactivated num: 0')
const shouldExcludeBtns2 = await page.$$('.should-exclude-btn')
expect(shouldExcludeBtns2.length).toBe(0)
const counterBtns = await page.$$('.counter-btn')
......@@ -44,6 +45,7 @@ describe('keep-alive', () => {
}
await showCounterBtn.tap()
await page.waitFor(300)
expect(await activatedNum.text()).toBe('activated num: 2')
expect(await deactivatedNum.text()).toBe('deactivated num: 1')
......@@ -67,6 +69,7 @@ describe('keep-alive', () => {
}
await showCounterBtn.tap()
await page.waitFor(300)
expect(await activatedNum.text()).toBe('activated num: 3')
expect(await deactivatedNum.text()).toBe('deactivated num: 2')
......@@ -77,6 +80,7 @@ describe('keep-alive', () => {
}
await showMessageBtn.tap()
await page.waitFor(300)
messageTexts = await page.$$('.message-text')
for (let i = 0; i < messageTexts.length; i++) {
......@@ -84,6 +88,7 @@ describe('keep-alive', () => {
}
await showShouldExcludeBtn.tap()
await page.waitFor(300)
shouldExcludeTexts = await page.$$('.should-exclude-text')
for (let i = 0; i < shouldExcludeTexts.length; i++) {
expect(await shouldExcludeTexts[i].text()).toBe('count: 0')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册