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

File CopyOverwritePromptPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
7
4
1
94
33
4
0.57
1.75
4
1

Classes

Class Line # Actions
CopyOverwritePromptPage 31 7 0% 4 0
1.0100%
 

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.test.ui.po;
21   
22    import org.openqa.selenium.WebElement;
23    import org.openqa.selenium.support.FindBy;
24   
25    /**
26    * Represents the common actions possible after trying to copy a page over an existing page.
27    *
28    * @version $Id: b3d234236ceb82304a93bbb59090cd9d2988133a $
29    * @since 5.3M1
30    */
 
31    public class CopyOverwritePromptPage extends ViewPage
32    {
33    /**
34    * The warning message.
35    */
36    @FindBy(className = "warningmessage")
37    private WebElement warningMessage;
38   
39    /**
40    * The copy button.
41    */
42    @FindBy(xpath = "//input[@class = 'button' and @value = 'Copy']")
43    private WebElement copyButton;
44   
45    /**
46    * The change target button.
47    */
48    @FindBy(xpath = "//a[@class = 'secondary button' and normalize-space(.) = 'Change the target page']")
49    private WebElement changeButton;
50   
51    /**
52    * The cancel button.
53    */
54    @FindBy(xpath = "//a[@class = 'secondary button' and text()='Cancel']")
55    private WebElement cancelButton;
56   
57    /**
58    * Submit the copy overwrite prompt page form.
59    * @return the copy confirmation page.
60    */
 
61  1 toggle public CopyOrRenameStatusPage clickCopyButton()
62    {
63  1 this.copyButton.submit();
64  1 return new CopyOrRenameStatusPage();
65    }
66   
67    /**
68    * Click the change target link.
69    * @return the copy page.
70    */
 
71  1 toggle public CopyPage clickChangeTargetButton()
72    {
73  1 this.changeButton.click();
74  1 return new CopyPage();
75    }
76   
77    /**
78    * Click the cancel link.
79    * @return the view page of the originaly copied document.
80    */
 
81  1 toggle public ViewPage clickCancelButton()
82    {
83  1 this.cancelButton.click();
84  1 return new CopyPage();
85    }
86   
87    /**
88    * @return the overwrite warning message.
89    */
 
90  1 toggle public String getWarningMessage()
91    {
92  1 return this.warningMessage.getText();
93    }
94    }