提交 2c952a69 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(keepAlive): 修复测试例错误

上级 ed179df4
...@@ -25,7 +25,7 @@ describe('keep-alive', () => { ...@@ -25,7 +25,7 @@ describe('keep-alive', () => {
expect(shouldExcludeBtnList.length).toBe(0) expect(shouldExcludeBtnList.length).toBe(0)
const counterBtnList = await page.$$('.counter-btn') const counterBtnList = await page.$$('.counter-btn')
for (const i = 0; i < counterBtnList.length; i++) { for (let i = 0; i < counterBtnList.length; i++) {
await counterBtnList[i].tap() await counterBtnList[i].tap()
} }
...@@ -33,9 +33,9 @@ describe('keep-alive', () => { ...@@ -33,9 +33,9 @@ describe('keep-alive', () => {
await showShouldExcludeBtn.tap() await showShouldExcludeBtn.tap()
shouldExcludeTexts = await page.$$('.should-exclude-text') shouldExcludeTexts = await page.$$('.should-exclude-text')
for (const i = 0;i < shouldExcludeTexts.length;i++) { for (let i = 0;i < shouldExcludeTexts.length;i++) {
const text = await shouldExcludeTexts[i].text() const text = await shouldExcludeTexts[i].text()
if (i < shouldExcludeBtnList.length - 1) { if (i < shouldExcludeTexts.length - 1) {
expect(text).toBe('count: 0') expect(text).toBe('count: 0')
} else { } else {
expect(text).toBe('count: 1') expect(text).toBe('count: 1')
...@@ -48,7 +48,7 @@ describe('keep-alive', () => { ...@@ -48,7 +48,7 @@ describe('keep-alive', () => {
expect(await deactivatedNum.text()).toBe('deactivated num: 1') expect(await deactivatedNum.text()).toBe('deactivated num: 1')
let counterTexts = await page.$$('.counter-text') let counterTexts = await page.$$('.counter-text')
for (const i = 0; i < counterTexts.length; i++) { for (let i = 0; i < counterTexts.length; i++) {
expect(await counterTexts[i].text()).toBe('count: 1') expect(await counterTexts[i].text()).toBe('count: 1')
} }
...@@ -61,7 +61,7 @@ describe('keep-alive', () => { ...@@ -61,7 +61,7 @@ describe('keep-alive', () => {
} }
let messageTexts = await page.$$('.message-text') let messageTexts = await page.$$('.message-text')
for (const i = 0; i < messageTexts.length; i++) { for (let i = 0; i < messageTexts.length; i++) {
expect(await messageTexts[i].text()).toBe('msg: message changed') expect(await messageTexts[i].text()).toBe('msg: message changed')
} }
...@@ -71,21 +71,21 @@ describe('keep-alive', () => { ...@@ -71,21 +71,21 @@ describe('keep-alive', () => {
expect(await deactivatedNum.text()).toBe('deactivated num: 2') expect(await deactivatedNum.text()).toBe('deactivated num: 2')
counterTexts = await page.$$('.counter-text') counterTexts = await page.$$('.counter-text')
for (const i = 0; i < counterTexts.length; i++) { for (let i = 0; i < counterTexts.length; i++) {
expect(await counterTexts[i].text()).toBe('count: 1') expect(await counterTexts[i].text()).toBe('count: 1')
} }
await showMessageBtn.tap() await showMessageBtn.tap()
messageTexts = await page.$$('.message-text') messageTexts = await page.$$('.message-text')
for (const i = 0; i < messageTexts.length; i++) { for (let i = 0; i < messageTexts.length; i++) {
expect(await messageTexts[i].text()).toBe('msg: message changed') expect(await messageTexts[i].text()).toBe('msg: message changed')
} }
await showShouldExcludeBtn.tap() await showShouldExcludeBtn.tap()
shouldExcludeTexts = await page.$$('.should-exclude-text') shouldExcludeTexts = await page.$$('.should-exclude-text')
for (const i = 0; i < shouldExcludeTexts.length; i++) { for (let i = 0; i < shouldExcludeTexts.length; i++) {
expect(await shouldExcludeTexts[i].text()).toBe('count: 0') 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.
先完成此消息的编辑!
想要评论请 注册