1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.user.test.po

File ChangePasswordPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
15
7
1
95
59
7
0.47
2.14
7
1

Classes

Class Line # Actions
ChangePasswordPage 27 15 0% 7 2
0.9090909490.9%
 

Contributing tests

This file is covered by 5 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.user.test.po;
21   
22    import org.openqa.selenium.WebElement;
23    import org.openqa.selenium.support.FindBy;
24    import org.xwiki.test.ui.po.BasePage;
25   
26    /** User profile, change password action. */
 
27    public class ChangePasswordPage extends BasePage
28    {
29    @FindBy(xpath = "//input[@id='xwikioriginalpassword']")
30    private WebElement originalPassword;
31   
32    @FindBy(xpath = "//input[@id='xwikipassword']")
33    private WebElement password1;
34   
35    @FindBy(xpath = "//input[@id='xwikipassword2']")
36    private WebElement password2;
37   
38    @FindBy(xpath = "//input[@value='Save']")
39    private WebElement changePassword;
40   
41    @FindBy(xpath = "//a[@class='secondary button']")
42    private WebElement cancelPasswordChange;
43   
44    @FindBy(xpath = "//span[@class='box errormessage']")
45    private WebElement errorMessage;
46   
47    @FindBy(xpath = "//span[@class='LV_validation_message LV_invalid']")
48    private WebElement validationErrorMessage;
49   
50    @FindBy(xpath = "//span[@class='box infomessage']")
51    private WebElement successMessage;
52   
 
53  3 toggle public void changePassword(String originalPassword, String password, String password2)
54    {
55  3 this.originalPassword.clear();
56  3 this.originalPassword.sendKeys(originalPassword);
57  3 this.password1.clear();
58  3 this.password1.sendKeys(password);
59  3 this.password2.clear();
60  3 this.password2.sendKeys(password2);
61    }
62   
 
63  2 toggle public void changePasswordAsAdmin(String password, String password2)
64    {
65  2 this.password1.clear();
66  2 this.password1.sendKeys(password);
67  2 this.password2.clear();
68  2 this.password2.sendKeys(password2);
69    }
70   
 
71  1 toggle public String getErrorMessage()
72    {
73  1 return errorMessage.getText();
74    }
75   
 
76  3 toggle public String getValidationErrorMessage()
77    {
78  3 return validationErrorMessage.getText();
79    }
80   
 
81  1 toggle public String getSuccessMessage()
82    {
83  1 return successMessage.getText();
84    }
85   
 
86  6 toggle public void submit()
87    {
88  6 this.changePassword.click();
89    }
90   
 
91  0 toggle public void cancel()
92    {
93  0 this.cancelPasswordChange.click();
94    }
95    }