Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
How do I select the time from the dropdown widget using cypress

I've scenario to automate in cypress, the test case is to set time for signing appointment either from dropdown or by typing time and selecting from dropdown. Can anyone tell please me how to set time.

I tried with different approach of code it din't work to me

cy.get('#appointment-form_appointmentTime li:nth-child(1)').type('time, 10:30pm').click();
    
cy.get('.ant-select.ant-select-single.ant-select-allow-clear.ant-select-show-arrow.ant-select-open.ant-select-show-search li:nth-child(1)').type('time, 10:30pm').click();

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

According to your DOM screenshot you should be able to reference the input field of your dropdown, type in and assert some value as follows:

Get input by id:

cy.get('#appointment-form_appointmentTime').clear().type('some date').should('have.value', 'some date');

or alternatively by class:

cy.get('ant-select-selection-search-input').clear().type('some date').should('have.value', 'some date');

I'm not sure why you are using cy.click() on 1. but I assume that you are trying to click on a value in your dropdown. However, to do this you must first select the appropriate dropdown item with another cy.get() and then click on it with cy.click().

I would have provided the sample code for this as well, however the HTML code for your dropdown entries is missing from the question.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda