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

Revision 4890, 4.0 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_viewevent_button_right']/tbody/tr/td[2]/nobr/form/div/input[@id='']")
34        private WebElement removeSeriesButton;
35
36        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[1]/td[2]")
37        private WebElement title;
38
39        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[2]/td[2]")
40        private WebElement startTime;
41
42        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[3]/td[2]")
43        private WebElement endTime;
44
45        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[4]/td[2]")
46        private WebElement priority;
47
48        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[5]/td[2]")
49        private WebElement accessType;
50
51        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[6]/td[2]")
52        private WebElement participants;
53
54        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[7]/td[2]")
55        private WebElement createdBy;
56
57        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[8]/td[2]")
58        private WebElement updatedOn;
59
60        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[9]/td[2]")
61        private WebElement lastUpdateBy;
62
63        @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[10]/td[2]")
64        private WebElement attachments;
65
66        public AppointmentViewPage(WebDriver driver) {
67                super(driver);
68                // TODO Auto-generated constructor stub
69        }
70
71        public void removeAppointment() {
72                this.removeButton.click();
73                Alert alert = driver.switchTo().alert();
74                Assert.assertEquals(
75                                alert.getText(),
76                                "Tem certeza que deseja remover esta entrada?\nIsto irá remover esta entrada para todos usuários.");
77                alert.accept();
78        }
79
80        public void removeSeriesAppointment() {
81                this.removeSeriesButton.click();
82                Alert alert = driver.switchTo().alert();
83                Assert.assertEquals(
84                                alert.getText(),
85                                "Tem certeza que deseja remover esta entrada?\nIsto irá remover esta entrada para todos usuários.");
86                alert.accept();
87        }
88
89        /**
90         * @return the title
91         */
92        public String getTitle() {
93                return title.getText();
94        }
95
96        /**
97         * @return the startTime
98         */
99        public String getStartTime() {
100                return startTime.getText();
101        }
102
103        /**
104         * @return the endTime
105         */
106        public String getEndTime() {
107                return endTime.getText();
108        }
109
110        /**
111         * @return the priority
112         */
113        public String getPriority() {
114                return priority.getText();
115        }
116
117        /**
118         * @return the accessType
119         */
120        public String getAccessType() {
121                return accessType.getText();
122        }
123
124        /**
125         * @return the participants
126         */
127        public String getParticipants() {
128                return participants.getText();
129        }
130
131        /**
132         * @return the createdBy
133         */
134        public String getCreatedBy() {
135                return createdBy.getText();
136        }
137
138        /**
139         * @return the updatedOn
140         */
141        public String getUpdatedOn() {
142                return updatedOn.getText();
143        }
144
145        /**
146         * @return the lastUpdateBy
147         */
148        public String getLastUpdateBy() {
149                return lastUpdateBy.getText();
150        }
151
152        /**
153         * @return the attachments
154         */
155        public String getAttachments() {
156                return attachments.getText();
157        }
158
159}
Note: See TracBrowser for help on using the repository browser.