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

Flaky UI tests #203

Merged
merged 9 commits into from
Aug 24, 2022
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
2 changes: 1 addition & 1 deletion tests/org.pitest.pitclipse.ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<!-- Increase the timeout for SWTBot especially for the CI -->
<argLine>${additionalTestArgLine} ${os-jvm-flags} -Dorg.eclipse.swtbot.search.timeout=90000 -Dorg.pitest.pitclipse.tests.pit.timeout=20000</argLine>
<argLine>${additionalTestArgLine} ${os-jvm-flags} -Dorg.eclipse.swtbot.search.timeout=180000 -Dorg.pitest.pitclipse.tests.pit.timeout=20000</argLine>
</configuration>
</plugin>
<!-- Explicit dependency to the listeners fragment: make Pitclipse's mutation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.pitest.pitclipse.ui.behaviours.pageobjects;

import static org.pitest.pitclipse.ui.behaviours.pageobjects.PageObjects.PAGES;
import static org.pitest.pitclipse.ui.behaviours.pageobjects.SwtBotTreeHelper.expand;

import java.util.List;
Expand Down Expand Up @@ -60,10 +61,15 @@ public SWTBotTree mutationTreeRoot() {
}

public SWTBotView getView() {
// let's close the Console view first, otherwise it seems
// to block the opening of "PIT Mutations"
PAGES.getConsole().close();
SWTBotView mutationsView = bot.viewByTitle("PIT Mutations");
mutationsView.show();
mutationsView.setFocus();
// Make sure the 'PIT Mutations' view is opened
bot.waitUntil(new ViewOpenedCondition(bot, "PIT Mutations"));
// this should not be required anymore
// bot.waitUntil(new ViewOpenedCondition(bot, "PIT Mutations"));
return mutationsView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public ViewOpenedCondition(SWTWorkbenchBot bot, String viewTitle) {
this.bot = bot;
this.viewTitle = viewTitle;
}

@Override
public boolean test() throws Exception {
return bot.viewByTitle(viewTitle) != null;
return bot.viewByTitle(viewTitle).isActive();
}

@Override
public String getFailureMessage() {
return "The view '" + viewTitle + "' did not open";
Expand Down