【发布时间】:2025-12-02 10:10:01
【问题描述】:
这就是我正在做的事情:
- 访问此页面:https://en.wikipedia.org/wiki/The_Beatles
- 点击 Paul McCartney *页面的第一个链接
- 跟踪 Paul McCartney 的出生日期
- 返回甲壳虫乐队页面
- 点击约翰列侬*页面的第一个链接
- 跟踪约翰列侬的出生日期
- 断言约翰列侬在保罗麦卡特尼之前出生
describe('iCONNECT Test Suite', function () {
it('Test Case 1', function () {
cy.visit('https://en.wikipedia.org/wiki/The_Beatles')
cy.get(':nth-child(8) > [href="/wiki/Paul_McCartney"]').click()
cy.get('.mw-parser-output > :nth-child(6)').contains('18 June 1942')
cy.go(-1)
cy.wait(7000)
cy.get(':nth-child(8) > [href="/wiki/John_Lennon"]').click()
cy.get('.mw-parser-output > :nth-child(6)').contains('9 October 1940')
expect(1940).to.be.lessThan(1942)
})
})
【问题讨论】:
标签: javascript automation cypress