source: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/calendar/AppointmentViewPage.java @ 4864

Revision 4864, 3.5 KB checked in by luiz-fernando, 13 years ago (diff)

Ticket #1771 - Adicionado testes automatizados para modulo da agenda

Line 
1package org.expressolivre.cte.pages.calendar;
2
3import org.expressolivre.cte.pages.common.Page;
4import org.openqa.selenium.Alert;
5import org.openqa.selenium.WebDriver;
6import org.openqa.selenium.WebElement;
7import org.openqa.selenium.support.FindBy;
8import org.testng.Assert;
9
10/**
11 * @author L.F.Estivalet (Serpro)
12 *
13 *         Created on Jul 25, 2011 at 2:25:28 PM
14 *
15 */
16public class AppointmentViewPage extends Page {
17
18        @FindBy(xpath = "//table[@id='calendar_viewevent_button_left']/tbody/tr/td[1]/nobr/form/div/input[@id='']")
19        private WebElement editButton;
20
21        @FindBy(xpath = "//table[@id='calendar_viewevent_button_left']/tbody/tr/td[2]/nobr/form/div/input[@id='']")
22        private WebElement readyButton;
23
24        @FindBy(xpath = "//table[@id='calendar_viewevent_button_center']/tbody/tr/td[1]/nobr/form/div/input[@id='']")
25        private WebElement alarmManagerButton;
26
27        @FindBy(xpath = "//table[@id='calendar_viewevent_button_center']/tbody/tr/td[2]/nobr/form/div/input[@id='']")
28        private WebElement exportButton;
29
30        @FindBy(xpath = "//table[@id='calendar_viewevent_button_right']/tbody/tr/td/nobr/form/div/input[@id='']")
31        private WebElement removeButton;
32
33        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[1]/td[2]")
34        private WebElement title;
35
36        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[2]/td[2]")
37        private WebElement startTime;
38
39        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[3]/td[2]")
40        private WebElement endTime;
41
42        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[4]/td[2]")
43        private WebElement priority;
44
45        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[5]/td[2]")
46        private WebElement accessType;
47
48        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[6]/td[2]")
49        private WebElement participants;
50
51        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[7]/td[2]")
52        private WebElement createdBy;
53
54        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[8]/td[2]")
55        private WebElement updatedOn;
56
57        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[9]/td[2]")
58        private WebElement lastUpdateBy;
59
60        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[10]/td[2]")
61        private WebElement attachments;
62
63        public AppointmentViewPage(WebDriver driver) {
64                super(driver);
65                // TODO Auto-generated constructor stub
66        }
67
68        public void removeAppointment() {
69                this.removeButton.click();
70                Alert alert = driver.switchTo().alert();
71                Assert.assertEquals(
72                                alert.getText(),
73                                "Tem certeza que deseja remover esta entrada?\nIsto irá remover esta entrada para todos usuários.");
74                alert.accept();
75        }
76
77        /**
78         * @return the title
79         */
80        public String getTitle() {
81                return title.getText();
82        }
83
84        /**
85         * @return the startTime
86         */
87        public String getStartTime() {
88                return startTime.getText();
89        }
90
91        /**
92         * @return the endTime
93         */
94        public String getEndTime() {
95                return endTime.getText();
96        }
97
98        /**
99         * @return the priority
100         */
101        public String getPriority() {
102                return priority.getText();
103        }
104
105        /**
106         * @return the accessType
107         */
108        public String getAccessType() {
109                return accessType.getText();
110        }
111
112        /**
113         * @return the participants
114         */
115        public String getParticipants() {
116                return participants.getText();
117        }
118
119        /**
120         * @return the createdBy
121         */
122        public String getCreatedBy() {
123                return createdBy.getText();
124        }
125
126        /**
127         * @return the updatedOn
128         */
129        public String getUpdatedOn() {
130                return updatedOn.getText();
131        }
132
133        /**
134         * @return the lastUpdateBy
135         */
136        public String getLastUpdateBy() {
137                return lastUpdateBy.getText();
138        }
139
140        /**
141         * @return the attachments
142         */
143        public String getAttachments() {
144                return attachments.getText();
145        }
146
147}
Note: See TracBrowser for help on using the repository browser.