admin管理员组

文章数量:1336660

describe('My First Test', () => {
  it('Visits Replpad', () => {
    cy.visit('/')
    cy.get('input').type('now')
  })
}) 

Trying to type some text into the bottom input field but it times out trying to find the input field. I've extended the time out period up to 10,000 but it still doesn't see the input field.

Is there a solution to this?

describe('My First Test', () => {
  it('Visits Replpad', () => {
    cy.visit('http://hostilefork./media/shared/replpad-js/')
    cy.get('input').type('now')
  })
}) 

Trying to type some text into the bottom input field but it times out trying to find the input field. I've extended the time out period up to 10,000 but it still doesn't see the input field.

Is there a solution to this?

Share Improve this question edited Dec 19, 2021 at 5:52 Graham Chiu asked Dec 19, 2021 at 5:43 Graham ChiuGraham Chiu 4,8863 gold badges26 silver badges42 bronze badges 3
  • 1 Please show the dom structure of you page – Mikhail Bolotov Commented Dec 19, 2021 at 12:38
  • The console appears here github./hostilefork/replpad-js/blob/master/index.html#L121 in consult_out, and is created here github./hostilefork/replpad-js/blob/master/replpad.reb#L350 – Graham Chiu Commented Dec 19, 2021 at 14:05
  • why not just look into the DOM as it shown in the Cypress runner after you've execute your test? It shows it exactly as it was at the moment when Cypress was trying to find the input element. – Mikhail Bolotov Commented Dec 19, 2021 at 14:59
Add a ment  | 

1 Answer 1

Reset to default 4

instead of

cy.get('input').type('now')

try

cy.get('.input').type('now')

because you are looking for the class name not for the tag

本文标签: javascripttyping into an input field using CypressStack Overflow