|
| 1 | +import Scheduler from 'devextreme-testcafe-models/scheduler'; |
| 2 | +import { createWidget } from '../../../../helpers/createWidget'; |
| 3 | +import url from '../../../../helpers/getPageUrl'; |
| 4 | + |
| 5 | +fixture.disablePageReloads`Appointment Form: Functional` |
| 6 | + .page(url(__dirname, '../../../container.html')); |
| 7 | + |
| 8 | +const SCHEDULER_SELECTOR = '#container'; |
| 9 | + |
| 10 | +test('Subject text editor should have focus after returning from recurrence form', async (t) => { |
| 11 | + const appointment = { |
| 12 | + text: 'Appointment', |
| 13 | + startDate: new Date('2021-04-26T16:30:00.000Z'), |
| 14 | + endDate: new Date('2021-04-26T18:30:00.000Z'), |
| 15 | + allDay: false, |
| 16 | + recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', |
| 17 | + }; |
| 18 | + |
| 19 | + const scheduler = new Scheduler(SCHEDULER_SELECTOR); |
| 20 | + const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); |
| 21 | + |
| 22 | + await appointmentPopup.openRecurrenceSettings(t); |
| 23 | + |
| 24 | + await t.click(appointmentPopup.recurrence.backButton); |
| 25 | + |
| 26 | + await t |
| 27 | + .expect(appointmentPopup.textEditor.getInput().focused) |
| 28 | + .ok(); |
| 29 | +}).before(async () => { |
| 30 | + await createWidget('dxScheduler', { |
| 31 | + dataSource: [], |
| 32 | + views: ['week'], |
| 33 | + currentView: 'week', |
| 34 | + currentDate: new Date(2021, 2, 25), |
| 35 | + }); |
| 36 | +}); |
| 37 | + |
| 38 | +test('Recurrence start date editor should have focus after opening recurrence settings', async (t) => { |
| 39 | + const appointment = { |
| 40 | + text: 'Appointment', |
| 41 | + startDate: new Date('2021-04-26T16:30:00.000Z'), |
| 42 | + endDate: new Date('2021-04-26T18:30:00.000Z'), |
| 43 | + allDay: false, |
| 44 | + recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', |
| 45 | + }; |
| 46 | + |
| 47 | + const scheduler = new Scheduler(SCHEDULER_SELECTOR); |
| 48 | + const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); |
| 49 | + |
| 50 | + await appointmentPopup.openRecurrenceSettings(t); |
| 51 | + |
| 52 | + await t |
| 53 | + .expect(appointmentPopup.recurrence.startDateInput.focused) |
| 54 | + .ok(); |
| 55 | +}).before(async () => { |
| 56 | + await createWidget('dxScheduler', { |
| 57 | + dataSource: [], |
| 58 | + views: ['week'], |
| 59 | + currentView: 'week', |
| 60 | + currentDate: new Date(2021, 2, 25), |
| 61 | + }); |
| 62 | +}); |
0 commit comments