Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

440
Views
react-datepicker: no se puede abrir la ventana emergente de fecha usando Testcafe

Estoy usando el paquete react-datepicker como un componente Selector de fecha personalizado para mi aplicación. Lo envuelvo en mi propio componente así:

 const MyCustomDatePicker = ({ onChange, value, error, disabled, placeholder, dateFormat }) => { return ( <div className='date-input' data-test-id='date-picker'> <div className='date-input__field'> <DatePicker selected={value} disabled={disabled} onChange={onChange} dateFormat={dateFormat} placeholderText={placeholder} className='date-input__input' /> </div> </div> ); };

Lo que funciona bien en la interfaz de usuario, puedo seleccionar una fecha de la ventana emergente:

Surgir

Sin embargo, cuando intento replicar esto en Testcafe, parece que no puedo hacer que aparezca la ventana emergente. Probé una combinación diferente de mis propios nombres de clase y los generados por el paquete react-datepicker:

 import { Selector } from 'testcafe'; fixture`Getting Started` .page`https://my-page`; test('My first test', async t => { await t.click(Selector('date-input__input')) await t.click(Selector('react-datepicker__input-container')) await t.click(Selector('react-datepicker-wrapper')) await t.wait(5000) });

Pero ninguno de estos abre la ventana emergente del selector de fecha. ¿Es posible hacer esto en testcafe?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

En el fragmento que proporcionó, veo un error: está tratando de tomar un selector por clase, pero no está usando un punto. Intente, por ejemplo, ejecutar esta prueba:

 import { Selector } from 'testcafe'; fixture `New Fixture` .page `https://reactdatepicker.com/`; test(`New Test`, async t => { const anyPicker = Selector('.react-datepicker__input-container').nth(1); const input = anyPicker.find('input'); const dateCell = Selector('.react-datepicker__day').withText('16'); await t .click(input) .click(dateCell) .expect(input.value).eql('07/16/2022'); });
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!