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

File MergeConflictPane.java

 

Coverage histogram

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

Code metrics

0
7
5
1
107
41
5
0.71
1.4
5
1

Classes

Class Line # Actions
MergeConflictPane 35 7 0% 5 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.extension.test.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.WebElement;
24    import org.openqa.selenium.support.FindBy;
25    import org.openqa.selenium.support.ui.Select;
26    import org.xwiki.test.ui.po.BaseElement;
27    import org.xwiki.test.ui.po.ChangesPane;
28   
29    /**
30    * The merge conflict resolution UI.
31    *
32    * @version $Id: 833a8d18f72a6e7a1c412a07c87378f4b3476473 $
33    * @since 4.2M1
34    */
 
35    public class MergeConflictPane extends BaseElement
36    {
37    /**
38    * The list box used to specify which version to keep.
39    */
40    @FindBy(name = "versionToKeep")
41    private WebElement versionToKeepSelect;
42   
43    /**
44    * The list box used to select the 'from' version for comparison.
45    */
46    @FindBy(name = "original")
47    private WebElement fromVersionSelect;
48   
49    /**
50    * The list box used to select the 'to' version for comparison.
51    */
52    @FindBy(name = "revised")
53    private WebElement toVersionSelect;
54   
55    /**
56    * The button used to compare the selected versions.
57    */
58    @FindBy(xpath = "//button[@name = 'extensionAction' and @value = 'diff']")
59    private WebElement diffButton;
60   
61    /**
62    * @return the list box used to specify which version to keep
63    */
 
64  1 toggle public Select getVersionToKeepSelect()
65    {
66    // We use a custom implementation because the drop down list remains open some times when we select an option.
67  1 return new org.xwiki.test.ui.po.Select(versionToKeepSelect);
68    }
69   
70    /**
71    * @return the list box used to select the 'from' version for comparison
72    */
 
73  1 toggle public Select getFromVersionSelect()
74    {
75  1 return new Select(fromVersionSelect);
76    }
77   
78    /**
79    * @return the list box used to select the 'to' version for comparison
80    */
 
81  1 toggle public Select getToVersionSelect()
82    {
83  1 return new Select(toVersionSelect);
84    }
85   
86    /**
87    * Clicks the button to show the changes between the selected versions.
88    *
89    * @return the new merge conflict pane displaying the changes between the selected versions
90    */
 
91  1 toggle public MergeConflictPane clickShowChanges()
92    {
93  1 diffButton.click();
94    // Wait as long as the button remains disabled.
95  1 getDriver().waitUntilElementIsVisible(
96    By.xpath("//button[@name = 'extensionAction' and @value = 'diff' and not(@disabled)]"));
97  1 return new MergeConflictPane();
98    }
99   
100    /**
101    * @return the changes between the selected versions
102    */
 
103  2 toggle public ChangesPane getChanges()
104    {
105  2 return new ChangesPane();
106    }
107    }