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

File ApplicationTemplateProviderEditPage.java

 

Coverage histogram

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

Code metrics

0
20
11
1
124
71
11
0.55
1.82
11
1

Classes

Class Line # Actions
ApplicationTemplateProviderEditPage 35 20 0% 11 16
0.4838709548.4%
 

Contributing tests

This file is covered by 8 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.appwithinminutes.test.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.Keys;
24    import org.openqa.selenium.WebElement;
25    import org.openqa.selenium.support.FindBy;
26    import org.openqa.selenium.support.ui.Select;
27   
28    /**
29    * Represents the actions available when editing the application template provider. This is also the third step of the
30    * App Within Minutes wizard, in which the application entries are configured.
31    *
32    * @version $Id: d750c6e07fe6a8dc6e898deec4d875ceb0ee7d47 $
33    * @since 8.4
34    */
 
35    public class ApplicationTemplateProviderEditPage extends ApplicationEditPage
36    {
37    @FindBy(id = "XWiki.TemplateProviderClass_0_icon")
38    private WebElement iconInput;
39   
40    @FindBy(id = "XWiki.TemplateProviderClass_0_description")
41    private WebElement descriptionInput;
42   
43    @FindBy(id = "XWiki.TemplateProviderClass_0_creationRestrictionsAreSuggestions")
44    private WebElement creationRestrictionsAreSuggestionsCheckBox;
45   
46    @FindBy(id = "XWiki.TemplateProviderClass_0_terminal")
47    private WebElement terminalSelect;
48   
49    /**
50    * Clicks on the Next Step button.
51    *
52    * @return the page that represents the next step of the App Within Minutes wizard
53    */
 
54  9 toggle public ApplicationHomeEditPage clickNextStep()
55    {
56  9 nextStepButton.click();
57  9 return new ApplicationHomeEditPage();
58    }
59   
60    /**
61    * Clicks on the Previous Step button.
62    *
63    * @return the page that represents the previous step of the App Within Minutes wizard
64    */
 
65  2 toggle public ApplicationClassEditPage clickPreviousStep()
66    {
67  2 previousStepButton.click();
68  2 return new ApplicationClassEditPage();
69    }
70   
 
71  1 toggle public ApplicationTemplateProviderEditPage setIcon(String icon)
72    {
73  1 this.iconInput.clear();
74  1 this.iconInput.sendKeys(icon);
75    // Make sure the icon picker doesn't remain open.
76  1 this.iconInput.sendKeys(Keys.ESCAPE);
77  1 return this;
78    }
79   
 
80  0 toggle public String getIcon()
81    {
82  0 return this.iconInput.getText();
83    }
84   
 
85  1 toggle public ApplicationTemplateProviderEditPage setDescription(String description)
86    {
87  1 this.descriptionInput.clear();
88  1 this.descriptionInput.sendKeys(description);
89  1 return this;
90    }
91   
 
92  0 toggle public String getDescription()
93    {
94  0 return this.descriptionInput.getText();
95    }
96   
 
97  0 toggle public ApplicationTemplateProviderEditPage clickEnforceEntryLocation()
98    {
99  0 this.creationRestrictionsAreSuggestionsCheckBox.click();
100  0 return this;
101    }
102   
 
103  0 toggle public boolean isEntryLocationEnforced()
104    {
105  0 return !this.creationRestrictionsAreSuggestionsCheckBox.isSelected();
106    }
107   
 
108  0 toggle public ApplicationTemplateProviderEditPage setTerminal(String visibleText)
109    {
110  0 new Select(this.terminalSelect).deselectByVisibleText(visibleText);
111  0 return this;
112    }
113   
 
114  0 toggle public String getTerminal()
115    {
116  0 return new Select(this.terminalSelect).getFirstSelectedOption().getText();
117    }
118   
 
119  0 toggle public boolean hasTerminalOption()
120    {
121  0 return getDriver().findElementsWithoutWaiting(By.cssSelector("select#XWiki\\.TemplateProviderClass_0_terminal"))
122    .size() > 0;
123    }
124    }