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

File WYSIWYGEditorConfigTest.java

 

Code metrics

0
8
2
1
74
34
2
0.25
4
2
1

Classes

Class Line # Actions
WYSIWYGEditorConfigTest 40 8 0% 2 0
1.0100%
 

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.test.ui.administration;
21   
22    import org.junit.Assert;
23   
24    import org.apache.commons.lang3.RandomStringUtils;
25    import org.junit.Before;
26    import org.junit.Rule;
27    import org.junit.Test;
28    import org.xwiki.administration.test.po.AdministrationPage;
29    import org.xwiki.administration.test.po.WYSIWYGEditorAdministrationSectionPage;
30    import org.xwiki.test.ui.AbstractTest;
31    import org.xwiki.test.ui.AdminAuthenticationRule;
32    import org.xwiki.test.ui.browser.IgnoreBrowser;
33   
34    /**
35    * Test the WYSIWYG Editor administration section.
36    *
37    * @version $Id: b07859a414c8beb22baa5da269711759ed8c934d $
38    * @since 3.3M2
39    */
 
40    public class WYSIWYGEditorConfigTest extends AbstractTest
41    {
42    @Rule
43    public AdminAuthenticationRule adminAuthenticationRule = new AdminAuthenticationRule(getUtil());
44   
45    /**
46    * The WYSIWYG Editor administration section.
47    */
48    private WYSIWYGEditorAdministrationSectionPage wysiwygSection;
49   
 
50  1 toggle @Before
51    public void setUp() throws Exception
52    {
53  1 wysiwygSection = AdministrationPage.gotoPage().clickWYSIWYGEditorSection();
54    }
55   
56    /**
57    * Try to enable a dummy WYSIWYG editor plugin from the administration.
58    *
59    * @since 3.3M2
60    */
 
61  1 toggle @Test
62    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146")
63    public void testEnablePlugin()
64    {
65  1 String pluginName = RandomStringUtils.randomAlphabetic(5);
66  1 Assert.assertFalse(wysiwygSection.getEnabledPlugins().contains(pluginName));
67  1 wysiwygSection.enablePlugin(pluginName);
68  1 wysiwygSection.clickSave();
69    // Reload the administration section.
70  1 getDriver().navigate().refresh();
71  1 wysiwygSection = new WYSIWYGEditorAdministrationSectionPage();
72  1 Assert.assertTrue(wysiwygSection.getEnabledPlugins().contains(pluginName));
73    }
74    }