/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.extension.test.po.distribution;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 * The Orphaned Dependencies step UI.
 * 
 * @version $Id$
 * @since 11.10
 */
public class CleanApplyFinalizeDistributionStep extends AbstractDistributionPage
{
    @FindBy(xpath = "//button[@name='cleanapplyreport']")
    private WebElement continueButton;

    public void waitForUninstallComplete()
    {
        getDriver().waitUntilElementIsVisible(By.xpath("//button[@name='cleanapplyreport' and not(@disabled)]"));
    }

    public CleanApplyReportDistributionStep clickContinue()
    {
        // FIXME: workaround for https://github.com/mozilla/geckodriver/issues/1026
        getDriver().addPageNotYetReloadedMarker();
        this.continueButton.click();
        getDriver().waitUntilPageIsReloaded();

        return new CleanApplyReportDistributionStep();
    }
}

@@ -1096,17 +1096,16 @@
 p UI.%0A *
- 
 %0A * @ver
@@ -1356,32 +1356,222 @@
 omplete()%0A    %7B%0A
+        // Skip this step when the progress bar is not needed (i.e., no dependencies are checked in the orphaned %0A        // dependencies list).%0A        if (!isCompleteStepDisabled()) %7B%0A    
         getDrive
@@ -1668,16 +1668,26 @@
 d)%5D%22));%0A
+        %7D%0A
     %7D%0A%0A 
@@ -1761,16 +1761,206 @@
       //
+ Skip this step when the progress bar is not needed (i.e., no dependencies are checked in the orphaned %0A        // dependencies list).%0A        if (!isCompleteStepDisabled()) %7B%0A            //
  FIXME: 
@@ -2025,32 +2025,36 @@
 es/1026%0A        
+   
+ 
 getDriver().addP
@@ -2088,16 +2088,20 @@
         
+    
 this.con
@@ -2121,32 +2121,36 @@
 lick();%0A        
+ 
+   
 getDriver().wait
@@ -2172,16 +2172,25 @@
 aded();%0A
+        %7D
 %0A       

Fix upgrade tests when unchecked orphaned dependencies exist