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

File WYSIWYGEditPage.java

 
testUploadImageAfterPreview: Timed out after 10 seconds waiting for org.xwiki.test.ui....
 

Coverage histogram

../../../../../../img/srcFileCovDistChart3.png
80% of files have more coverage

Code metrics

0
20
10
1
128
65
10
0.5
2
10
1

Classes

Class Line # Actions
WYSIWYGEditPage 32 20 0% 10 22
0.2666666826.7%
 

Contributing tests

This file is covered by 4 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.editor;
21   
22    import org.xwiki.test.ui.po.InlinePage;
23    import org.xwiki.test.ui.po.editor.wysiwyg.EditorElement;
24    import org.xwiki.test.ui.po.editor.wysiwyg.RichTextAreaElement;
25   
26    /**
27    * Represents the actions possible in WYSIWYG edit mode.
28    *
29    * @version $Id: d5dd1fbd02189f5265bf7e795425b9484b4f21ca $
30    * @since 3.2M3
31    */
 
32    public class WYSIWYGEditPage extends PreviewableEditPage
33    {
34    /**
35    * The WYSIWYG content editor.
36    */
37    private final EditorElement editor = new EditorElement("content");
38   
39    /**
40    * Go to the passed page in WYSIWYG edit mode.
41    */
 
42  0 toggle public static WYSIWYGEditPage gotoPage(String space, String page)
43    {
44  0 getUtil().gotoPage(space, page, "edit", "editor=wysiwyg");
45  0 return new WYSIWYGEditPage();
46    }
47   
48    /**
49    * Get the <code>content</code> of the page.
50    */
 
51  2 toggle public String getContent()
52    {
53  2 return editor.getRichTextArea().getText();
54    }
55   
56    /**
57    * Sets the content of the editor (rich text area).
58    *
59    * @param content the content to be set
60    */
 
61  0 toggle public void setContent(String content)
62    {
63  0 RichTextAreaElement textArea = editor.getRichTextArea();
64  0 textArea.clear();
65  0 textArea.sendKeys(content);
66    }
67   
 
68  20 toggle @Override
69    public WYSIWYGEditPage waitUntilPageIsLoaded()
70    {
71  20 Test failure here editor.waitToLoad();
72  19 return this;
73    }
74   
 
75  7 toggle @Override
76    public WikiEditPage editWiki()
77    {
78    // Make sure the editor is loaded before we try to click the edit menu entry.
79  7 this.waitUntilPageIsLoaded();
80   
81  7 return super.editWiki();
82    }
83   
 
84  0 toggle @Override
85    public WYSIWYGEditPage editWYSIWYG()
86    {
87    // Make sure the editor is loaded before we try to click the edit menu entry.
88  0 this.waitUntilPageIsLoaded();
89   
90  0 return super.editWYSIWYG();
91    }
92   
 
93  0 toggle @Override
94    public <T extends InlinePage> T editInline()
95    {
96    // Make sure the editor is loaded before we try to click the edit menu entry.
97  0 this.waitUntilPageIsLoaded();
98   
99  0 return super.editInline();
100    }
101   
 
102  0 toggle @Override
103    public RightsEditPage editRights()
104    {
105    // Make sure the editor is loaded before we try to click the edit menu entry.
106  0 this.waitUntilPageIsLoaded();
107   
108  0 return super.editRights();
109    }
110   
 
111  0 toggle @Override
112    public ObjectEditPage editObjects()
113    {
114    // Make sure the editor is loaded before we try to click the edit menu entry.
115  0 this.waitUntilPageIsLoaded();
116   
117  0 return super.editObjects();
118    }
119   
 
120  0 toggle @Override
121    public ClassEditPage editClass()
122    {
123    // Make sure the editor is loaded before we try to click the edit menu entry.
124  0 this.waitUntilPageIsLoaded();
125   
126  0 return super.editClass();
127    }
128    }