Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UI tests that fail with Eclipse 4.18 - 4.20 #36

Merged
merged 1 commit into from
Oct 31, 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 @@ -50,7 +50,11 @@ public void run() {

// then
bot.shell("Import").activate();
bot.text(" Please select an existing execution data file.");
if (UiTestUtils.TITLE_AREA_DIALOG_USES_LABEL) {
bot.label(" Please select an existing execution data file.");
} else {
bot.text(" Please select an existing execution data file.");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public void testImport() {
treeItem.getNode("Coverage Session").select();
bot.button("Next >").click();

bot.text(" Please select an existing execution data file.");
if (UiTestUtils.TITLE_AREA_DIALOG_USES_LABEL) {
bot.label(" Please select an existing execution data file.");
} else {
bot.text(" Please select an existing execution data file.");
}
}

@Test
Expand All @@ -47,7 +51,11 @@ public void testExport() {
treeItem.getNode("Coverage Session").select();
bot.button("Next >").click();

bot.text(" No coverage session available for export.");
if (UiTestUtils.TITLE_AREA_DIALOG_USES_LABEL) {
bot.label(" No coverage session available for export.");
} else {
bot.text(" No coverage session available for export.");
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2006, 2020 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Evgeny Mandrikov - initial API and implementation
*
******************************************************************************/
package org.eclipse.eclemma.ui;

import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Version;

final class UiTestUtils {

/**
* https://github.com/eclipse-platform/eclipse.platform.ui/commit/40b5475e2790b36228537d6446e470b36386b17c
* https://github.com/eclipse-platform/eclipse.platform.ui/commit/a43240d58eebb2015c48a4957859bb944a432a6e
*/
public static final boolean TITLE_AREA_DIALOG_USES_LABEL;

static {
final Version jfaceVersion = Platform.getBundle("org.eclipse.jface")
.getVersion();
TITLE_AREA_DIALOG_USES_LABEL = jfaceVersion.getMajor() == 3
&& jfaceVersion.getMinor() == 22;
}

private UiTestUtils() {
}

}