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

File WikiCreationPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart6.png
69% of files have more coverage

Code metrics

0
11
8
1
85
49
8
0.73
1.38
8
1

Classes

Class Line # Actions
WikiCreationPage 26 11 0% 8 8
0.5789473757.9%
 

Contributing tests

This file is covered by 1 test. .

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.wiki.test.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.WebElement;
24    import org.openqa.selenium.support.FindBy;
25   
 
26    public class WikiCreationPage extends ExtendedViewPage
27    {
28    @FindBy(id = "finalize")
29    private WebElement finalizeButton;
30   
31    @FindBy(xpath = "//div[@class='wizard-header']/h1/span")
32    private WebElement stepTitle;
33   
34    @FindBy(id = "creation-log")
35    private WebElement log;
36   
 
37  0 toggle public static String getSpace()
38    {
39  0 return "WikiManager";
40    }
41   
 
42  0 toggle public static String getPage()
43    {
44  0 return "CreateNewWiki";
45    }
46   
 
47  3 toggle public WikiHomePage finalizeCreation()
48    {
49    // The finalize button is not visible until the provisioning is done, so we wait for it
50  3 getDriver().waitUntilElementIsVisible(By.id("finalize"), 30);
51    // Now we can click
52  3 finalizeButton.click();
53    // And wait for the page to be loaded
54  3 waitUntilPageIsLoaded();
55    // And now we are in the home page of the new created wiki
56  3 return new WikiHomePage();
57    }
58   
 
59  3 toggle public String getStepTitle()
60    {
61  3 return stepTitle.getText();
62    }
63   
 
64  0 toggle public boolean isFinalizeButtonEnabled()
65    {
66  0 return finalizeButton.isEnabled();
67    }
68   
 
69  0 toggle public boolean isFinalizeButtonVisible()
70    {
71  0 return finalizeButton.isDisplayed();
72    }
73   
 
74  2 toggle public void waitForFinalizeButton(int timeout)
75    {
76    // The finalize button is not visible until the provisioning is done, so we wait for it
77  2 getDriver().waitUntilElementIsVisible(By.id("finalize"), timeout);
78    }
79   
 
80  3 toggle public boolean hasLogError()
81    {
82  3 return !getDriver().findElementsWithoutWaiting(
83    By.xpath("div[@id='creation-log']//li[contains(@class, 'log-item-error')]")).isEmpty();
84    }
85    }