source: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/calendar/AdicionarCompromisso.java @ 3745

Revision 3745, 1.3 KB checked in by luiz-fernando, 13 years ago (diff)

Ticket #1402 - Novos casos de teste implementados usando WebDriver?

Line 
1package br.gov.serpro.expresso.cte.calendar;
2
3import java.text.SimpleDateFormat;
4import java.util.Calendar;
5
6import org.testng.annotations.Parameters;
7import org.testng.annotations.Test;
8
9import br.gov.serpro.expresso.cte.common.BaseCalendarTestCase;
10import br.gov.serpro.expresso.cte.pages.calendar.AppointmentPage;
11
12/**
13 * @author L.F.Estivalet (Serpro)
14 *
15 *         Created on Feb 8, 2011 at 9:36:08 AM
16 *
17 */
18public class AdicionarCompromisso extends BaseCalendarTestCase {
19
20        @Parameters({ "titulo", "horaInicial", "minutoInicial", "horaFinal",
21                        "minutoFinal" })
22        @Test(dependsOnMethods = { "init" })
23        public void test(String titulo, String horaInicial, String minutoInicial,
24                        String horaFinal, String minutoFinal) {
25
26                // Pega data corrente.
27                Calendar cal = Calendar.getInstance();
28                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
29                SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy");
30
31                // Adiciona um compromisso para data atual.
32                AppointmentPage ap = super.newAppointment(sdf.format(cal.getTime()));
33                ap.setTitle(titulo);
34                ap.setStartDate(sdf2.format(cal.getTime()));
35                ap.setStartHour(horaInicial);
36                ap.setStartMinute(minutoInicial);
37                ap.setEndDate(sdf2.format(cal.getTime()));
38                ap.setEndHour(horaFinal);
39                ap.setEndMinute(minutoFinal);
40
41                ap.saveAppointment();
42        }
43}
Note: See TracBrowser for help on using the repository browser.