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

File DeletingPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
7
6
1
94
43
6
0.86
1.17
6
1

Classes

Class Line # Actions
DeletingPage 32 7 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 5 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.test.ui.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.WebElement;
24    import org.openqa.selenium.support.FindBy;
25   
26    /**
27    * Represents the page displayed while the page (and maybe its children) is deleted.
28    *
29    * @version $Id: ef28e715bcff5b8304e325ec13e0c7a4bd534c9c $
30    * @since 7.2M3
31    */
 
32    public class DeletingPage extends ViewPage
33    {
34    private static final String SUCCESS_MESSAGE_ID = "successMessage";
35   
36    private static final String ERROR_MESSAGE_ID = "errorMessage";
37   
38    private static final String PROGRESS_BAR_CONTAINER_ID = "delete-progress-bar-container";
39   
40    @FindBy(id = SUCCESS_MESSAGE_ID)
41    private WebElement successMessage;
42   
43    @FindBy(id = ERROR_MESSAGE_ID)
44    private WebElement errorMessage;
45   
46    @FindBy(id = PROGRESS_BAR_CONTAINER_ID)
47    private WebElement progressBarContainer;
48   
49    @FindBy(xpath = "//div[@id = 'document-title']//a")
50    private WebElement titleLink;
51   
52    /**
53    * @return true if the deletion process is terminated
54    */
 
55  1 toggle public boolean isTerminated()
56    {
57  1 return !progressBarContainer.isDisplayed();
58    }
59   
60    /**
61    * Wait until the delete process is terminated
62    */
 
63  7 toggle public void waitUntilIsTerminated()
64    {
65  7 getDriver().waitUntilElementDisappears(By.id(PROGRESS_BAR_CONTAINER_ID));
66    }
67   
 
68  1 toggle public boolean isSuccess()
69    {
70  1 return successMessage.isDisplayed();
71    }
72   
73    /**
74    * Wait until the delete process is terminated
75    * @since 8.1M1
76    */
 
77  2 toggle public void waitUntilSuccessMessage()
78    {
79  2 getDriver().waitUntilElementIsVisible(By.id(SUCCESS_MESSAGE_ID));
80    }
81   
 
82  2 toggle public String getSuccessMessage()
83    {
84  2 return successMessage.getText();
85    }
86   
 
87  4 toggle public DeletePageOutcomePage getDeletePageOutcomePage()
88    {
89    // Click on the title to get back to the "view" mode
90  4 titleLink.click();
91    // Since the page is deleted, we should have the "delete page outcome" UI...
92  4 return new DeletePageOutcomePage();
93    }
94    }