如题
const main_history_list =await page.$('.main_history_list')
const list = await main_history_list.$$('.main_history_list_item_text')
const first_item = list[0]
const first_item_text=await first_item.text()
console.log("first_item_text", first_item_text)
const first_item_offset = await first_item.offset()
console.log("first_item_offset", first_item_offset)
expect(first_item_offset.top).toBeGreaterThan(0)
const last_item = list[list.length-1]
const last_item_text=await last_item.text()
console.log("last_item_text", last_item_text)
const last_item_offset = await last_item.offset()
console.log("last_item_offset", first_item_offset)
expect(last_item_offset.top).toBeGreaterThan(0)
offset的值都是同一个
打印的text和元素id都不一样
0 个回复