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

File ResetPasswordPage.java

 

Coverage histogram

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

Code metrics

0
10
7
1
86
48
7
0.7
1.43
7
1

Classes

Class Line # Actions
ResetPasswordPage 33 10 0% 7 2
0.8823529588.2%
 

Contributing tests

This file is covered by 1 test. .

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.administration.test.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.WebElement;
24    import org.openqa.selenium.support.FindBy;
25    import org.xwiki.test.ui.po.ViewPage;
26   
27    /**
28    * Represents the actions possible on the XWiki.ResetPassword page.
29    *
30    * @version $Id: ba41b3ff573e3888102474bdfeda7b272fef67bb $
31    * @since 7.0M2
32    */
 
33    public class ResetPasswordPage extends ViewPage
34    {
35    @FindBy(id = "u")
36    private WebElement userNameInput;
37   
38    @FindBy(css = ".xcontent form input[type='submit']")
39    private WebElement resetPasswordButton;
40   
41    @FindBy(css = ".xcontent .box")
42    private WebElement messageBox;
43   
44    @FindBy(xpath = "//.[@class='xcontent']//a[contains(text(), 'Retry')]")
45    private WebElement retryUserNameButton;
46   
 
47  2 toggle public static ResetPasswordPage gotoPage()
48    {
49  2 getUtil().gotoPage("XWiki", "ResetPassword");
50  2 return new ResetPasswordPage();
51    }
52   
 
53  0 toggle public String getUserName()
54    {
55  0 return userNameInput.getAttribute("value");
56    }
57   
 
58  3 toggle public void setUserName(String userName)
59    {
60  3 this.userNameInput.sendKeys(userName);
61    }
62   
 
63  3 toggle public ResetPasswordPage clickResetPassword()
64    {
65  3 resetPasswordButton.click();
66  3 return new ResetPasswordPage();
67    }
68   
 
69  3 toggle public boolean isResetPasswordSent()
70    {
71    // If there is no form and we see an info box, then the request was sent.
72  3 return !getDriver().hasElementWithoutWaiting(By.cssSelector(".xcontent form"))
73    && messageBox.getAttribute("class").contains("infomessage");
74    }
75   
 
76  2 toggle public String getMessage()
77    {
78  2 return messageBox.getText();
79    }
80   
 
81  1 toggle public ResetPasswordPage clickRetry()
82    {
83  1 retryUserNameButton.click();
84  1 return new ResetPasswordPage();
85    }
86    }