@Test @Templates("plain") public void testLocale() { String locale = "ru"; calendarAttributes.set(CalendarAttributes.locale, locale); DayPicker dayPicker = popupCalendar.openPopup().getDayPicker(); List<String> weekDayShortNames = dayPicker.getWeekDayShortNames(); List<String> expectedShortNames = Arrays.asList("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"); assertEquals(weekDayShortNames, expectedShortNames); setCurrentDateWithCalendarsTodayButtonAction.perform(); DateTime parsedDateTime = dateTimeFormatter .withLocale(new Locale(locale)) .parseDateTime(popupCalendar.getInput().getStringValue()); assertEquals( parsedDateTime.getDayOfMonth(), todayMidday.getDayOfMonth(), "Input doesn't contain selected date."); assertEquals( parsedDateTime.getMonthOfYear(), todayMidday.getMonthOfYear(), "Input doesn't contain selected date."); assertEquals( parsedDateTime.getYear(), todayMidday.getYear(), "Input doesn't contain selected date."); }
@Test @RegressionTest("https://issues.jboss.org/browse/RF-9646") public void testFirstWeekDay() { DayPicker dayPicker = popupCalendar.openPopup().getDayPicker(); List<String> weekDays = Arrays.asList("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); assertEquals(dayPicker.getWeekDayShortNames(), weekDays); // wrong input, nothing changes, RF-9646 calendarAttributes.set(CalendarAttributes.firstWeekDay, 7); dayPicker = popupCalendar.openPopup().getDayPicker(); assertEquals(dayPicker.getWeekDayShortNames(), weekDays); calendarAttributes.set(CalendarAttributes.firstWeekDay, 1); dayPicker = popupCalendar.openPopup().getDayPicker(); Collections.rotate(weekDays, -1); assertEquals(dayPicker.getWeekDayShortNames(), weekDays); }