1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.tag.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 |
|
|
29 |
|
|
30 |
|
|
|
|
| 50% |
Uncovered Elements: 8 (16) |
Complexity: 8 |
Complexity Density: 1 |
|
31 |
|
public class TagPage extends ViewPage |
32 |
|
{ |
33 |
|
@FindBy(xpath = "//a[@class='button rename']") |
34 |
|
private WebElement buttonRenameTag; |
35 |
|
|
36 |
|
@FindBy(xpath = "//a[@class='button delete']") |
37 |
|
private WebElement buttonDeleteTag; |
38 |
|
|
39 |
|
@FindBy(xpath = "//input[@class='button' and contains(@value,'Delete')]") |
40 |
|
private WebElement buttonConfirmDeleteTag; |
41 |
|
|
42 |
|
@FindBy(xpath = "//a[@class='secondary button']") |
43 |
|
private WebElement buttonCancelDeleteTag; |
44 |
|
|
45 |
|
@FindBy(xpath = "//input[@name='renameTo']") |
46 |
|
private WebElement renameTagInput; |
47 |
|
|
48 |
|
@FindBy(xpath = "//input[@value='Rename']") |
49 |
|
private WebElement buttonConfirmRename; |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
1 |
public void clickRenameButton()... |
52 |
|
{ |
53 |
1 |
this.buttonRenameTag.click(); |
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
1 |
public void setNewTagName(String newTagName)... |
57 |
|
{ |
58 |
1 |
this.renameTagInput.sendKeys(newTagName); |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0 |
public void clickCancelRenameButton()... |
62 |
|
{ |
63 |
0 |
this.buttonDeleteTag.click(); |
64 |
|
} |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
1 |
public void clickConfirmRenameTagButton()... |
66 |
|
{ |
67 |
1 |
this.buttonConfirmRename.click(); |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
0 |
public void clickDeleteButton()... |
71 |
|
{ |
72 |
0 |
this.buttonDeleteTag.click(); |
73 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
0 |
public void clickConfirmDeleteTag()... |
75 |
|
{ |
76 |
0 |
this.buttonConfirmDeleteTag.click(); |
77 |
|
} |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
1 |
public boolean hasTagHighlight(String tagName)... |
80 |
|
{ |
81 |
1 |
return getDriver().findElementsWithoutWaiting( |
82 |
|
By.xpath("//span[@class='highlight tag' and contains(text()[1], '" + tagName + "')]")).size() == 1; |
83 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
0 |
public boolean hasConfirmationMessage(String tagName)... |
85 |
|
{ |
86 |
0 |
return getDriver().findElementsWithoutWaiting( |
87 |
|
By.xpath("//div[@class='box infomessage' and contains(. ,'has been successfully deleted')]")) |
88 |
|
.size() == 1; |
89 |
|
} |
90 |
|
|
91 |
|
} |