-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutomationExPage.java
304 lines (282 loc) · 12.8 KB
/
AutomationExPage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
package pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import utilities.Driver;
public class AutomationExPage {
public AutomationExPage() {
PageFactory.initElements(Driver.getDriver(), this);
}
//Main page
@FindBy(xpath = "//a[@href='/login']")
public WebElement mainPageloginSingupButonu;
@FindBy(xpath = "//a[@href='/contact_us']")
public WebElement mainPageContactUsButonu;
@FindBy(xpath = "//a[@href='/products']")
public WebElement mainPageProductsButonu;
@FindBy(css = "div[class='single-widget'] h2")
public WebElement mainPageSubscriptionText;
@FindBy(xpath = "//input[@id='susbscribe_email']")
public WebElement mainPageSubscriptionInput;
@FindBy(xpath = "//i[@class='fa fa-arrow-circle-o-right']")
public WebElement mainPageSubscriptionArrowButton;
@FindBy(xpath = "//div[@class='alert-success alert']")
public WebElement mainPageSubscriptionSuccessAlert;
@FindBy(xpath = "(//a[@href='/view_cart'])[1]")
public WebElement mainPageCartButton;
@FindBy(xpath = "//i[@class='fa fa-angle-up']")
public WebElement mainPageArrowUptoAngleUp;
//Recommended items
@FindBy(xpath = "//h2[text()='recommended items']")
public WebElement mainPageRecommendedItemsList;
//Main page Category and Brands bar
//Categories
@FindBy(css = ".left-sidebar")
public WebElement mainPageCategoryBrandBar;
//Women
@FindBy(css = "a[href='#Women']")
public WebElement mainPageCategoryWomen;
//Subcategories
@FindBy(css = "a[href='/category_products/1']")
public WebElement mainPageWomenSubcategoryDress;
@FindBy(css = "a[href='/category_products/2']")
public WebElement mainPageWomenSubcategoryTops;
@FindBy(css = "a[href='/category_products/7']")
public WebElement mainPageWomenSubcategorySaree;
//Men
@FindBy(css = "a[href='#Men']")
public WebElement mainPageCategoryMen;
//Subcategories
@FindBy(css = "a[href='/category_products/3']")
public WebElement mainPageMenSubcategoryTshirts;
@FindBy(css = "a[href='/category_products/6']")
public WebElement mainPageMenSubcategoryJeans;
//Kids
@FindBy(css = "a[href='#Kids']")
public WebElement mainPageCategoryKids;
//Subcategories
@FindBy(css = "a[href='/category_products/4']")
public WebElement mainPageKidsSubcategoryDress;
@FindBy(css = "a[href='/category_products/5']")
public WebElement mainPageKidsSubcategoryTopsShirts;
//Brands
@FindBy(css = "a[href='/brand_products/Polo']")
public WebElement mainPageBrandsPolo;
@FindBy(css = "a[href='/brand_products/H&M']")
public WebElement mainPageBrandsHm;
@FindBy(css = "a[href='/brand_products/Madame']")
public WebElement mainPageBrandsMadame;
@FindBy(css = "a[href='/brand_products/Mast & Harbour']")
public WebElement mainPageBrandsHarbour;
@FindBy(css = "a[href='/brand_products/Babyhug']")
public WebElement mainPageBrandsBabyhug;
@FindBy(css = "a[href='/brand_products/Allen Solly Junior']")
public WebElement mainPageBrandsAllenSollyJunior;
@FindBy(css = "a[href='/brand_products/Kookie Kids']")
public WebElement mainPageBrandsKookieKids;
@FindBy(css = "a[href='/brand_products/Biba']")
public WebElement mainPageBrandsBiba;
//Login/singup form menu
@FindBy(xpath = "//div[@class='signup-form']")
public WebElement newUserSingupMenuForm;
@FindBy(xpath = "//input[@data-qa='signup-name']")
public WebElement newUserSingupMenuName;
@FindBy(xpath = "//input[@data-qa='signup-email']")
public WebElement newUserSingupMenuEmail;
@FindBy(xpath = "//button[@data-qa='signup-button']")
public WebElement newUserSingupButton;
@FindBy(xpath = "//p[text()='Email Address already exist!']")
public WebElement newUserMenuError;
@FindBy(xpath = "//input[@data-qa='login-email']")
public WebElement loginUserEmail;
@FindBy(xpath = "//input[@data-qa='login-password']")
public WebElement loginUserPassword;
@FindBy(xpath = "//button[@data-qa='login-button']")
public WebElement loginUserButton;
@FindBy(xpath = "//div[@class='login-form']")
public WebElement loginUserMenuForm;
@FindBy(xpath = "//p[text()='Your email or password is incorrect!']")
public WebElement loginUserMenuError;
//LoginFormTable
@FindBy(xpath = "//div[@class='login-form']")
public WebElement loginForm;
@FindBy(xpath = "//input[@id='id_gender1']")
public WebElement loginFormtitleRadioButtonGenderMr;
@FindBy(xpath = "//input[@id='id_gender2']")
public WebElement loginFormtitleRadioButtonGenderMrs;
@FindBy(css = "#name")
public WebElement loginFormName;
@FindBy(css = "#password")
public WebElement loginFormPassword;
@FindBy(css = "#days")
public WebElement loginFormDropdownDay;
@FindBy(css = "#months")
public WebElement loginFormDropdownMonth;
@FindBy(css = "#years")
public WebElement loginFormDropdownYear;
@FindBy(xpath = "//input[@name='newsletter']")
public WebElement loginFormCheckboxNewslatter;
@FindBy(xpath = "//input[@name='optin']")
public WebElement loginFormCheckboxSpecialOffer;
@FindBy(css = "#first_name")
public WebElement loginFormAdressInfoFirstName;
@FindBy(css = "#last_name")
public WebElement loginFormAdressInfoLastName;
@FindBy(css = "#company")
public WebElement loginFormAdressInfoCompany;
@FindBy(css = "#address1")
public WebElement loginFormAdressInfoAdress1;
@FindBy(css = "#address2")
public WebElement loginFormAdressInfoAdress2;
@FindBy(css = "#state")
public WebElement loginFormAdressInfoState;
@FindBy(css = "#city")
public WebElement loginFormAdressInfoCity;
@FindBy(css = "#zipcode")
public WebElement loginFormAdressInfoZipcode;
@FindBy(css = "#mobile_number")
public WebElement loginFormAdressInfoMobileNumber;
@FindBy(css = "#country")
public WebElement loginFormAdressInfoDropdownCountry;
@FindBy(xpath = "//button[@data-qa='create-account']")
public WebElement loginFormAdressInfoCreateAccountButton;
//Account created page
@FindBy(xpath = "//h2[@class='title text-center']")
public WebElement verifyAccountCreated;
@FindBy(xpath = "//a[@data-qa='continue-button']")
public WebElement accountCreateContinueButton;
//Main page After logged in
@FindBy(css = "div ul li a b")
public WebElement loggedUserName;
@FindBy(xpath = "//a[@href='/logout']")
public WebElement loggedUserLogoutButton;
//Contact US Page
@FindBy(xpath = "//h2[text()='Get In Touch']")
public WebElement contactUsFormGetInTouch;
@FindBy(xpath = "//input[@data-qa='name']")
public WebElement contactUsFormName;
@FindBy(xpath = "//input[@data-qa='email']")
public WebElement contactUsFormEmail;
@FindBy(xpath = "//input[@data-qa='subject']")
public WebElement contactUsFormSubject;
@FindBy(css = "#message")
public WebElement contactUsFormMessage;
@FindBy(xpath = "//input[@name='upload_file']")
public WebElement contactUsFormUploadFile;
@FindBy(xpath = "//input[@data-qa='submit-button']")
public WebElement contactUsSubmitButton;
@FindBy(xpath = "//div[@class='status alert alert-success']")
public WebElement contactUsAlertSuccessMessage;
@FindBy(xpath = "//a[@class='btn btn-success']")
public WebElement contactUsHomeButton;
//Products Page
@FindBy(xpath = "//input[@id='search_product']")
public WebElement productPageSearchPanel;
@FindBy(xpath = "(//a[@data-product-id='1'])[1]")
public WebElement productPageAddtoCartFirstItem;
@FindBy(xpath = "(//a[@data-product-id='2'])[1]")
public WebElement productPageAddtoCartSecondItem;
@FindBy(css = "h2[class]")
public WebElement productPageTopTitleText;
//Product detail page
@FindBy(css = ".product-information")
public WebElement oneProductPageProductInformationPanel;
@FindBy(css = "div[class='product-information'] h2")
public WebElement oneProductPageProductName;
@FindBy(css = "div[class='product-information'] p:nth-of-type(1)")
public WebElement oneProductPageProductCategory;
@FindBy(css = "div[class='product-information'] span span")
public WebElement oneProductPageProductPrice;
@FindBy(css = "div[class='product-information'] p:nth-of-type(2)")
public WebElement oneProductPageProductAvalibility;
@FindBy(css = "div[class='product-information'] p:nth-of-type(3)")
public WebElement oneProductPageProductCondition;
@FindBy(css = "div[class='product-information'] p:nth-of-type(4)")
public WebElement oneProductPageProductBrand;
@FindBy(css = "#quantity")
public WebElement oneProductPageProductQuantity;
@FindBy(xpath = "//button[@type='button']")
public WebElement oneProductPageAddToCardButton;
@FindBy(css = "a[href='#reviews']")
public WebElement oneProductPageWriteYourReviewForm;
@FindBy(css = "#name")
public WebElement oneProductPageWriteYourReviewNameInput;
@FindBy(css = "#email")
public WebElement oneProductPageWriteYourReviewEmailInput;
@FindBy(css = "#review")
public WebElement oneProductPageWriteYourReviewMessageInput;
@FindBy(css = "#button-review")
public WebElement oneProductPageWriteYourReviewSubmitButton;
@FindBy(css = "div[class='alert-success alert'] span")
public WebElement oneProductPageWriteYourReviewSuccessAlert;
//Pop-up menu
@FindBy(xpath = "//u[text()='View Cart']")
public WebElement popUpViewCartButton;
@FindBy(xpath = "//button[@class='btn btn-success close-modal btn-block']")
public WebElement popUpContinueShoppingButton;
@FindBy(xpath = "//u[text()='Register / Login']")
public WebElement popUpRegisterLoginButton;
@FindBy(xpath = "//button[@class='btn btn-success close-checkout-modal btn-block']")
public WebElement popUpContinueOnCartButton;
//Searched items
@FindBy(css = "div[class='productinfo text-center'] p")
public WebElement searchPanelSearchedItem;
//Cart Page
@FindBy(xpath = "//h2[text()='Subscription']")
public WebElement cartPageSubscriptionText;
@FindBy(xpath = "//input[@id='susbscribe_email']")
public WebElement cartPageSubscriptionInput;
@FindBy(xpath = "//i[@class='fa fa-arrow-circle-o-right']")
public WebElement cartPageSubscriptionArrowButton;
@FindBy(xpath = "//div[@class='alert-success alert']")
public WebElement cartPageSubscriptionSuccessAlert;
@FindBy(xpath = "//button[@class='disabled']")
public WebElement cartPageQuantity;
@FindBy(xpath = "//a[@class='btn btn-default check_out']")
public WebElement cartPageProceedToCheckOutButton;
@FindBy(xpath = "(//a[@class='cart_quantity_delete'])[1]")
public WebElement cartPageDeleteButton1;
@FindBy(xpath = "(//a[@class='cart_quantity_delete'])[2]")
public WebElement cartPageDeleteButton2;
@FindBy(xpath = "(//a[@class='cart_quantity_delete'])[3]")
public WebElement cartPageDeleteButton3;
@FindBy(xpath = "(//a[@class='cart_quantity_delete'])[4]")
public WebElement cartPageDeleteButton4;
@FindBy(xpath = "(//a[@class='cart_quantity_delete'])[5]")
public WebElement cartPageDeleteButton5;
@FindBy(css = "a[href='/product_details/1']")
public WebElement cartPageProduct1;
@FindBy(css = "a[href='/product_details/2']")
public WebElement cartPageProduct2;
@FindBy(css = "a[href='/product_details/3']")
public WebElement cartPageProduct3;
@FindBy(css = "a[href='/product_details/4']")
public WebElement cartPageProduct4;
@FindBy(css = "a[href='/product_details/5']")
public WebElement cartPageProduct5;
//Checkout Page
@FindBy(xpath = "//textarea[@class='form-control']")
public WebElement checkoutPageCommentTextArea;
@FindBy(xpath = "//a[@href='/payment']")
public WebElement checkoutPagePlaceOrder;
//Payment Page
@FindBy(xpath = "//button[@class='disabled']")
public WebElement paymentPagePaymentFormVerification;
@FindBy(xpath = "//input[@name='name_on_card']")
public WebElement paymentPageNameOnCardInput;
@FindBy(xpath = "//input[@name='card_number']")
public WebElement paymentPageCardNumberInput;
@FindBy(xpath = "//input[@name='cvc']")
public WebElement paymentPageCvcNumberInput;
@FindBy(xpath = "//input[@name='expiry_month']")
public WebElement paymentPageExpirationMonthInput;
@FindBy(xpath = "//input[@name='expiry_year']")
public WebElement paymentPageExpirationYearInput;
@FindBy(xpath = "//button[@id='submit']")
public WebElement paymentPagePayAndConfirmOrderButton;
//Payment Done page
@FindBy(xpath = "//p[@style='font-size: 20px; font-family: garamond;']")
public WebElement paymentDonePageSuccessMessageText;
@FindBy(xpath = "//a[@data-qa='continue-button']")
public WebElement paymentDonePageContinueButton;
}