由于其父项 <div.container-fluid> 具有 CSS 属性,无法输入:溢出:隐藏

Not able to type in input due to its parent <div.container-fluid> has CSS property: overflow: hidden

无法输入,因为其父级 具有 CSS 属性:溢出:隐藏且有效宽度和高度为:1600 x 0 像素。

解决此问题,或使用{force: true} 禁用错误检查。

cy.xpath('//*[@id="mat-input-0"]').type('Rest')

错误:

您可以添加 {force: true}type:

cy.xpath('//*[@id="mat-input-0"]').type('Rest',{force: true})

在我看来这像是一个动画问题。尝试添加可见性检查

cy.xpath('//*[@id="mat-input-0"]')
  .should('be.visible')
  .type('Rest')