| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 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 |
|
|
| 27 |
|
|
| 28 |
|
@link |
| 29 |
|
|
| 30 |
|
@version |
| 31 |
|
@since |
| 32 |
|
|
| |
|
| 73.1% |
Uncovered Elements: 7 (26) |
Complexity: 10 |
Complexity Density: 0.67 |
|
| 33 |
|
public class CopyPage extends ViewPage |
| 34 |
|
{ |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
private static final String VALUE = "value"; |
| 39 |
|
|
| 40 |
|
@FindBy(css = "form#copy .breadcrumb") |
| 41 |
|
private WebElement sourceBreadcrumbElement; |
| 42 |
|
|
| 43 |
|
private BreadcrumbElement sourceBreadcrumb; |
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
@FindBy(xpath = "//input[@type='hidden' and @name = 'sourceSpaceName']") |
| 49 |
|
private WebElement sourceSpaceName; |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
@FindBy(xpath = "//input[@type='hidden' and @name = 'sourcePageName']") |
| 55 |
|
private WebElement sourcePageName; |
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
@FindBy(xpath = "//input[@name = 'targetSpaceName']") |
| 61 |
|
private WebElement targetSpaceName; |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
@FindBy(xpath = "//input[@name = 'targetPageName']") |
| 67 |
|
private WebElement targetPageName; |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
@FindBy(xpath = "//input[@class = 'button' and @value = 'Copy']") |
| 73 |
|
private WebElement copyButton; |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
@return |
| 77 |
|
@since |
| 78 |
|
|
| |
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 79 |
2 |
public BreadcrumbElement getSourceLocation()... |
| 80 |
|
{ |
| 81 |
2 |
if (this.sourceBreadcrumb == null) { |
| 82 |
2 |
this.sourceBreadcrumb = new BreadcrumbElement(this.sourceBreadcrumbElement); |
| 83 |
|
} |
| 84 |
2 |
return this.sourceBreadcrumb; |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
|
| 88 |
|
@return |
| 89 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 90 |
2 |
public String getSourceSpaceName()... |
| 91 |
|
{ |
| 92 |
2 |
return this.sourceSpaceName.getAttribute(VALUE); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
@return |
| 97 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 98 |
2 |
public String getSourcePageName()... |
| 99 |
|
{ |
| 100 |
2 |
return this.sourcePageName.getAttribute(VALUE); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
|
| 104 |
|
@return |
| 105 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 106 |
3 |
public String getTargetSpaceName()... |
| 107 |
|
{ |
| 108 |
3 |
return this.targetSpaceName.getAttribute(VALUE); |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
@param |
| 115 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 116 |
0 |
public void setTargetSpaceName(String targetSpaceName)... |
| 117 |
|
{ |
| 118 |
0 |
this.targetSpaceName.clear(); |
| 119 |
0 |
this.targetSpaceName.sendKeys(targetSpaceName); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
|
| 123 |
|
@return |
| 124 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 125 |
3 |
public String getTargetPageName()... |
| 126 |
|
{ |
| 127 |
3 |
return this.targetPageName.getAttribute(VALUE); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
@param |
| 134 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 135 |
0 |
public void setTargetPageName(String targetPageName)... |
| 136 |
|
{ |
| 137 |
0 |
this.targetPageName.clear(); |
| 138 |
0 |
this.targetPageName.sendKeys(targetPageName); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
@return |
| 145 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 146 |
1 |
public CopyOrRenameStatusPage clickCopyButton()... |
| 147 |
|
{ |
| 148 |
1 |
this.copyButton.submit(); |
| 149 |
1 |
return new CopyOrRenameStatusPage(); |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
@return |
| 156 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 157 |
3 |
public CopyOverwritePromptPage clickCopyButtonExpectingOverwritePrompt()... |
| 158 |
|
{ |
| 159 |
3 |
this.copyButton.submit(); |
| 160 |
3 |
return new CopyOverwritePromptPage(); |
| 161 |
|
} |
| 162 |
|
} |