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

File TagPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart5.png
74% of files have more coverage

Code metrics

0
8
8
1
91
55
8
1
1
8
1

Classes

Class Line # Actions
TagPage 31 8 0% 8 8
0.550%
 

Contributing tests

This file is covered by 2 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.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    * Models a view page of a Tag (when clicking on a tag).
29    *
30    */
 
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   
 
51  1 toggle public void clickRenameButton()
52    {
53  1 this.buttonRenameTag.click();
54    }
55   
 
56  1 toggle public void setNewTagName(String newTagName)
57    {
58  1 this.renameTagInput.sendKeys(newTagName);
59    }
60   
 
61  0 toggle public void clickCancelRenameButton()
62    {
63  0 this.buttonDeleteTag.click();
64    }
 
65  1 toggle public void clickConfirmRenameTagButton()
66    {
67  1 this.buttonConfirmRename.click();
68    }
69   
 
70  0 toggle public void clickDeleteButton()
71    {
72  0 this.buttonDeleteTag.click();
73    }
 
74  0 toggle public void clickConfirmDeleteTag()
75    {
76  0 this.buttonConfirmDeleteTag.click();
77    }
78   
 
79  1 toggle 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    }
 
84  0 toggle 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    }