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

File TemplatesAdministrationSectionPage.java

 

Coverage histogram

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

Code metrics

2
13
5
1
92
44
6
0.46
2.6
5
1.2

Classes

Class Line # Actions
TemplatesAdministrationSectionPage 35 13 0% 6 3
0.8585%
 

Contributing tests

This file is covered by 3 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.administration.test.po;
21   
22    import java.util.List;
23   
24    import org.openqa.selenium.By;
25    import org.openqa.selenium.WebElement;
26    import org.openqa.selenium.support.FindBy;
27    import org.xwiki.test.ui.po.DocumentPicker;
28   
29    /**
30    * Represents the actions possible on the Templates Administration Page.
31    *
32    * @version $Id: 0f9773910f601f18c110fb4bbbc9b675c4e32855 $
33    * @since 4.2M1
34    */
 
35    public class TemplatesAdministrationSectionPage extends AdministrationSectionPage
36    {
37    public static final String ADMINISTRATION_SECTION_ID = "Templates";
38   
39    /**
40    * The element that contains the document picker used to select the target document.
41    */
42    @FindBy(className = "location-picker")
43    private WebElement documentPickerElement;
44   
45    private DocumentPicker documentPicker;
46   
47    @FindBy(id = "createTemplateProvider")
48    private WebElement createButton;
49   
50    /**
51    * @since 4.2M1
52    */
 
53  3 toggle public static TemplatesAdministrationSectionPage gotoPage()
54    {
55  3 AdministrationSectionPage.gotoPage(ADMINISTRATION_SECTION_ID);
56  3 return new TemplatesAdministrationSectionPage();
57    }
58   
 
59  3 toggle public TemplatesAdministrationSectionPage()
60    {
61  3 super(ADMINISTRATION_SECTION_ID);
62    }
63   
64    /**
65    * @return the document picker used to select the target document
66    */
 
67  3 toggle public DocumentPicker getDocumentPicker()
68    {
69  3 if (this.documentPicker == null) {
70  3 this.documentPicker = new DocumentPicker(this.documentPickerElement);
71    }
72   
73  3 return this.documentPicker;
74    }
75   
 
76  3 toggle public TemplateProviderInlinePage createTemplateProvider(String space, String page)
77    {
78  3 DocumentPicker documentPicker = getDocumentPicker();
79  3 documentPicker.toggleLocationAdvancedEdit();
80  3 documentPicker.setParent(space);
81  3 documentPicker.setName(page);
82  3 this.createButton.click();
83   
84  3 return new TemplateProviderInlinePage();
85    }
86   
 
87  0 toggle public List<WebElement> getExistingTemplatesLinks()
88    {
89    // A bit unreliable here, but it's the best I can do.
90  0 return getDriver().findElements(By.xpath("//ul[preceding-sibling::*[. = 'Available Template Providers']]//a"));
91    }
92    }