1 | package org.expressolivre.cte.calendar; |
---|
2 | |
---|
3 | import java.text.SimpleDateFormat; |
---|
4 | import java.util.Calendar; |
---|
5 | |
---|
6 | import org.expressolivre.cte.common.BaseCalendarTestCase; |
---|
7 | import org.expressolivre.cte.pages.calendar.AppointmentPage; |
---|
8 | import org.testng.annotations.Parameters; |
---|
9 | import org.testng.annotations.Test; |
---|
10 | |
---|
11 | /** |
---|
12 | * Suite:[FUN03.2] Adicionar Compromisso |
---|
13 | * |
---|
14 | * Caso de Teste: EL-938:Adicionar compromisso |
---|
15 | * |
---|
16 | * Link: http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item= |
---|
17 | * testcase&id=EL-938 |
---|
18 | * |
---|
19 | * @author L.F.Estivalet (Serpro) |
---|
20 | * |
---|
21 | * Created on Feb 8, 2011 at 9:36:08 AM |
---|
22 | * |
---|
23 | */ |
---|
24 | public class AdicionarCompromisso extends BaseCalendarTestCase { |
---|
25 | |
---|
26 | @Parameters({ "titulo", "horaInicial", "minutoInicial", "horaFinal", |
---|
27 | "minutoFinal" }) |
---|
28 | @Test(dependsOnMethods = { "init" }) |
---|
29 | public void test(String titulo, String horaInicial, String minutoInicial, |
---|
30 | String horaFinal, String minutoFinal) { |
---|
31 | |
---|
32 | // Pega data corrente. |
---|
33 | Calendar cal = Calendar.getInstance(); |
---|
34 | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
---|
35 | SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy"); |
---|
36 | |
---|
37 | // Adiciona um compromisso para data atual. |
---|
38 | AppointmentPage ap = super.newAppointment(sdf.format(cal.getTime())); |
---|
39 | ap.setTitle(titulo); |
---|
40 | ap.setStartDate(sdf2.format(cal.getTime())); |
---|
41 | ap.setStartHour(horaInicial); |
---|
42 | ap.setStartMinute(minutoInicial); |
---|
43 | ap.setEndDate(sdf2.format(cal.getTime())); |
---|
44 | ap.setEndHour(horaFinal); |
---|
45 | ap.setEndMinute(minutoFinal); |
---|
46 | |
---|
47 | ap.saveAppointment(); |
---|
48 | } |
---|
49 | } |
---|