Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Change the way the install test is executed #2196

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
import java.net.MalformedURLException;
import java.net.URL;

import org.eclipse.reddeer.common.wait.TimePeriod;
import org.eclipse.reddeer.common.wait.WaitWhile;
import org.eclipse.reddeer.integration.test.installation.common.dialog.InstallNewSoftwareDialog;
import org.eclipse.reddeer.integration.test.installation.common.page.AvailableSoftwarePage;
import org.eclipse.reddeer.integration.test.installation.common.preferences.AvailableSoftwareSitesPreferencePage;
import org.eclipse.reddeer.integration.test.installation.common.util.InstallationOperator;
import org.eclipse.reddeer.jface.preference.PreferencePage;
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.eclipse.reddeer.swt.condition.ShellIsAvailable;
import org.eclipse.reddeer.swt.impl.button.PushButton;
import org.eclipse.reddeer.swt.impl.shell.DefaultShell;
import org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog;
import org.junit.BeforeClass;
import org.junit.Rule;
Expand All @@ -47,8 +51,13 @@ public static void prepareTestEnv() {
dialog.open();
AvailableSoftwareSitesPreferencePage page = new AvailableSoftwareSitesPreferencePage(dialog);
dialog.select(page);
page.getItems().stream().forEach(item -> System.out.println(item.getText()));
page.toggleAllItems(false);
for (int i = 0; i < page.getItems().size(); i++) {
page.getItems().get(0).select();
page.clickRemove();
DefaultShell removeSites = new DefaultShell("Remove Sites");
new PushButton("Yes").click();
new WaitWhile(new ShellIsAvailable(removeSites), TimePeriod.SHORT);
}
dialog.ok();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package org.eclipse.reddeer.integration.test.installation.common.util;

import static org.junit.Assert.fail;

import org.eclipse.reddeer.common.logging.Logger;
import org.eclipse.reddeer.common.matcher.RegexMatcher;
import org.eclipse.reddeer.common.wait.TimePeriod;
Expand Down Expand Up @@ -52,6 +54,9 @@ public InstallationOperator(WizardDialog installWizard, ErrorCollector collector
public void completeInstallation() {
if (new WithTextMatcher(new RegexMatcher(RemediationActionPage.PAGE_TITLE)).matches(installWizard.getTitle())) {
dealWithRemediationPage();
if (Boolean.getBoolean("fail.on.remediation")) {
fail("Remediation page was shown, see the logs");
}
}

if (installWizard.getTitle().equals(InstallDetailsPage.PAGE_TITLE)) {
Expand Down Expand Up @@ -186,23 +191,23 @@ public void dealWithCertificatesWindow() {
public void dealWithRemediationPage() {
LOG.warn("Remediation Action page has been displayed.");

RemediationActionPage remetiationPage = new RemediationActionPage(installWizard);
RemediationActionPage remediationPage = new RemediationActionPage(installWizard);

if (remetiationPage.isEnabledShowOriginalErrors()) {
remetiationPage.chooseShowOriginalErrors();
if (remediationPage.isEnabledShowOriginalErrors()) {
remediationPage.chooseShowOriginalErrors();
capture("Remediation_Page_Show_Original_Errors");
LOG.warn("Remediation Action needed. Original error:\n" + remetiationPage.getOriginalError());
LOG.warn("Remediation Action needed. Original error:\n" + remediationPage.getOriginalError());
}

if (remetiationPage.isEnabledKeepMyInstallation()) {
remetiationPage.chooseKeepMyInstallation();
if (remediationPage.isEnabledKeepMyInstallation()) {
remediationPage.chooseKeepMyInstallation();
capture("Remediation_Page_Keep_My_Installation");
}

if (remetiationPage.isEnabledUpdateMyInstallation()) {
remetiationPage.chooseUpdateMyInstallation();
if (remediationPage.isEnabledUpdateMyInstallation()) {
remediationPage.chooseUpdateMyInstallation();
capture("Remediation_Page_Update_My_Installation");
RemediationActionValidator.validateSolution(remetiationPage, collector);
RemediationActionValidator.validateSolution(remediationPage, collector);
} else {
//collector.addError(new AssertionError("Remediation Action is needed and 'Update' choice is not available."));
LOG.warn("Remediation Action is needed and 'Update' choice is not available.");
Expand Down