[546681] Use a more reliable way to manipulate editors and wizard
Also improve the way to manipulate properties tabs.
Bug: 546681
Change-Id: I3920f53ee9835a2acc84c3f48eb54da4e3fb2993
Signed-off-by: Pierre Guilet <pierre.guilet@obeo.fr>
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index c81d118..3fdf661 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -156,6 +156,11 @@
<code>org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper.selectPropertyTabItem(String, SWTBot)</code> has been added. It allows to look for property tab from a given bot. The bot corresponding to the property view should be given otherwise the search could fail starting from Eclipse 2019-06.
</li>
</ul>
+ <ul>
+ <li><span class="label label-success">Added</span>The method
+ <code>org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper.getShellBot(String)</code> has been added and allows to retrieve a bot related to a shell with the given label.
+ </li>
+ </ul>
<h2 id="sirius6.2.0">Changes in Sirius 6.2.0</h2>
<h3 id="UserVisibleChanges">User-Visible Changes</h3>
<ul>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 3559610..0fd66f5 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -23,6 +23,8 @@
* <span class="label label-success">Added</span> The method @org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper.selectPropertyTabItem(String, SWTBot)@ has been added. It allows to look for property tab from a given bot. The bot corresponding to the property view should be given otherwise the search could fail starting from Eclipse 2019-06.
+* <span class="label label-success">Added</span>The method @org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper.getShellBot(String)@ has been added and allows to retrieve a bot related to a shell with the given label.
+
h2(#sirius6.2.0). Changes in Sirius 6.2.0
h3. User-Visible Changes
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
index 38fee9e..8ed122c 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2018 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2009, 2019 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
index af7af9c..257e9cf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
@@ -61,8 +61,7 @@
* @param clickedRepresentationName
* Representation name clicked in contextual menu
* @param representationDescriptionLabel
- * The label of the representation description corresponding to
- * <code>clickedRepresentationName</code>.
+ * The label of the representation description corresponding to <code>clickedRepresentationName</code>.
* @param representationType
* Java type of representation.
*/
@@ -88,7 +87,7 @@
shell = mainBot.shell(MessageFormat.format(Messages.createRepresentationInputDialog_Title, representationDescriptionLabel));
shell.activate();
- shellBot = new SWTBot(shell.widget);
+ shellBot = shell.bot();
return this;
}
@@ -133,8 +132,7 @@
* Finish creation with click on "ok".
*
* @param disableSnapToGridOnThisEditor
- * true if the snapToGrid must be disable for this editor, false
- * otherwise
+ * true if the snapToGrid must be disable for this editor, false otherwise
* @return Representation.
*/
@Override
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UIPerspective.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UIPerspective.java
index 688069c..68a5b29 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UIPerspective.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UIPerspective.java
@@ -150,7 +150,7 @@
*
* @param project
* name of the project to delete.
- * @deprecated use {@link EclipseTestsSupportHelper#deleteProject(String)}
+ * @deprecated use {@link EclipseTestsSupportHelper#deleteProject(String)}
*/
@Deprecated
public void deleteProject(final UIProject project) {
@@ -162,7 +162,7 @@
*
* @param projectName
* name of the project to delete.
- * @deprecated use {@link EclipseTestsSupportHelper#deleteProject(String)}
+ * @deprecated use {@link EclipseTestsSupportHelper#deleteProject(String)}
*/
@Deprecated
public void deleteProject(final String projectName) {
@@ -204,9 +204,9 @@
private void openRepresentationsFileWizard() {
bot.menu("File").menu(UIPerspective.WIZARDS_LIST_TITLE).menu("Other...").click();
- SWTBot wizardListBot = bot.activeShell().bot();
- wizardListBot.waitUntil(Conditions.shellIsActive(UIPerspective.WIZARDS_LIST_TITLE));
+ bot.waitUntil(Conditions.shellIsActive(UIPerspective.WIZARDS_LIST_TITLE));
+ SWTBot wizardListBot = bot.shell(UIPerspective.WIZARDS_LIST_TITLE).bot();
wizardListBot.text().setText(UIPerspective.REPRESENTATIONS_FILE_LABEL);
SWTBotTree wizardsTree = wizardListBot.tree();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/dialog/ViewpointSelectionDialog.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/dialog/ViewpointSelectionDialog.java
index 0686f24..b0e3bee 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/dialog/ViewpointSelectionDialog.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/dialog/ViewpointSelectionDialog.java
@@ -19,6 +19,7 @@
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
@@ -50,11 +51,10 @@
}
/**
- * "Select Viewpoints" operation (when creating a new local session, either
- * via wizard or drag and drop of model in local session view).
+ * "Select Viewpoints" operation (when creating a new local session, either via wizard or drag and drop of model in
+ * local session view).
* <p>
- * If a viewpoint is provided in both sets, this viewpoint will be selected.
- * Unselection action will be ignored.
+ * If a viewpoint is provided in both sets, this viewpoint will be selected. Unselection action will be ignored.
* </p>
*
* @param viewpointToSelect
@@ -66,7 +66,7 @@
bot.waitUntil(Conditions.shellIsActive(ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME));
final SWTBotShell shellViewpointsSelection = bot.shell(ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME);
-
+ SWTBot viewpointSelectionBot = shellViewpointsSelection.bot();
if (viewpointToSelect != null && viewpointToDeselect != null) {
// Put the two lists in new one in order to call
// remove() on it and failIfMissingViewpoints() at the end
@@ -74,9 +74,10 @@
viewpointSelection.addAll(viewpointToDeselect);
if (!viewpointSelection.isEmpty()) {
- for (int rowPosition = 0; rowPosition < bot.table().rowCount(); rowPosition++) {
- final SWTBotTableItem item = bot.table().getTableItem(rowPosition);
+ for (int rowPosition = 0; rowPosition < viewpointSelectionBot.table().rowCount(); rowPosition++) {
+
+ final SWTBotTableItem item = viewpointSelectionBot.table().getTableItem(rowPosition);
final String text = item.getText();
if (viewpointToSelect.contains(text)) {
@@ -91,9 +92,9 @@
}
failIfMissingViewpoints(viewpointSelection);
- final SWTBotButton okButton = bot.button("OK");
+ final SWTBotButton okButton = viewpointSelectionBot.button("OK");
- bot.waitUntil(new DefaultCondition() {
+ viewpointSelectionBot.waitUntil(new DefaultCondition() {
@Override
public String getFailureMessage() {
@@ -108,7 +109,7 @@
});
}
}
- bot.button("OK").click();
+ viewpointSelectionBot.button("OK").click();
SWTBotUtils.waitProgressMonitorClose("Progress Information");
bot.waitUntil(Conditions.shellCloses(shellViewpointsSelection));
@@ -116,8 +117,8 @@
}
/**
- * "Select Viewpoints" operation (when creating a new local session, either
- * via wizard or drag and drop of model in local session view).
+ * "Select Viewpoints" operation (when creating a new local session, either via wizard or drag and drop of model in
+ * local session view).
*
* @param viewpoints
* Viewpoint to select.
@@ -127,8 +128,8 @@
}
/**
- * "Select Viewpoints" operation (when creating a new local session, either
- * via wizard or drag and drop of model in local session view).
+ * "Select Viewpoints" operation (when creating a new local session, either via wizard or drag and drop of model in
+ * local session view).
*
* @param viewpoints
* Viewpoint to deselect.
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusHelper.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusHelper.java
index 05b213e..ca93749 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusHelper.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusHelper.java
@@ -130,6 +130,18 @@
}
/**
+ * Return the swtbot corresponding to the shell with the given label.
+ *
+ * @param label
+ * the label of the shell from which we want the related swtbot.
+ * @return the swtbot corresponding to the shell with the given label.
+ */
+ public static SWTBot getShellBot(String label) {
+ bot.waitUntil(Conditions.shellIsActive(label));
+ return bot.shell(label).bot();
+ }
+
+ /**
* Select the tab with the name label in the property views.
*
* @param label
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/view/SiriusPropertiesView.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/view/SiriusPropertiesView.java
index 8e4a6f5..52e87c9 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/view/SiriusPropertiesView.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/view/SiriusPropertiesView.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -51,7 +51,7 @@
*/
public void setName(String name) {
propertiesView.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesView.bot());
bot.textWithLabel("Name").setText(name);
}
@@ -62,10 +62,9 @@
*/
public String getName() {
propertiesView.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesView.bot());
/*
- * maybe will have pb, in other case there has a .setfocus before the
- * getText
+ * maybe will have pb, in other case there has a .setfocus before the getText
*/
return bot.textWithLabel("Name").getText();
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractGroupingContentProviderTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractGroupingContentProviderTest.java
index b03f352..acc7de4 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractGroupingContentProviderTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractGroupingContentProviderTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.condition.TreeItemExpanded;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.IModelExplorerView;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
@@ -29,8 +30,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * This abstract test class contains all common items related to the swtbot
- * GroupingContentProviderTest test cases.
+ * This abstract test class contains all common items related to the swtbot GroupingContentProviderTest test cases.
*/
public class AbstractGroupingContentProviderTest extends AbstractSiriusSwtBotGefTestCase {
@@ -114,7 +114,8 @@
representation.setFocus();
representation.activateTool("Pane Based Selection");
representation.click(50, 100);
- SWTBotTree tree = bot.activeShell().bot().tree().select(0);
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Pane Based");
+ SWTBotTree tree = wizardBot.tree().select(0);
SWTBotTreeItem swtBotTreeItem = tree.getAllItems()[0];
SWTBotTreeItem[] items = swtBotTreeItem.getItems();
return items;
@@ -126,7 +127,8 @@
representation.setFocus();
representation.activateTool("Tree Selection");
representation.click(50, 100);
- SWTBotTree tree = bot.activeShell().bot().tree().select(0);
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Selection Wizard");
+ SWTBotTree tree = wizardBot.tree().select(0);
SWTBotTreeItem swtBotTreeItem = tree.getAllItems()[0];
SWTBotTreeItem[] items = swtBotTreeItem.getItems();
return items;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleOnCompleteExampleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleOnCompleteExampleTest.java
index b30f3c8..04eaf53 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleOnCompleteExampleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleOnCompleteExampleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES and other.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES and other.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -533,7 +533,7 @@
customized = true;
}
} else {
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE_TAB_NAME);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE_TAB_NAME, propertiesBot.bot());
bot.viewByTitle("Properties");
}
return customized;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleTest.java
index 3153195..9b4c71d 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractRefreshWithCustomizedStyleTest.java
@@ -53,8 +53,7 @@
import com.google.common.collect.Lists;
/**
- * An abstract class providing facilities for testing the style customization
- * features.
+ * An abstract class providing facilities for testing the style customization features.
*
* <p>
* Relevant issues :
@@ -101,8 +100,7 @@
}
/**
- * Selects and returns the edit part with the given name and of the given
- * type.
+ * Selects and returns the edit part with the given name and of the given type.
*
* @param name
* the edit part name
@@ -128,7 +126,7 @@
SWTBotView propertiesView = bot.viewByTitle("Properties");
propertiesView.setFocus();
SWTBot propertiesBot = propertiesView.bot();
- assertTrue("The appearance tab should be visible", SWTBotSiriusHelper.selectPropertyTabItem("Appearance"));
+ assertTrue("The appearance tab should be visible", SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesBot));
return propertiesBot;
}
@@ -136,17 +134,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given combobox with the given newValue from
- * the appearance section, the given predicate is checked and the cancel
- * custom style button is enabled</li>
- * <li>Undoing the combo-box modification should bring us back to initial
- * state</li>
- * <li>Re-doing the combo-box modification again should bring us back to
- * step 2</li>
+ * <li>After having modified the given combobox with the given newValue from the appearance section, the given
+ * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>Undoing the combo-box modification should bring us back to initial state</li>
+ * <li>Re-doing the combo-box modification again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -156,8 +150,7 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenRadioIsModifiedPredicate
- * the predicate that should be checked when the combobox
- * selection is modified
+ * the predicate that should be checked when the combobox selection is modified
* @param radioGroupName
* the name of the group containing the radio to select
* @param radioIndexInGroup
@@ -211,17 +204,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given combobox with the given newValue from
- * the appearance section, the given predicate is checked and the cancel
- * custom style button is enabled</li>
- * <li>Undoing the combo-box modification should bring us back to initial
- * state</li>
- * <li>Re-doing the combo-box modification again should bring us back to
- * step 2</li>
+ * <li>After having modified the given combobox with the given newValue from the appearance section, the given
+ * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>Undoing the combo-box modification should bring us back to initial state</li>
+ * <li>Re-doing the combo-box modification again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -231,8 +220,7 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenRadioIsModifiedPredicate
- * the predicate that should be checked when the combobox
- * selection is modified
+ * the predicate that should be checked when the combobox selection is modified
* @param checkboxGroupName
* the name of the group containing the checkbox to check
* @param checkBoxIndexInGroup
@@ -301,17 +289,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given combobox with the given newValue from
- * the appearance section, the given predicate is checked and the cancel
- * custom style button is enabled</li>
- * <li>Undoing the combo-box modification should bring us back to initial
- * state</li>
- * <li>Re-doing the combo-box modification again should bring us back to
- * step 2</li>
+ * <li>After having modified the given combobox with the given newValue from the appearance section, the given
+ * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>Undoing the combo-box modification should bring us back to initial state</li>
+ * <li>Re-doing the combo-box modification again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -321,14 +305,12 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenComboIsModifiedPredicate
- * the predicate that should be checked when the combobox
- * selection is modified
+ * the predicate that should be checked when the combobox selection is modified
* @param modifiedComboValue
* the value that should be selected in the combobox
* @param customizationRevertable
- * true for underline and strikeThrough and not for bold and
- * italic because for these two last the de-selection of buttons
- * doesn't remove the customization flag (See VP-3625)
+ * true for underline and strikeThrough and not for bold and italic because for these two last the
+ * de-selection of buttons doesn't remove the customization flag (See VP-3625)
*/
protected void doTestStyleCustomizationThroughComboBoxInAppearanceSection(SWTBotGefEditPart selectedEditPart, Predicate<SWTBotGefEditPart> initialStatePredicate,
Predicate<SWTBotGefEditPart> stateWhenComboIsModifiedPredicate, int comboBoxIdIngroup, String modifiedComboValue, boolean customizationRevertable) {
@@ -391,17 +373,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given color selection button with the given
- * newColor from the appearance section, the given predicate is checked and
- * the cancel custom style button is enabled</li>
- * <li>Undoing the color selection modification should bring us back to
- * initial state</li>
- * <li>Re-doing the color selection modification again should bring us back
- * to step 2</li>
+ * <li>After having modified the given color selection button with the given newColor from the appearance section,
+ * the given predicate is checked and the cancel custom style button is enabled</li>
+ * <li>Undoing the color selection modification should bring us back to initial state</li>
+ * <li>Re-doing the color selection modification again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -409,17 +387,15 @@
* @param buttonToToggleGroupName
* the name of the group containing the button to toggle
* @param buttonToToggleIndexInGroup
- * the index of the button to toggle inside the group(It must
- * corresponds to text, line or fill color for example)
+ * the index of the button to toggle inside the group(It must corresponds to text, line or fill color for
+ * example)
* @param defaultButtonInColorPalette
- * the index of the button that should be toggled by default
- * inside the color palette(each color in the palette corresponds
- * to a button)
+ * the index of the button that should be toggled by default inside the color palette(each color in the
+ * palette corresponds to a button)
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
*/
protected void doTestStyleCustomizationThroughColorSelectionFromAppearanceSection(SWTBotGefEditPart selectedEditPart, String buttonToToggleGroupName, int[] buttonToToggleIndexInGroup,
int[] defaultButtonInColorPalette, Predicate<SWTBotGefEditPart> initialStatePredicate, Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate) {
@@ -438,14 +414,14 @@
// Step 2: Enable button and check result
buttonFromAppearanceSectionToTest.click();
- assertTrue(BAD_CURRENT_COLOR_BUTTON, bot.button(defaultButtonInColorPalette[i]).isActive());
+ assertTrue(BAD_CURRENT_COLOR_BUTTON, propertiesBot.button(defaultButtonInColorPalette[i]).isActive());
// Click on the GRAY button
- bot.button(3).click();
+ propertiesBot.button(3).click();
assertTrue("The button " + buttonFromAppearanceSectionToTest.getToolTipText() + " has been applied, so the initial state should not be checked anymore",
stateWhenButtonIsCheckedPredicate.apply(selectedEditPart));
checkButtonAppearanceChecked(Lists.<SWTBotToggleButton> newArrayList(), resetStyleCustomizationButton, Arrays.asList(true), true);
buttonFromAppearanceSectionToTest.click();
- assertTrue(BAD_CURRENT_COLOR_BUTTON, bot.button(3).isActive());
+ assertTrue(BAD_CURRENT_COLOR_BUTTON, propertiesBot.button(3).isActive());
// Step 3: "Reset style properties to default values" and check
// result
@@ -456,9 +432,9 @@
// Step 4: re-enable button and check result
buttonFromAppearanceSectionToTest.click();
- assertTrue(BAD_CURRENT_COLOR_BUTTON, bot.button(defaultButtonInColorPalette[i]).isActive());
+ assertTrue(BAD_CURRENT_COLOR_BUTTON, propertiesBot.button(defaultButtonInColorPalette[i]).isActive());
// Click on the GRAY button
- bot.button(3).click();
+ propertiesBot.button(3).click();
assertTrue("The button " + buttonFromAppearanceSectionToTest.getToolTipText() + " has been applied, so the initial state should not be checked anymore",
stateWhenButtonIsCheckedPredicate.apply(selectedEditPart));
checkButtonAppearanceChecked(Lists.<SWTBotToggleButton> newArrayList(), resetStyleCustomizationButton, Arrays.asList(true), true);
@@ -502,13 +478,11 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given color selection button with the given
- * newColor from the appearance section, the given predicate is checked and
- * the cancel custom style button is enabled</li>
+ * <li>After having modified the given color selection button with the given newColor from the appearance section,
+ * the given predicate is checked and the cancel custom style button is enabled</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -516,11 +490,9 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
* @param newImagePath
- * the path of the workspace image to set (from the current
- * project root)
+ * the path of the workspace image to set (from the current project root)
*/
protected void doTestStyleCustomizationThroughBackgroundImageFromAppearanceSection(SWTBotGefEditPart selectedEditPart, Predicate<SWTBotGefEditPart> initialStatePredicate,
Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate, String newImagePath) {
@@ -571,15 +543,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having toggled the given button from the appearance section,
- * the given predicate is checked and the cancel custom style button is
- * enabled</li>
+ * <li>After having toggled the given button from the appearance section, the given predicate is checked and the
+ * cancel custom style button is enabled</li>
* <li>Re-toggling the button should bring us back to initial state</li>
* <li>Toggling the button again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -591,12 +561,10 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
* @param customizationRevertable
- * true for underline and strikeThrough and not for bold and
- * italic because for these two last the de-selection of buttons
- * doesn't remove the customization flag (See VP-3625)
+ * true for underline and strikeThrough and not for bold and italic because for these two last the
+ * de-selection of buttons doesn't remove the customization flag (See VP-3625)
*/
protected void doTestStyleCustomizationThroughToggleButtonFromAppearanceSection(SWTBotGefEditPart selectedEditPart, String buttonToToggleGroupName, int buttonToToggleIndexInGroup,
Predicate<SWTBotGefEditPart> initialStatePredicate, Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate, boolean customizationRevertable) {
@@ -673,19 +641,16 @@
}
/**
- * Ensures that each of the given {@link SWTBotToggleButton} has the
- * expected checked state. If one of the
+ * Ensures that each of the given {@link SWTBotToggleButton} has the expected checked state. If one of the
*
* @param buttons
* the {@link SWTBotToggleButton}s to test
* @param resetStyleCustomizationButton
* the cancel custom style button
* @param expectedButtonCheckState
- * the expected check state for each {@link SWTBotToggleButton}
- * given in parameter
+ * the expected check state for each {@link SWTBotToggleButton} given in parameter
* @param customStyleButtonShouldBeChecked
- * indicates if the 'cancelCustomStyle' button should be checked
- * or not
+ * indicates if the 'cancelCustomStyle' button should be checked or not
*/
protected void checkButtonAppearanceChecked(Collection<SWTBotToggleButton> buttons, SWTBotButton resetStyleCustomizationButton, Collection<Boolean> expectedButtonCheckState,
boolean customStyleButtonShouldBeChecked) {
@@ -708,12 +673,10 @@
}
/**
- * Checks that the given {@link SWTBotToggleButton} is checked or not,
- * according to the given boolean.
+ * Checks that the given {@link SWTBotToggleButton} is checked or not, according to the given boolean.
*
* @param buttonShouldBeChecked
- * indicates if the {@link SWTBotToggleButton} should be checked
- * or not
+ * indicates if the {@link SWTBotToggleButton} should be checked or not
* @param button
* the {@link SWTBotToggleButton} to test
*/
@@ -729,14 +692,13 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having toggled the given button from the tabbar, the given
- * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>After having toggled the given button from the tabbar, the given predicate is checked and the cancel custom
+ * style button is enabled</li>
* <li>Re-toggling the button should bring us back to initial state</li>
* <li>Toggling the button again should bring us back to step 2</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -746,8 +708,7 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
*/
protected void doTestStyleCustomizationThroughTabbar(SWTBotGefEditPart selectedEditPart, String tabbarButtonTooltip, Predicate<SWTBotGefEditPart> initialStatePredicate,
Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate) {
@@ -825,11 +786,10 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having toggled the given button from the tabbar, the given
- * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>After having toggled the given button from the tabbar, the given predicate is checked and the cancel custom
+ * style button is enabled</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -841,8 +801,7 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
*/
protected void doTestStyleCustomizationThroughColorSelectionFromTabbar(SWTBotGefEditPart selectedEditPart, String colorButtonName, Predicate<SWTBotGefEditPart> initialStatePredicate,
final Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate, String newColorName) {
@@ -902,11 +861,10 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having toggled the given button from the tabbar, the given
- * predicate is checked and the cancel custom style button is enabled</li>
+ * <li>After having toggled the given button from the tabbar, the given predicate is checked and the cancel custom
+ * style button is enabled</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -918,8 +876,7 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
*/
protected void doTestStyleCustomizationThroughRoutingStyleSelectionFromTabbar(SWTBotGefEditPart selectedEditPart, String edgeEditPartName, Predicate<SWTBotGefEditPart> initialStatePredicate,
final Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate, String newRoutingStyleName) {
@@ -967,13 +924,11 @@
* Ensures that when selecting the given edit part :
* <ol>
* <li>The initial state predicated is checked</li>
- * <li>After having modified the given color selection button with the given
- * newColor from the tabbar, the given predicate is checked and the cancel
- * custom style button is enabled</li>
+ * <li>After having modified the given color selection button with the given newColor from the tabbar, the given
+ * predicate is checked and the cancel custom style button is enabled</li>
* <li>Refreshing the representation does not change this state</li>
* <li>Reopening the representation does not change this state</li>
- * <li>Canceling the custom style reverts modifications (initial state
- * should be checked again)</li>
+ * <li>Canceling the custom style reverts modifications (initial state should be checked again)</li>
* </ol>
*
* @param selectedEditPart
@@ -981,11 +936,9 @@
* @param initialStatePredicate
* the initial state predicate
* @param stateWhenButtonIsCheckedPredicate
- * the predicate that should be checked when the button is
- * toggled
+ * the predicate that should be checked when the button is toggled
* @param newImagePath
- * the path of the workspace image to set (from the current
- * project root)
+ * the path of the workspace image to set (from the current project root)
*/
protected void doTestStyleCustomizationThroughBackgroundImageFromTabbar(SWTBotGefEditPart selectedEditPart, Predicate<SWTBotGefEditPart> initialStatePredicate,
Predicate<SWTBotGefEditPart> stateWhenButtonIsCheckedPredicate, String newImagePath) {
@@ -1031,19 +984,16 @@
}
/**
- * Ensures that each of the given {@link SWTBotToolbarToggleButton} has the
- * expected checked state. If one of the
+ * Ensures that each of the given {@link SWTBotToolbarToggleButton} has the expected checked state. If one of the
*
* @param buttons
* the {@link SWTBotToolbarToggleButton}s to test
* @param resetStyleCustomizationButton
* the cancel custom style button
* @param expectedButtonCheckState
- * the expected check state for each
- * {@link SWTBotToolbarToggleButton} given in parameter
+ * the expected check state for each {@link SWTBotToolbarToggleButton} given in parameter
* @param resetStylePropertiesToDefaultValuesButtonShouldBeChecked
- * indicates if the 'cancelCustomStyle' button should be checked
- * or not
+ * indicates if the 'cancelCustomStyle' button should be checked or not
*/
protected void checkButtonTabbarChecked(Collection<SWTBotToolbarToggleButton> buttons, SWTBotToolbarButton resetStyleCustomizationButton, Collection<Boolean> expectedButtonCheckState,
boolean resetStylePropertiesToDefaultValuesButtonShouldBeChecked) {
@@ -1068,12 +1018,10 @@
}
/**
- * Checks that the given {@link SWTBotToolbarToggleButton} is checked or
- * not, according to the given boolean.
+ * Checks that the given {@link SWTBotToolbarToggleButton} is checked or not, according to the given boolean.
*
* @param shouldBeChecked
- * indicates if the {@link SWTBotToolbarToggleButton} should be
- * checked or not
+ * indicates if the {@link SWTBotToolbarToggleButton} should be checked or not
* @param button
* the {@link SWTBotToolbarToggleButton} to test
*/
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BackgroundStyleUpdateTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BackgroundStyleUpdateTest.java
index 5dcc993..943a4f2 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BackgroundStyleUpdateTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BackgroundStyleUpdateTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2018 Obeo.
+ * Copyright (c) 2015, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -33,8 +33,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * Test that the background style is correctly changed after the semantic
- * change.
+ * Test that the background style is correctly changed after the semantic change.
*
* @author <a href="mailto:belqassim.djafer@obeo.fr">Belqassim Djafer</a>
*/
@@ -79,8 +78,7 @@
}
/**
- * Ensure that the style of FlatContainerStyle directly after the semantic
- * change.
+ * Ensure that the style of FlatContainerStyle directly after the semantic change.
*/
public void testStyleCustomizationOfFlatContainerStyle() {
// Ensure that the background style do not change on representation
@@ -106,7 +104,7 @@
private void changeBackgroundStyle(boolean liquid) {
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Semantic");
+ SWTBotSiriusHelper.selectPropertyTabItem("Semantic", propertiesBot.bot());
SWTBotTreeItem style = propertiesBot.bot().tree(0).getAllItems()[0].getNode("Liquid");
style.click();
// In photon, the feature widget is not a combo anymore.
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BracketEdgeTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BracketEdgeTests.java
index 355c840..2d4df02 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BracketEdgeTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BracketEdgeTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -54,11 +54,9 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * Test brackets edge. Test edge horizontally resize, test move node, test
- * rotate to TOP/BOTTOM/LEFT/RIGHT, test zoom, test scroll, test same things in
- * container, test change source decoration in Odesign, test bracketEdge on
- * bracketEdge, test bracketEdge on standardEdge, test standard edge on
- * bracketEdge, test change lineStyle.
+ * Test brackets edge. Test edge horizontally resize, test move node, test rotate to TOP/BOTTOM/LEFT/RIGHT, test zoom,
+ * test scroll, test same things in container, test change source decoration in Odesign, test bracketEdge on
+ * bracketEdge, test bracketEdge on standardEdge, test standard edge on bracketEdge, test change lineStyle.
*
* Test VP-3092
*
@@ -152,8 +150,7 @@
}
/**
- * Test resizing bracket edge with source move. Resizing edge between new
- * EClass 1 and new EClass 2.
+ * Test resizing bracket edge with source move. Resizing edge between new EClass 1 and new EClass 2.
*/
public void testResizeBracketWithMoveSource() {
SWTBotGefEditPart newEReference1BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_1, BracketEdgeEditPart.class);
@@ -228,8 +225,7 @@
}
/**
- * Test resizing bracket edge with target move. Resizing edge between new
- * EClass 1 and new EClass 2.
+ * Test resizing bracket edge with target move. Resizing edge between new EClass 1 and new EClass 2.
*/
public void testResizeBracketWithMoveTarget() {
SWTBotGefEditPart newEReference1BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_1, BracketEdgeEditPart.class);
@@ -304,8 +300,8 @@
}
/**
- * Test resizing bracket edge with source move in container. Resizing edge
- * between new EClass 111 and new EClass 112 in container new Package 11
+ * Test resizing bracket edge with source move in container. Resizing edge between new EClass 111 and new EClass 112
+ * in container new Package 11
*/
public void testResizeBracketWithMoveSourceInContainer() {
SWTBotGefEditPart newEReference111BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_111, BracketEdgeEditPart.class);
@@ -381,8 +377,8 @@
}
/**
- * Test resizing bracket edge with target move in container. Resizing edge
- * between new EClass 111 and new EClass 112 in container new Package 11
+ * Test resizing bracket edge with target move in container. Resizing edge between new EClass 111 and new EClass 112
+ * in container new Package 11
*/
public void testResizeBracketWithMoveTargetInContainer() {
SWTBotGefEditPart newEReference111BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_111, BracketEdgeEditPart.class);
@@ -457,8 +453,7 @@
}
/**
- * Test resizing bracket edge with handle move. To resizing edge between new
- * EClass 1 and new EClass 2.
+ * Test resizing bracket edge with handle move. To resizing edge between new EClass 1 and new EClass 2.
*/
public void testResizeBracketWithHandleMove() {
SWTBotGefEditPart newEReference1BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_1, BracketEdgeEditPart.class);
@@ -531,8 +526,7 @@
}
/**
- * Test resizing bracket edge with handle move. To resizing edge between new
- * EClass 111 and new EClass 112.
+ * Test resizing bracket edge with handle move. To resizing edge between new EClass 111 and new EClass 112.
*/
public void testResizeBracketWithHandleMoveInContainer() {
SWTBotGefEditPart newEReference111BracketEdgeEditPartBot = editor.getEditPart(NEW_EREFERENCE_111, BracketEdgeEditPart.class);
@@ -605,71 +599,64 @@
}
/**
- * Test that rotate to top, if y value is too low, passed in to top. Select
- * point 2 of bracket named newEReference1 and drag to right and to top.
+ * Test that rotate to top, if y value is too low, passed in to top. Select point 2 of bracket named newEReference1
+ * and drag to right and to top.
*/
public void testRotateBracketToTop() {
rotateBracketToTop(NEW_ECLASS_1, NEW_ECLASS_2, NEW_EREFERENCE_1);
}
/**
- * Test that rotate to bottom, if y value is too low, passed in to bottom.
- * Select point 4 of bracket named newEReference1 and drag to right and to
- * bottom.
+ * Test that rotate to bottom, if y value is too low, passed in to bottom. Select point 4 of bracket named
+ * newEReference1 and drag to right and to bottom.
*/
public void testRotateBracketToBottom() {
rotateBracketToBottom(NEW_ECLASS_1, NEW_ECLASS_2, NEW_EREFERENCE_1);
}
/**
- * Test that rotate to left with y value not big enough to passed in to
- * bottom. Select point 4 of bracket named newEReference1 and drag to left
- * and bottom.
+ * Test that rotate to left with y value not big enough to passed in to bottom. Select point 4 of bracket named
+ * newEReference1 and drag to left and bottom.
*/
public void testRotateBracketToLeft() {
rotateBracketToLeft(NEW_ECLASS_1, NEW_ECLASS_2, NEW_EREFERENCE_1);
}
/**
- * Test that rotate to right with y value not big enough to passed in to
- * bottom. Select point 4 of bracket named newEReference1 and drag to right
- * and bottom.
+ * Test that rotate to right with y value not big enough to passed in to bottom. Select point 4 of bracket named
+ * newEReference1 and drag to right and bottom.
*/
public void testRotateBracketToRight() {
rotateBracketToRight(NEW_ECLASS_1, NEW_ECLASS_2, NEW_EREFERENCE_1);
}
/**
- * Test that rotate to top in container, if y value is too low, passed in to
- * top. Select point 2 of bracket named newEReference1 and drag to right and
- * to top.
+ * Test that rotate to top in container, if y value is too low, passed in to top. Select point 2 of bracket named
+ * newEReference1 and drag to right and to top.
*/
public void testRotateBracketToTopInContainer() {
rotateBracketToTop(NEW_ECLASS_111, NEW_ECLASS_112, NEW_EREFERENCE_111);
}
/**
- * Test that rotate to bottom in container, if y value is too low, passed in
- * to bottom. Select point 4 of bracket named newEReference1 and drag to
- * right and to bottom.
+ * Test that rotate to bottom in container, if y value is too low, passed in to bottom. Select point 4 of bracket
+ * named newEReference1 and drag to right and to bottom.
*/
public void testRotateBracketToBottomInContainer() {
rotateBracketToBottom(NEW_ECLASS_111, NEW_ECLASS_112, NEW_EREFERENCE_111);
}
/**
- * Test that rotate to left in container with y value not big enough to
- * passed in to bottom. Select point 4 of bracket named newEReference1 and
- * drag to left and bottom.
+ * Test that rotate to left in container with y value not big enough to passed in to bottom. Select point 4 of
+ * bracket named newEReference1 and drag to left and bottom.
*/
public void testRotateBracketToLeftInContainer() {
rotateBracketToLeft(NEW_ECLASS_111, NEW_ECLASS_112, NEW_EREFERENCE_111);
}
/**
- * Test that rotate to right in container with y value not big enough to
- * passed in to bottom. Select point 4 of bracket named newEReference1 and
- * drag to right and bottom.
+ * Test that rotate to right in container with y value not big enough to passed in to bottom. Select point 4 of
+ * bracket named newEReference1 and drag to right and bottom.
*/
public void testRotateBracketToRightInContainer() {
rotateBracketToRight(NEW_ECLASS_111, NEW_ECLASS_112, NEW_EREFERENCE_111);
@@ -851,8 +838,7 @@
}
/**
- * Change decorators style (Start/Finish arrow) in VSM and check that
- * modifications are changed in representation
+ * Change decorators style (Start/Finish arrow) in VSM and check that modifications are changed in representation
*/
public void testChangeDecoratorsInOdesign() {
changeDecorators(EdgeArrows.INPUT_FILL_CLOSED_ARROW_LITERAL);
@@ -863,7 +849,7 @@
// Check that Source and Target Arrow are set correctly
initializeEdgeBracketPositionPoint(NEW_EREFERENCE_1).select();
propertiesBot = bot.viewByTitle(PROPERTIES);
- SWTBotSiriusHelper.selectPropertyTabItem("Style");
+ SWTBotSiriusHelper.selectPropertyTabItem("Style", propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode("Misc").select().getNode("Source Arrow").doubleClick();
assertEquals("The type of Source Arrow must be Input Fill Closed Arrow", "Input Fill Closed Arrow", propertiesBot.bot().ccomboBox().getText());
@@ -882,7 +868,7 @@
// accesses to property view
bot.viewByTitle(PROPERTIES).setFocus();
// accesses to tab Decorators
- SWTBotSiriusHelper.selectPropertyTabItem(DECORATORS);
+ SWTBotSiriusHelper.selectPropertyTabItem(DECORATORS, propertiesBot.bot());
// Change Source arrow decorators for InputFilledClosedArrow
SWTBotTable listDecoratorsSourceArrow = bot.viewByTitle(PROPERTIES).bot().tableWithLabel("Source Arrow*:");
assertEquals("The decorators name must be " + edgeArrow.getLiteral(), edgeArrow.getLiteral(), listDecoratorsSourceArrow.getTableItem(6).getText());
@@ -894,8 +880,7 @@
}
/**
- * The property routing style must not appears in VSM and must be disabled
- * in representation properties view.
+ * The property routing style must not appears in VSM and must be disabled in representation properties view.
*/
public void testRoutingStyleNotAppears() {
SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(MODELER_RESOURCE_NAME);
@@ -906,7 +891,7 @@
// accesses to property view
bot.viewByTitle(PROPERTIES).setFocus();
// accesses to tab Decorators
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesBot.bot());
final long previousTimeout = SWTBotPreferences.TIMEOUT;
SWTBotPreferences.TIMEOUT = 1000;
try {
@@ -923,7 +908,7 @@
propertiesBot = bot.viewByTitle(PROPERTIES);
SWTBotUtils.waitAllUiEvents();
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Style");
+ SWTBotSiriusHelper.selectPropertyTabItem("Style", propertiesBot.bot());
tree = propertiesBot.bot().tree();
// Test that routing style is not visible in properties view
try {
@@ -939,8 +924,7 @@
}
/**
- * Test that source and target are inner Decoration when segment is too
- * small.
+ * Test that source and target are inner Decoration when segment is too small.
*/
public void testSourceTargetInnerDecorationWhenSegmentTooSmall() {
// Retrieve Position of 6 points bracketEdge between EClass 1 and EClass
@@ -989,8 +973,7 @@
}
/**
- * Change line style in VSM and check that modifications are changed in
- * representation and in properties view
+ * Change line style in VSM and check that modifications are changed in representation and in properties view
*/
public void testChangeLineStyleInOdesign() {
SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(MODELER_RESOURCE_NAME);
@@ -1001,7 +984,7 @@
// accesses to property view
bot.viewByTitle(PROPERTIES).setFocus();
// accesses to tab Decorators
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesBot.bot());
// Change Source arrow decorators
SWTBotCCombo lineStyle = bot.viewByTitle(PROPERTIES).bot().ccomboBox();
lineStyle.setSelection(2);
@@ -1013,7 +996,7 @@
// Check that line style are set correctly
initializeEdgeBracketPositionPoint(NEW_EREFERENCE_1).select();
propertiesBot = bot.viewByTitle(PROPERTIES);
- SWTBotSiriusHelper.selectPropertyTabItem("Style");
+ SWTBotSiriusHelper.selectPropertyTabItem("Style", propertiesBot.bot());
tree = propertiesBot.bot().tree();
tree.expandNode("General").select().getNode("Line Style").doubleClick();
assertEquals("The line style should be dot", "dot", propertiesBot.bot().ccomboBox().getText());
@@ -1021,8 +1004,7 @@
}
/**
- * Test that {@link BracketEdgeStyleDescription} is allowed in the odesign
- * editor.
+ * Test that {@link BracketEdgeStyleDescription} is allowed in the odesign editor.
*/
public void testBracketEdgeStyleDescriptionCreation() {
SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(MODELER_RESOURCE_NAME);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CascadingSiriusURITest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CascadingSiriusURITest.java
index a1bc940..58dcae6 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CascadingSiriusURITest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CascadingSiriusURITest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -33,6 +34,8 @@
private static final String VSM_FILE_B = "b.odesign";
+ private static final String PROPERTIES = "Properties";
+
private static final String VSM_FILE_C = "c.odesign";
private static final String C_MODELER_PLATFORM_PATH = "platform:/resource/" + AbstractSiriusSwtBotGefTestCase.TEMP_PROJECT_NAME + "/c.odesign";
@@ -78,9 +81,10 @@
bot.button("OK").click();
// Update group name in c.odesign
- bot.viewByTitle("Properties").setFocus();
- bot.viewByTitle("Properties").bot().text("C").setText("CModified");
- SWTBotSiriusHelper.selectPropertyTabItem("Documentation");
+ bot.viewByTitle(PROPERTIES).setFocus();
+ bot.viewByTitle(PROPERTIES).bot().text("C").setText("CModified");
+ SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
+ SWTBotSiriusHelper.selectPropertyTabItem("Documentation", propertiesBot.bot());
// Save and Close c.odesign
bot.editorByTitle(VSM_FILE_C).setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CenteredEdgesTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CenteredEdgesTest.java
index 2552463..8ebd303 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CenteredEdgesTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CenteredEdgesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2019 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2008, 2019 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -49,7 +49,6 @@
import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerEditPart;
import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeEditPart;
import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper;
-import org.eclipse.sirius.ext.base.Option;
import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
import org.eclipse.sirius.tests.support.api.TestsUtil;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
@@ -132,8 +131,7 @@
}
/**
- * Test that the edge is correctly centered on the source border node when
- * using an edge creation tool.
+ * Test that the edge is correctly centered on the source border node when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredSrcBorderNode() {
openDiagram(REPRESENTATION_NAME);
@@ -146,8 +144,7 @@
}
/**
- * Test that the edge is correctly centered on the target border node when
- * using an edge creation tool.
+ * Test that the edge is correctly centered on the target border node when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredTgtBorderNode() {
openDiagram(REPRESENTATION_NAME);
@@ -160,8 +157,7 @@
}
/**
- * Test that the edge is correctly centered on the source node when using an
- * edge creation tool.
+ * Test that the edge is correctly centered on the source node when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredSrcNode() {
openDiagram(REPRESENTATION_NAME);
@@ -173,8 +169,7 @@
}
/**
- * Test that the edge is correctly centered on the target node when using an
- * edge creation tool.
+ * Test that the edge is correctly centered on the target node when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredTgtNode() {
openDiagram(REPRESENTATION_NAME);
@@ -186,8 +181,7 @@
}
/**
- * Test that the edge is correctly centered on the source container when
- * using an edge creation tool.
+ * Test that the edge is correctly centered on the source container when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredSrcContainer() {
openDiagram(REPRESENTATION_NAME);
@@ -200,8 +194,7 @@
}
/**
- * Test that the edge is correctly centered on the target container when
- * using an edge creation tool.
+ * Test that the edge is correctly centered on the target container when using an edge creation tool.
*/
public void testEdgeCreationToolOnCenteredTgtContainer() {
openDiagram(REPRESENTATION_NAME);
@@ -213,8 +206,7 @@
}
/**
- * Test that the edge is correctly centered on the target node when using
- * the reconnect tool.
+ * Test that the edge is correctly centered on the target node when using the reconnect tool.
*/
public void testEdgeReconnectionOnCenteredNode() {
openDiagram(REPRESENTATION_NAME_RECONNECT);
@@ -226,8 +218,7 @@
}
/**
- * Test that the edge is correctly centered on the target border node when
- * using the reconnect tool.
+ * Test that the edge is correctly centered on the target border node when using the reconnect tool.
*/
public void testEdgeReconnectionOnCenteredBorderNode() {
openDiagram(REPRESENTATION_NAME_RECONNECT);
@@ -238,8 +229,7 @@
}
/**
- * Test that the edge is correctly centered on the target container when
- * using the reconnect tool.
+ * Test that the edge is correctly centered on the target container when using the reconnect tool.
*/
public void testEdgeReconnectionOnCenteredContainer() {
openDiagram(REPRESENTATION_NAME_RECONNECT);
@@ -250,8 +240,7 @@
}
/**
- * Test that the Rectilinear edge is correctly centered on the target border
- * node when using the reconnect tool.
+ * Test that the Rectilinear edge is correctly centered on the target border node when using the reconnect tool.
*/
public void testRectilinearEdgeReconnectionOnCenteredBorderNode() {
openDiagram(REPRESENTATION_NAME_RECONNECT);
@@ -264,8 +253,7 @@
}
/**
- * Test that the Rectilinear edge is correctly centered on the target
- * container when using the reconnect tool.
+ * Test that the Rectilinear edge is correctly centered on the target container when using the reconnect tool.
*/
public void testRectilinearEdgeReconnectionOnCenteredContainer() {
openDiagram(REPRESENTATION_NAME_RECONNECT);
@@ -278,8 +266,7 @@
}
/**
- * Test that when changing the edge routing style to rectilinear, the edge
- * is still centered toward its source.
+ * Test that when changing the edge routing style to rectilinear, the edge is still centered toward its source.
*/
public void testSrcChangingRoutingStyle() {
openDiagram(REPRESENTATION_NAME_ROUTING);
@@ -289,8 +276,7 @@
}
/**
- * Test that when changing the edge routing style to rectilinear, the edge
- * is still centered toward its target.
+ * Test that when changing the edge routing style to rectilinear, the edge is still centered toward its target.
*/
public void testTgtChangingRoutingStyle() {
openDiagram(REPRESENTATION_NAME_ROUTING);
@@ -300,13 +286,10 @@
}
/**
- * Test that when changing the edge routing style to rectilinear (from the
- * menu == only one notification filter by
- * RefreshEdgeLayoutNotificationFilter), the edge is still centered toward
- * its target. Check that the GMF point is the same as the draw2d point. It
- * should be the case because in current scenario we can use the figure as
- * reference. This problem of GMF point != draw2d point should exist only
- * when the GMF data is used.
+ * Test that when changing the edge routing style to rectilinear (from the menu == only one notification filter by
+ * RefreshEdgeLayoutNotificationFilter), the edge is still centered toward its target. Check that the GMF point is
+ * the same as the draw2d point. It should be the case because in current scenario we can use the figure as
+ * reference. This problem of GMF point != draw2d point should exist only when the GMF data is used.
*/
public void testTgtChangingRoutingStyleWithGMFAutoSize() {
openDiagram(REPRESENTATION_NAME_CHANGING_ROUTING);
@@ -316,13 +299,10 @@
}
/**
- * Test that when changing the edge routing style to rectilinear (from style
- * tab of properties view == 2 notifications used by
- * RefreshEdgeLayoutNotificationFilter), the edge is still centered toward
- * its target. Check that the GMF point is the same as the draw2d point. It
- * should be the case because in current scenario we can use the figure as
- * reference. This problem of GMF point != draw2d point should exist only
- * when the GMF data is used.
+ * Test that when changing the edge routing style to rectilinear (from style tab of properties view == 2
+ * notifications used by RefreshEdgeLayoutNotificationFilter), the edge is still centered toward its target. Check
+ * that the GMF point is the same as the draw2d point. It should be the case because in current scenario we can use
+ * the figure as reference. This problem of GMF point != draw2d point should exist only when the GMF data is used.
*
*/
public void testTgtChangingRoutingStyleFromStyleTabWithGMFAutoSize() {
@@ -333,8 +313,7 @@
}
/**
- * Test that the end user cannot move the edge source that should be
- * centered. Border node case.
+ * Test that the end user cannot move the edge source that should be centered. Border node case.
*/
public void testUserMoveCenteredSrcOnBorderNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -345,8 +324,7 @@
}
/**
- * Test that the end user cannot move the edge source that should be
- * centered. Container node case.
+ * Test that the end user cannot move the edge source that should be centered. Container node case.
*/
public void testUserMoveCenteredSrcOnContainer() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -357,8 +335,7 @@
}
/**
- * Test that the end user cannot move the edge source that should be
- * centered. Node case.
+ * Test that the end user cannot move the edge source that should be centered. Node case.
*/
public void testUserMoveCenteredSrcOnNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -369,8 +346,7 @@
}
/**
- * Test that the end user cannot move the edge target that should be
- * centered. Border node case.
+ * Test that the end user cannot move the edge target that should be centered. Border node case.
*/
public void testUserMoveCenteredTgtOnBorderNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -381,8 +357,7 @@
}
/**
- * Test that the end user cannot move the edge target that should be
- * centered. Container case.
+ * Test that the end user cannot move the edge target that should be centered. Container case.
*/
public void testUserMoveCenteredTgtOnContainer() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -393,8 +368,7 @@
}
/**
- * Test that the end user cannot move the edge target that should be
- * centered. Node case.
+ * Test that the end user cannot move the edge target that should be centered. Node case.
*/
public void testUserMoveCenteredTgtOnNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -405,9 +379,8 @@
}
/**
- * Test that the end user can move the edge source which is not centered.
- * Border node case. Deactivated since draw2D try to keep the edge straight,
- * so the move is not perceptible.
+ * Test that the end user can move the edge source which is not centered. Border node case. Deactivated since draw2D
+ * try to keep the edge straight, so the move is not perceptible.
*/
public void _testUserMoveFreeSrcOnBorderNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -418,8 +391,7 @@
}
/**
- * Test that the end user can move the edge source which is not centered.
- * Container case.
+ * Test that the end user can move the edge source which is not centered. Container case.
*/
public void testUserMoveFreeSrcOnContainer() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -438,8 +410,7 @@
}
/**
- * Test that the end user can move the edge source which is not centered.
- * Node case.
+ * Test that the end user can move the edge source which is not centered. Node case.
*/
public void testUserMoveFreeSrcOnNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -455,8 +426,7 @@
}
/**
- * Test that the end user can move the edge target which is not centered.
- * Border node case.
+ * Test that the end user can move the edge target which is not centered. Border node case.
*/
public void testUserMoveFreeTgtOnBorderNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -469,8 +439,7 @@
}
/**
- * Test that the end user can move the edge target which is not centered.
- * Container case.
+ * Test that the end user can move the edge target which is not centered. Container case.
*/
public void testUserMoveFreeTgtOnContainer() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -489,8 +458,7 @@
}
/**
- * Test that the end user can move the edge target which is not centered.
- * Node case.
+ * Test that the end user can move the edge target which is not centered. Node case.
*/
public void testUserMoveFreeTgtOnNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -506,8 +474,8 @@
}
/**
- * Test that the end user cannot move a rectilinear edge end with two
- * bendpoints and only one centered. See #448739 Comment1. Container case.
+ * Test that the end user cannot move a rectilinear edge end with two bendpoints and only one centered. See #448739
+ * Comment1. Container case.
*/
public void testUserCannotMoveRectilinearFreeTgtOnContainer() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -523,8 +491,8 @@
}
/**
- * Test that the end user cannot move a rectilinear edge end with two
- * bendpoints and only one centered. See #448739 Comment1. Node case.
+ * Test that the end user cannot move a rectilinear edge end with two bendpoints and only one centered. See #448739
+ * Comment1. Node case.
*/
public void testUserCannotMoveRectilinearFreeTgtOnNode() {
openDiagram(REPRESENTATION_NAME_MOVING);
@@ -540,10 +508,8 @@
}
/**
- * Test that when resizing the edge source with a source and a target
- * 'auto-size', the edge is still centered. See
- * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c5">Bug
- * 448739#c5</a>.
+ * Test that when resizing the edge source with a source and a target 'auto-size', the edge is still centered. See
+ * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c5">Bug 448739#c5</a>.
*/
public void testResizingAutoSizeContainer() {
openDiagram(REPRESENTATION_NAME_RESIZE);
@@ -562,9 +528,8 @@
}
/**
- * Test that when resizing a border node, the bendpoints of the not centered
- * edge, with a null anchor, are not moved. See
- * <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=466384">Bug 466384</a>.
+ * Test that when resizing a border node, the bendpoints of the not centered edge, with a null anchor, are not
+ * moved. See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=466384">Bug 466384</a>.
*/
public void testResizingNullAnchorSourceBorderNode() {
openDiagram(REPRESENTATION_NAME_RESIZE_BORDER_NODE);
@@ -586,30 +551,24 @@
}
/**
- * Test that when resizing a border node, the bendpoints of the centered
- * edge are fix and the edge is still centered. See
- * <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c18">Bug
- * 448739#c18</a>.
+ * Test that when resizing a border node, the bendpoints of the centered edge are fix and the edge is still
+ * centered. See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c18">Bug 448739#c18</a>.
*/
public void testResizingCenteredTargetBorderNodeWithZoom200() {
resizeCenteredTargetBorderNodeWithZoom(ZoomLevel.ZOOM_200);
}
/**
- * Test that when resizing a border node, the bendpoints of the centered
- * edge are fix and the edge is still centered. See
- * <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c25">Bug
- * 448739#c25</a>.
+ * Test that when resizing a border node, the bendpoints of the centered edge are fix and the edge is still
+ * centered. See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c25">Bug 448739#c25</a>.
*/
public void testResizingCenteredTargetBorderNodeWithZoom125() {
resizeCenteredTargetBorderNodeWithZoom(ZoomLevel.ZOOM_125);
}
/**
- * Test that when resizing a border node, the bendpoints of the centered
- * edge are fix and the edge is still centered. See
- * <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c18">Bug
- * 448739#c18</a>.
+ * Test that when resizing a border node, the bendpoints of the centered edge are fix and the edge is still
+ * centered. See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c18">Bug 448739#c18</a>.
*
* @param zoomLevel
* The zoom to apply on the editor
@@ -643,10 +602,8 @@
}
/**
- * Test that when resizing a border node over another border node, the
- * bendpoints of the centered edge are fix and the edge is still centered.
- * See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=466422">Bug
- * 466422</a>.
+ * Test that when resizing a border node over another border node, the bendpoints of the centered edge are fix and
+ * the edge is still centered. See <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=466422">Bug 466422</a>.
*/
public void testResizingCenteredTargetBorderNodeOverAnotherNode() {
openDiagram(REPRESENTATION_NAME_RESIZE_BORDER_NODE);
@@ -672,9 +629,8 @@
}
/**
- * Test that when resizing a border node over another border node, the
- * overlapped border node is not moved. See
- * <a https://bugs.eclipse.org/bugs/show_bug.cgi?id=466456">Bug 466456</a>.
+ * Test that when resizing a border node over another border node, the overlapped border node is not moved. See <a
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=466456">Bug 466456</a>.
*/
public void testResizingTargetBorderNodeOverAnotherNode() {
openDiagram(REPRESENTATION_NAME_RESIZE_BORDER_NODE);
@@ -696,12 +652,9 @@
}
/**
- * Test that when resizing a shape over edge bendpoints, the edge is still
- * centered. See
- * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c8">Bug
- * 448739#c8</a> and
- * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c10">Bug
- * 448739#c10</a>.
+ * Test that when resizing a shape over edge bendpoints, the edge is still centered. See
+ * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c8">Bug 448739#c8</a> and
+ * <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=448739#c10">Bug 448739#c10</a>.
*/
public void testResizingContainerWithInViewBendpoints() {
openDiagram(REPRESENTATION_NAME_RESIZE_2);
@@ -756,8 +709,8 @@
}
/**
- * Test that rectilinear edges with two or tree bend-points are centered for
- * both ends when changing the style from NONE to BOTH.
+ * Test that rectilinear edges with two or tree bend-points are centered for both ends when changing the style from
+ * NONE to BOTH.
*/
public void testRectilinearSpecificCases() {
openDiagram(REPRESENTATION_NAME_RECTILINEAR_CASES);
@@ -831,14 +784,11 @@
* <LI>Source node of edge A is moved</LI>
* <LI>Target node of edge A is moved</LI>
* <LI>Bendpoints of edge A are recomputed</LI>
- * <LI>Routing style of edge A is changed (both in Sirius style and GMF
- * style)</LI>
- * <LI>Routing style of edge B is changed (both in Sirius style and GMF
- * style)</LI>
+ * <LI>Routing style of edge A is changed (both in Sirius style and GMF style)</LI>
+ * <LI>Routing style of edge B is changed (both in Sirius style and GMF style)</LI>
* </UL>
- * . This kind of layout can be done when someone make specific layout
- * action. The goal is to check that in this condition, the edge A is
- * correctly layouted.
+ * . This kind of layout can be done when someone make specific layout action. The goal is to check that in this
+ * condition, the edge A is correctly layouted.
*/
public void testSpecificLayout() {
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "borderNodesDiagram", "new borderNodesDiagram", DDiagram.class);
@@ -864,12 +814,10 @@
* <UL>
* <LI>Auto-sized target node of an edge is moved</LI>
* <LI>Bendpoints of edge are recomputed</LI>
- * <LI>Routing style of edge is changed (both in Sirius style and GMF style)
- * </LI>
+ * <LI>Routing style of edge is changed (both in Sirius style and GMF style)</LI>
* </UL>
- * . This kind of layout can be done when someone make specific layout
- * action. The goal is to check that in this condition, the edge is
- * correctly layouted.
+ * . This kind of layout can be done when someone make specific layout action. The goal is to check that in this
+ * condition, the edge is correctly layouted.
*/
public void testSpecificVerticalLayout() {
openDiagram("specificVerticalLayout");
@@ -970,7 +918,7 @@
PointList pointList = connection.getPoints();
Point lineOrigin = pointList.getPoint(pointList.size() - 2);
Point realTargetConnection = pointList.getPoint(pointList.size() - 1);
-
+
// Get figure bounds
PrecisionRectangle figureBounds = null;
if (targetSwtBotGefEditPart.part() instanceof DNodeContainerEditPart) {
@@ -1025,7 +973,7 @@
} else {
figureBounds = getAbsoluteBounds((IGraphicalEditPart) sourceEditPart);
}
-
+
PrecisionPoint expectedLineTerminus = getProportionalPoint(figureBounds, expectedAnchor);
Optional<Point> option = GraphicalHelper.getIntersection(lineOrigin, expectedLineTerminus, (IGraphicalEditPart) sourceEditPart, false);
@@ -1054,8 +1002,7 @@
}
/**
- * Assert that the actual point is equal to the expected one with +/- 1
- * tolerance.
+ * Assert that the actual point is equal to the expected one with +/- 1 tolerance.
*
* @param msg
* @param expected
@@ -1140,8 +1087,7 @@
* Constructor.
*
* @param before
- * the bounds before the resize. We will wait until the new
- * given figure bounds are different.
+ * the bounds before the resize. We will wait until the new given figure bounds are different.
* @param figure
* the figure.
*/
@@ -1161,8 +1107,7 @@
/*
* (non-Javadoc)
- * @see
- * org.eclipse.swtbot.swt.finder.waits.ICondition#getFailureMessage()
+ * @see org.eclipse.swtbot.swt.finder.waits.ICondition#getFailureMessage()
*/
@Override
public String getFailureMessage() {
@@ -1202,8 +1147,7 @@
/*
* (non-Javadoc)
- * @see
- * org.eclipse.swtbot.swt.finder.waits.ICondition#getFailureMessage()
+ * @see org.eclipse.swtbot.swt.finder.waits.ICondition#getFailureMessage()
*/
@Override
public String getFailureMessage() {
@@ -1237,9 +1181,8 @@
* @param edge1PointListBefore
* the edge point list before resizing.
* @param delta
- * In some conditions, zoom for example, the points list can be
- * slightly different. This parameter allows to use a delta when
- * comparing point.
+ * In some conditions, zoom for example, the points list can be slightly different. This parameter allows
+ * to use a delta when comparing point.
*/
private void checkPointsListAfterResizing(SWTBotGefConnectionEditPart edgeEditPart, PointList edgePointListBefore, boolean ignoreLast) {
PointList afterPointList = getEdgePointList(edgeEditPart);
@@ -1262,7 +1205,7 @@
SWTBotUtils.waitAllUiEvents();
propertiesBot.setFocus();
// accesses to tab Style
- SWTBotSiriusHelper.selectPropertyTabItem(STYLE);
+ SWTBotSiriusHelper.selectPropertyTabItem(STYLE, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
// select routing syle <routingStyle> in combo
tree.expandNode("Misc").select().getNode("Routing Style").doubleClick();
@@ -1274,7 +1217,7 @@
comboBox.pressShortcut(Keystrokes.CR);
}
// applied change with change focus
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesBot.bot());
checkRoutingStyleInAppearance(routingStyle);
checkRoutingStyle(botEdgeEditPart, routingStyle);
@@ -1305,7 +1248,7 @@
}
assertEquals("The GMF routing style is not the right", routingStyle.getLiteral(), gmfRoutingStyleName);
}
-
+
private PrecisionPoint getExpectedAnchor(SWTBotGefEditPart botGefEditPart, PrecisionPoint relativeToBounds) {
IFigure figure = ((DNodeContainerEditPart) botGefEditPart.part()).getFigure();
Rectangle figureBounds = null;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CreateRepresentationFromSessionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CreateRepresentationFromSessionTest.java
index 42d1707..db71f8a 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CreateRepresentationFromSessionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CreateRepresentationFromSessionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -129,13 +130,12 @@
}
/**
- * Test the diagram creation on session wizard with no semantic element in
- * the model.
+ * Test the diagram creation on session wizard with no semantic element in the model.
*
*/
public void testDiagramCreationWithoutSemanticElement() {
- secondWizard("WithoutSemanticElement");
- SWTBotTreeItem[] allItems = bot.tree().getAllItems();
+ SWTBot wizardBot = secondWizard("WithoutSemanticElement");
+ SWTBotTreeItem[] allItems = wizardBot.tree().getAllItems();
assertEquals("The session must have 0 semantic resources.", 0, allItems.length);
for (int i = 0; i < allItems.length; i++) {
SWTBotTreeItem swtBotTreeItem = allItems[i];
@@ -144,7 +144,7 @@
assertFalse(swtBotTreeItem2.isActive());
}
}
- bot.button(CANCEL).click();
+ wizardBot.button(CANCEL).click();
Session session = localSession.getOpenedSession();
assertNotNull(THERE_IS_NO_SESSION, session);
@@ -192,7 +192,7 @@
boolean found = true;
try {
- bot.tree().expandNode("Documentation");
+ shell.bot().tree().expandNode("Documentation");
} catch (WidgetNotFoundException e) {
found = false;
}
@@ -232,17 +232,17 @@
* @return the opened representation
*/
private SWTBotEditor createRepresentation(String representation, String representationDescLabel, String semanticElement) {
- secondWizard(representation);
+ SWTBot wizardBot = secondWizard(representation);
- bot.tree().expandNode("platform:/resource/DesignerTestProject/My.ecore").expandNode(semanticElement).select();
- checkButtonAfterSelectionSecondWizard();
- bot.button(FINISH).click();
+ wizardBot.tree().expandNode("platform:/resource/DesignerTestProject/My.ecore").expandNode(semanticElement).select();
+ checkButtonAfterSelectionSecondWizard(wizardBot);
+ wizardBot.button(FINISH).click();
// choose the representation name
bot.waitUntil(Conditions.shellIsActive("New " + representationDescLabel));
SWTBotShell shell = bot.shell("New " + representationDescLabel);
shell.activate();
- bot.button(OK).click();
+ shell.bot().button(OK).click();
SWTBotUtils.waitAllUiEvents();
SWTBotUtils.waitProgressMonitorClose("Representation creation");
@@ -256,9 +256,9 @@
* name
*/
private void cancelSecondWizard(String representation) {
- secondWizard(representation);
+ SWTBot wizardBot = secondWizard(representation);
- bot.button(CANCEL).click();
+ wizardBot.button(CANCEL).click();
SWTBotUtils.waitAllUiEvents();
}
@@ -266,8 +266,9 @@
* Open the second wizard.
*
* @param representation
+ * @return
*/
- private void secondWizard(String representation) {
+ private SWTBot secondWizard(String representation) {
// create representation
createOnContextMenu();
@@ -275,17 +276,20 @@
bot.waitUntil(Conditions.shellIsActive("Create Representation Wizard"));
SWTBotShell shell = bot.shell("Create Representation Wizard");
shell.activate();
- checkButtonBeforeSelectionFirstWizard();
+ SWTBot wizardBot = shell.bot();
+ checkButtonBeforeSelectionFirstWizard(wizardBot);
- bot.tree().expandNode(VIEWPOINT_NAME).expandNode(representation).select();
- checkButtonAfterSelectionFirstWizard();
- bot.button(NEXT).click();
+ wizardBot.tree().expandNode(VIEWPOINT_NAME).expandNode(representation).select();
+ checkButtonAfterSelectionFirstWizard(wizardBot);
+ wizardBot.button(NEXT).click();
// select semantic element of the new representation
bot.waitUntil(Conditions.shellIsActive("Create Representation"));
shell = bot.shell("Create Representation");
shell.activate();
- checkButtonBeforeSelectionSecondWizard();
+ checkButtonBeforeSelectionSecondWizard(shell.bot());
+
+ return shell.bot();
}
/**
@@ -298,33 +302,33 @@
bot.waitUntil(Conditions.shellIsActive("Create Representation Wizard"));
SWTBotShell shell = bot.shell("Create Representation Wizard");
shell.activate();
- bot.button(CANCEL);
+ shell.bot().button(CANCEL);
}
- private void checkButtonAfterSelectionSecondWizard() {
- assertFalse(bot.button(NEXT).isEnabled());
- assertTrue(bot.button(BACK).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonAfterSelectionSecondWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(NEXT).isEnabled());
+ assertTrue(swtBot.button(BACK).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
- private void checkButtonBeforeSelectionSecondWizard() {
- assertFalse(bot.button(FINISH).isEnabled());
- assertTrue(bot.button(BACK).isEnabled());
- assertFalse(bot.button(NEXT).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonBeforeSelectionSecondWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(FINISH).isEnabled());
+ assertTrue(swtBot.button(BACK).isEnabled());
+ assertFalse(swtBot.button(NEXT).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
- private void checkButtonAfterSelectionFirstWizard() {
- assertFalse(bot.button(FINISH).isEnabled());
- assertFalse(bot.button(BACK).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonAfterSelectionFirstWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(FINISH).isEnabled());
+ assertFalse(swtBot.button(BACK).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
- private void checkButtonBeforeSelectionFirstWizard() {
- assertFalse(bot.button(FINISH).isEnabled());
- assertFalse(bot.button(BACK).isEnabled());
- assertFalse(bot.button(NEXT).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonBeforeSelectionFirstWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(FINISH).isEnabled());
+ assertFalse(swtBot.button(BACK).isEnabled());
+ assertFalse(swtBot.button(NEXT).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
/**
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramDocumentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramDocumentationTest.java
index 1b16887..d6b7d87 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramDocumentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramDocumentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -87,10 +87,9 @@
// Eclipse 4.x setFocus (an element is on (0,0))
editor.click(100, 100);
SWTBotUtils.waitAllUiEvents();
- SWTBotSiriusHelper.selectPropertyTabItem("Documentation");
-
- SWTBotUtils.waitAllUiEvents();
SWTBotView propertiesView = bot.viewByTitle("Properties");
+ SWTBotSiriusHelper.selectPropertyTabItem("Documentation", propertiesView.bot());
+
SWTBotUtils.waitAllUiEvents();
propertiesView.setFocus();
SWTBot propertiesBot = propertiesView.bot();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramPrintTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramPrintTest.java
index ec194cd..1abe0b0 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramPrintTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DiagramPrintTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2014, 2019 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -21,8 +21,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
/**
- * A test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=447242, i.e. test
- * that the GMF diagram print dialog is displayed.
+ * A test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=447242, i.e. test that the GMF diagram print dialog is
+ * displayed.
*
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
@@ -65,7 +65,7 @@
editor.setFocus();
bot.menu("File").menu("Print...").click();
bot.waitUntil(Conditions.shellIsActive(expectedPrintDialogTitle));
- SWTBotShell printShell = bot.activeShell();
+ SWTBotShell printShell = bot.shell(expectedPrintDialogTitle);
assertEquals(expectedPrintDialogTitle, printShell.getText());
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DoubleClickToolNavigationOperationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DoubleClickToolNavigationOperationTest.java
index 5dd237d..52f0413 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DoubleClickToolNavigationOperationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DoubleClickToolNavigationOperationTest.java
@@ -119,6 +119,7 @@
return "Double click tool has not been taken in consideration. No change has been applied after double click.";
}
}
+
private static final String REPRESENTATION_INSTANCE_NAME_R1_Root = "TC1054 representation 1 root";
private static final String REPRESENTATION_INSTANCE_NAME_R1_SP2 = "TC1054 representation 1 sp2";
@@ -186,8 +187,9 @@
editor.getEditPart("System1");
editor.doubleClick("System1");
- bot.text("TC1054 representation 2").setText(REPRESENTATION_INSTANCE_NAME_R2_SYS1);
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New TC1054 representation 2");
+ wizardBot.text("TC1054 representation 2").setText(REPRESENTATION_INSTANCE_NAME_R2_SYS1);
+ wizardBot.button("OK").click();
SWTBotSiriusDiagramEditor currentDesignerEditor = SWTBotSiriusHelper.getSiriusDiagramEditor(bot.activeEditor().getTitle());
assertThat("The active editor is not the expected one", currentDesignerEditor.getTitle(), Matchers.is(REPRESENTATION_INSTANCE_NAME_R2_SYS1));
@@ -232,8 +234,9 @@
editor.getEditPart("System1");
editor.doubleClick("System1");
- bot.text("TC1054 representation 2").setText(REPRESENTATION_INSTANCE_NAME_R2_SYS1);
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New TC1054 representation 2");
+ wizardBot.text("TC1054 representation 2").setText(REPRESENTATION_INSTANCE_NAME_R2_SYS1);
+ wizardBot.button("OK").click();
SWTBotSiriusDiagramEditor currentDesignerEditor = SWTBotSiriusHelper.getSiriusDiagramEditor(bot.activeEditor().getTitle());
assertThat("The active editor is not the expected one", currentDesignerEditor.getTitle(), Matchers.is(REPRESENTATION_INSTANCE_NAME_R2_SYS1));
@@ -331,7 +334,6 @@
editor.show();
editor.doubleClick("Sous-package1");
-
ICondition doubleClickChangeCondition = new DoubleClickChangeCondition(editor);
TestsUtil.waitUntil(doubleClickChangeCondition);
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeMappingTestCase.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeMappingTestCase.java
index 578f44a..8af8536 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeMappingTestCase.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeMappingTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -68,10 +69,11 @@
// Create Relation Based Edge
SWTBotUtils.clickContextMenu(defaultItem, RELATION_BASED_EDGE);
defaultItem.select(RELATION_BASED_EDGE);
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
try {
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
- bot.viewByTitle(PROPERTIES).bot().textWithLabel(OPTIONAL_DOMAIN_CLASS);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
+ propertiesView.bot().textWithLabel(OPTIONAL_DOMAIN_CLASS);
} catch (WidgetNotFoundException e) {
// the tab item is not in the property view -> ok
}
@@ -80,9 +82,9 @@
defaultItem.select();
SWTBotUtils.clickContextMenu(defaultItem, ELEMENT_BASED_EDGE);
defaultItem.expandNode(ELEMENT_BASED_EDGE).select();
- bot.viewByTitle(PROPERTIES).setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
- bot.viewByTitle(PROPERTIES).bot().textWithLabel(REQUIRED_DOMAIN_CLASS);
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
+ propertiesView.bot().textWithLabel(REQUIRED_DOMAIN_CLASS);
// Save and Close c.odesign
bot.editorByTitle(MODEL).setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeStabilityOnDragAndDropTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeStabilityOnDragAndDropTest.java
index dffabf7..d3125b7 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeStabilityOnDragAndDropTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeStabilityOnDragAndDropTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.widget.WrappedSWTBotRadio;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
@@ -103,8 +104,8 @@
}
/**
- * Get bendpoints of the first connection found between
- * <code>sourceEditPartName</code> and <code>targetEditPartName</code>.
+ * Get bendpoints of the first connection found between <code>sourceEditPartName</code> and
+ * <code>targetEditPartName</code>.
*
* @param sourceEditPartName
* source of the connection
@@ -120,9 +121,8 @@
}
/**
- * Check the stability of the first connection found between
- * <code>sourceEditPartName</code> and <code>targetEditPartName</code>. The
- * edge is only moved from one side.
+ * Check the stability of the first connection found between <code>sourceEditPartName</code> and
+ * <code>targetEditPartName</code>. The edge is only moved from one side.
*
* @param sourceEditPartName
* source of the connection
@@ -198,9 +198,8 @@
}
/**
- * Check the stability of the first connection found between
- * <code>sourceEditPartName</code> and <code>targetEditPartName</code>. The
- * edge is shifted by a constant vector.
+ * Check the stability of the first connection found between <code>sourceEditPartName</code> and
+ * <code>targetEditPartName</code>. The edge is shifted by a constant vector.
*
* @param sourceEditPartName
* source of the connection
@@ -243,9 +242,8 @@
}
/**
- * Check that the first connection found between
- * <code>sourceEditPartName</code> and <code>targetEditPartName</code> has
- * not moved.
+ * Check that the first connection found between <code>sourceEditPartName</code> and <code>targetEditPartName</code>
+ * has not moved.
*
* @param sourceEditPartName
* source of the connection
@@ -282,8 +280,7 @@
}
/**
- * Get the first connection found between <code>sourceEditPartName</code>
- * and <code>targetEditPartName</code>.
+ * Get the first connection found between <code>sourceEditPartName</code> and <code>targetEditPartName</code>.
*
* @param sourceEditPartName
* source of the connection
@@ -329,40 +326,35 @@
}
/**
- * Change style of edges and drag and and drop a border node to the north of
- * another bordered node.
+ * Change style of edges and drag and and drop a border node to the north of another bordered node.
*/
public void testEdgeStabilityOnDragAndDropOnNorthAfterStyleChange() {
doTestEdgeStabilityOnDragAndDrop("P2", "C2", Direction.NORTH, true);
}
/**
- * Change style of edges and drag and and drop a border node to the south of
- * another bordered node.
+ * Change style of edges and drag and and drop a border node to the south of another bordered node.
*/
public void testEdgeStabilityOnDragAndDropOnSouthAfterStyleChange() {
doTestEdgeStabilityOnDragAndDrop("P2", "C2", Direction.SOUTH, true);
}
/**
- * Change style of edges and drag and and drop a border node to the west of
- * another bordered node.
+ * Change style of edges and drag and and drop a border node to the west of another bordered node.
*/
public void testEdgeStabilityOnDragAndDropOnWestAfterStyleChange() {
doTestEdgeStabilityOnDragAndDrop("P2", "C2", Direction.WEST, true);
}
/**
- * Change style of edges and drag and and drop a border node to the east of
- * another bordered node.
+ * Change style of edges and drag and and drop a border node to the east of another bordered node.
*/
public void testEdgeStabilityOnDragAndDropOnEastAfterStyleChange() {
doTestEdgeStabilityOnDragAndDrop("P2", "C2", Direction.EAST, true);
}
/**
- * Drag and drop a border node to node contained into another with
- * horizontal scrollbar.
+ * Drag and drop a border node to node contained into another with horizontal scrollbar.
*/
public void testEdgeStabilityOnDragAndDropToContainedNode() {
doTestEdgeStabilityOnDragAndDrop("P4", "C2", Direction.WEST, false);
@@ -460,9 +452,10 @@
SWTBotGefEditPart partTarget = editor.getEditPart(target, AbstractDiagramBorderNodeEditPart.class);
List<SWTBotGefConnectionEditPart> edges = editor.getConnectionEditPart(partSource, partTarget);
select(edges.get(0));
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
- SWTBotRadio radioToSelect = bot.viewByTitle("Properties").bot().radioInGroup(style, "Styles:");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
+ SWTBotRadio radioToSelect = propertiesView.bot().radioInGroup(style, "Styles:");
radioToSelect = new WrappedSWTBotRadio(radioToSelect);
radioToSelect.click();
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithMultipleLabelsTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithMultipleLabelsTest.java
index 91da39d..11342fc 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithMultipleLabelsTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithMultipleLabelsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -32,10 +32,11 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckEdgeLabelVisibility;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.swt.SWTException;
-import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.junit.Assert;
@@ -109,8 +110,7 @@
/**
*
- * Test to create a relation based edge and validated that there are
- * multiple labels.
+ * Test to create a relation based edge and validated that there are multiple labels.
*
*/
public void testCreateRelationBasedEdgeStraight() {
@@ -121,8 +121,7 @@
/**
*
- * Test to create a relation based edge and validated that there are
- * multiple labels.
+ * Test to create a relation based edge and validated that there are multiple labels.
*
*/
public void testCreateRelationBasedEdgeManhattan() {
@@ -133,8 +132,7 @@
/**
*
- * Test to create a relation based edge and validated that there are
- * multiple labels.
+ * Test to create a relation based edge and validated that there are multiple labels.
*
*/
public void testCreateRelationBasedEdgeTree() {
@@ -181,8 +179,7 @@
/**
*
- * Test to create an element based edge and validated that there are
- * multiple labels.
+ * Test to create an element based edge and validated that there are multiple labels.
*
*/
public void testCreateElementBasedEdgeStraight() {
@@ -193,8 +190,7 @@
/**
*
- * Test to create an element based edge and validated that there are
- * multiple labels.
+ * Test to create an element based edge and validated that there are multiple labels.
*
*/
public void testCreateElementBasedEdgeManhattan() {
@@ -205,8 +201,7 @@
/**
*
- * Test to create an element based edge and validated that there are
- * multiple labels.
+ * Test to create an element based edge and validated that there are multiple labels.
*
*/
public void testCreateElementBasedEdgeTree() {
@@ -253,8 +248,7 @@
/**
*
- * Test to delete a relation based edge and validated that there are
- * multiple labels.
+ * Test to delete a relation based edge and validated that there are multiple labels.
*
*/
public void testDeleteRelationBasedEdgeStraight() {
@@ -265,8 +259,7 @@
/**
*
- * Test to delete a relation based edge and validated that there are
- * multiple labels.
+ * Test to delete a relation based edge and validated that there are multiple labels.
*
*/
public void testDeleteRelationBasedEdgeManhattan() {
@@ -277,8 +270,7 @@
/**
*
- * Test to delete a relation based edge and validated that there are
- * multiple labels.
+ * Test to delete a relation based edge and validated that there are multiple labels.
*
*/
public void testDeleteRelationBasedEdgeTree() {
@@ -326,8 +318,7 @@
/**
*
- * Test to delete an element based edge and validated that there are
- * multiple labels.
+ * Test to delete an element based edge and validated that there are multiple labels.
*
*/
public void testDeleteElementBasedEdgeStraight() {
@@ -338,8 +329,7 @@
/**
*
- * Test to delete an element based edge and validated that there are
- * multiple labels.
+ * Test to delete an element based edge and validated that there are multiple labels.
*
*/
public void testDeleteElementBasedEdgeManhattan() {
@@ -350,8 +340,7 @@
/**
*
- * Test to delete an element based edge and validated that there are
- * multiple labels.
+ * Test to delete an element based edge and validated that there are multiple labels.
*
*/
public void testDeleteElementBasedEdgeTree() {
@@ -435,11 +424,11 @@
// Hide the label
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("EC1 -> EC3").getNode("label").select().toggleCheck();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
// bot.waitUntil(new CheckEdgeLabelIsHidden(editor, "EC1 begin"));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 center", false));
@@ -447,11 +436,12 @@
// Show the label
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("EC1 -> EC3").getNode("label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("label").select().toggleCheck();
+
+ wizardBot.button("OK").click();
// bot.waitUntil(new CheckEdgeLabelIsHidden(editor, "EC1 begin"));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 center", true));
@@ -498,11 +488,11 @@
// Hide the label
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("ec2 : EC2").getNode("label").select().toggleCheck();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
// bot.waitUntil(new CheckEdgeLabelIsHidden(editor, "EC1 begin"));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 center", false));
@@ -510,11 +500,11 @@
// Show the label
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("ec2 : EC2").getNode("label").select().toggleCheck();
+ wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
// bot.waitUntil(new CheckEdgeLabelIsHidden(editor, "EC1 begin"));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 center", true));
@@ -565,14 +555,14 @@
// Hide the label begin and center
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 begin label").select().toggleCheck();
- bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 center label").select().toggleCheck();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 begin label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 center label").select().toggleCheck();
// bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 end
// label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 begin", false));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 center", false));
@@ -580,13 +570,13 @@
// Toggle visibility of all labels
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 begin label").select().toggleCheck();
- bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 center label").select().toggleCheck();
- bot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 end label").select().toggleCheck();
+ wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 begin label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 center label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("EC1 -> EC3").getNode("EC1 end label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 begin", true));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "EC1 center", true));
@@ -633,14 +623,14 @@
// Hide the label begin and center
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 begin label").select().toggleCheck();
- bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 center label").select().toggleCheck();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("ec2 begin label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("ec2 center label").select().toggleCheck();
// bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 end
// label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 begin", false));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 center", false));
@@ -648,13 +638,13 @@
// Toggle visibility of all labels
editor.bot().toolbarButtonWithTooltip("Show/Hide").click();
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Diagram elements visibility"));
- bot.text().setText("*label");
- bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 begin label").select().toggleCheck();
- bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 center label").select().toggleCheck();
- bot.tree().getTreeItem("ec2 : EC2").getNode("ec2 end label").select().toggleCheck();
+ wizardBot = SWTBotSiriusHelper.getShellBot("Diagram elements visibility");
+ wizardBot.text().setText("*label");
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("ec2 begin label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("ec2 center label").select().toggleCheck();
+ wizardBot.tree().getTreeItem("ec2 : EC2").getNode("ec2 end label").select().toggleCheck();
- bot.button("OK").click();
+ wizardBot.button("OK").click();
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 begin", true));
bot.waitUntil(new CheckEdgeLabelVisibility(editor, "ec2 center", true));
@@ -975,8 +965,8 @@
}
/**
- * The direct edit on begin label is not allowed, so check that it fails.
- * The default SWTBot timeOut is reduced to consume less time.
+ * The direct edit on begin label is not allowed, so check that it fails. The default SWTBot timeOut is reduced to
+ * consume less time.
*/
private void validateDirectEditRelationBasedEdgeBeginLabel() {
@@ -1270,8 +1260,8 @@
}
/**
- * The direct edit on end label is not allowed, so check that it fails. The
- * default SWTBot timeOut is reduced to consume less time.
+ * The direct edit on end label is not allowed, so check that it fails. The default SWTBot timeOut is reduced to
+ * consume less time.
*/
private void validateDirectEditElementBasedEdgeEndLabel() {
addWarningListener();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EmptyPropertyViewAfterDeletionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EmptyPropertyViewAfterDeletionTest.java
index fb6c794..265c6f8 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EmptyPropertyViewAfterDeletionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EmptyPropertyViewAfterDeletionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -41,9 +41,8 @@
import org.junit.Assert;
/**
- * Test class that after semantic element deletion in REFRESH_AUTO mode to
- * false, the Property view should not display properties on the remaining
- * orphan View.
+ * Test class that after semantic element deletion in REFRESH_AUTO mode to false, the Property view should not display
+ * properties on the remaining orphan View.
*
* @author edugueperoux
*/
@@ -111,9 +110,8 @@
}
/**
- * Test class that after semantic node deletion in REFRESH_AUTO mode to
- * false, the Property view should not display properties on the remaining
- * orphan View.
+ * Test class that after semantic node deletion in REFRESH_AUTO mode to false, the Property view should not display
+ * properties on the remaining orphan View.
*/
public void testEmptyPropertyViewAfterNodeDeletionTest() {
// Eclipse 4.x setFocus
@@ -193,9 +191,8 @@
}
/**
- * Test class that after semantic edge deletion in REFRESH_AUTO mode to
- * false, the Property view should not display properties on the remaining
- * orphan View.
+ * Test class that after semantic edge deletion in REFRESH_AUTO mode to false, the Property view should not display
+ * properties on the remaining orphan View.
*/
public void testEmptyPropertyViewAfterEdgeDeletionTest() {
// Eclipse 4.x setFocus
@@ -276,8 +273,7 @@
}
/**
- * Specific delete, made outside of the editor to get the semantic
- * decorators.
+ * Specific delete, made outside of the editor to get the semantic decorators.
*/
private void deleteFromOutside(IDiagramElementEditPart part) {
EObject semElt = part.resolveTargetSemanticElement();
@@ -288,8 +284,8 @@
}
/**
- * Get the numbers of Red cross decorators (used to indicate a delete
- * semantic element of a figure in REFRESH_AUTO mode to false).
+ * Get the numbers of Red cross decorators (used to indicate a delete semantic element of a figure in REFRESH_AUTO
+ * mode to false).
*
* @return the numbers of Red cross decorators
*/
@@ -304,23 +300,22 @@
}
/**
- * Checks that on current diagram selection the Property view tabs are noy
- * empty.
+ * Checks that on current diagram selection the Property view tabs are noy empty.
*/
private void checkNotEmptyPropertyTabs() {
SWTBotView propertyView = bot.viewByTitle("Properties");
propertyView.setFocus();
SWTBot propertyViewBot = propertyView.bot();
- SWTBotSiriusHelper.selectPropertyTabItem("Semantic");
+ SWTBotSiriusHelper.selectPropertyTabItem("Semantic", propertyViewBot);
SWTBotTree swtBotTree = propertyViewBot.tree();
Assert.assertNotSame(0, swtBotTree.getAllItems().length);
- SWTBotSiriusHelper.selectPropertyTabItem("Style");
+ SWTBotSiriusHelper.selectPropertyTabItem("Style", propertyViewBot);
swtBotTree = propertyViewBot.tree();
Assert.assertNotSame(0, swtBotTree.getAllItems().length);
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertyViewBot);
// Checks if the Appearance tab is empty, if not the focused widget is a
// text widget otherwise it is a ScrolledComposite
Assert.assertTrue(propertyViewBot.getFocusedWidget() instanceof Text);
@@ -328,23 +323,22 @@
}
/**
- * Checks that on current diagram selection the Property view tabs are
- * empty.
+ * Checks that on current diagram selection the Property view tabs are empty.
*/
private void checkEmptyPropertyTabs() {
SWTBotView propertyView = bot.viewByTitle("Properties");
propertyView.setFocus();
SWTBot propertyViewBot = propertyView.bot();
- SWTBotSiriusHelper.selectPropertyTabItem("Semantic");
+ SWTBotSiriusHelper.selectPropertyTabItem("Semantic", propertyViewBot);
SWTBotTree swtBotTree = propertyViewBot.tree();
Assert.assertEquals(0, swtBotTree.getAllItems().length);
- SWTBotSiriusHelper.selectPropertyTabItem("Style");
+ SWTBotSiriusHelper.selectPropertyTabItem("Style", propertyViewBot);
swtBotTree = propertyViewBot.tree();
Assert.assertEquals(0, swtBotTree.getAllItems().length);
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertyViewBot);
// Checks if the Appearance tab is empty, i.e. if not the focused widget
// is a
// text widget otherwise it is a ScrolledComposite
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageFromCloseSessionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageFromCloseSessionTest.java
index e3ff35a..257a065 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageFromCloseSessionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageFromCloseSessionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2017, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -20,9 +20,10 @@
import org.eclipse.sirius.tests.SiriusTestsPlugin;
import org.eclipse.sirius.tests.support.api.EclipseTestsSupportHelper;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.viewpoint.provider.Messages;
-import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -61,8 +62,8 @@
SWTBotTree tree = bot.viewByTitle("Model Explorer").bot().tree();
SWTBotTreeItem representationsFile = tree.expandNode(getProjectName()).select(SESSION_MODEL_FILENAME);
SWTBotUtils.clickContextMenu(representationsFile, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle));
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle);
+ exportBot.button("OK").click();
SWTBotUtils.waitAllUiEvents();
// Ensure that one image file has been created.
project.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageWhenManyRepresentationsHaveSameNameTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageWhenManyRepresentationsHaveSameNameTest.java
index 499466a..f22c6be 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageWhenManyRepresentationsHaveSameNameTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramAsImageWhenManyRepresentationsHaveSameNameTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -30,15 +30,16 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.dialog.ExportAsImageHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.hamcrest.Matchers;
/**
- * Asserts that the exported image corresponds to the exported representation
- * contained by a session having many representations with the same name.
+ * Asserts that the exported image corresponds to the exported representation contained by a session having many
+ * representations with the same name.
*
* Test VP-2711
*
@@ -100,9 +101,8 @@
}
/**
- * Validate that that the exported image corresponds to the exported
- * representation when many representations have the same name in fragment
- * session. Check image size correspond to attempt.
+ * Validate that that the exported image corresponds to the exported representation when many representations have
+ * the same name in fragment session. Check image size correspond to attempt.
*
* @throws Exception
* Test error.
@@ -157,11 +157,12 @@
// Wait all UI events to ensure that the tabbar is correctly refreshed.
SWTBotUtils.waitAllUiEvents();
- bot.activeEditor().bot().toolbarButtonWithTooltip("Export diagram as image").click();
+ SWTBot editorBot = bot.activeEditor().bot();
+ editorBot.toolbarButtonWithTooltip("Export diagram as image").click();
- bot.waitUntil(Conditions.shellIsActive("Export representation as image file"));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot("Export representation as image file");
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
}
private void valideExportResult(final String imageExtension, String newFolderName, int imageSize, final String... expectedFileNames) throws Exception {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesAndHtmlTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesAndHtmlTest.java
index 8e303bd..74828fb 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesAndHtmlTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesAndHtmlTest.java
@@ -33,10 +33,11 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.dialog.ExportAsImageHelper;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.viewpoint.provider.Messages;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -96,8 +97,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for JPG export.
+ * Validate the functionality "Export representations as images" on an aird file for JPG export.
*
* @throws Exception
* Test error.
@@ -111,9 +111,8 @@
}
/**
- * Validate the functionality "Export representations as images" on a
- * representations file for JPG format in a path that containing dot (for
- * example in a folder named "a.b"). VP-2928
+ * Validate the functionality "Export representations as images" on a representations file for JPG format in a path
+ * that containing dot (for example in a folder named "a.b"). VP-2928
*
* @throws Exception
* Test error.
@@ -129,10 +128,9 @@
}
/**
- * Validate the fails of functionality "Export representations as images" on
- * a representations file for JPG format with an inexisting folder
- * destination. VP-2929 Check that the "folder check rules" are called at
- * the opening of the dialog.
+ * Validate the fails of functionality "Export representations as images" on a representations file for JPG format
+ * with an inexisting folder destination. VP-2929 Check that the "folder check rules" are called at the opening of
+ * the dialog.
*
* @throws Exception
* Test error.
@@ -159,8 +157,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for PNG export.
+ * Validate the functionality "Export representations as images" on an aird file for PNG export.
*
* @throws Exception
* Test error.
@@ -173,8 +170,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for SVG export.
+ * Validate the functionality "Export representations as images" on an aird file for SVG export.
*
* @throws Exception
* Test error.
@@ -187,8 +183,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for JPG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for JPG export.
*
* @throws Exception
* Test error.
@@ -201,8 +196,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for PNG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for PNG export.
*
* @throws Exception
* Test error.
@@ -215,8 +209,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for SVG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for SVG export.
*
* @throws Exception
* Test error.
@@ -229,8 +222,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for JPG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for JPG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -248,9 +240,8 @@
// There is a problem with the text update in the combo file path.
/**
- * Validate the functionality "Export diagram as image" from tab bar for
- * file without extension, with extension not authorized, with extension
- * change from image format with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for file without extension, with extension not
+ * authorized, with extension change from image format with a transient session.
*
* @throws Exception
* Test error.
@@ -267,8 +258,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for PNG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for PNG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -285,8 +275,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for SVG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for SVG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -303,8 +292,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for JPG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for JPG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -326,8 +315,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for PNG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for PNG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -349,8 +338,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for SVG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for SVG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -358,20 +347,13 @@
public void testExportDiagramsOfTransientSessionAsSVGFromModelContentView() throws Exception {
if (TestsUtil.shouldSkipUnreliableTests()) {
/*
- * org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout
- * after: 10000 ms.: tree item with text DesignerTestProject is not
- * expanded at
- * org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
- * SWTBotFactory.java:407) at
- * org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
- * SWTBotFactory.java:381) at
- * org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
- * SWTBotFactory.java:369) at
- * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
- * getProjectTreeItem(UIProject.java:108) at
- * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
- * getUIItemFromResource(UIProject.java:137) at
- * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
+ * org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 10000 ms.: tree item with text
+ * DesignerTestProject is not expanded at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
+ * SWTBotFactory.java:407) at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil( SWTBotFactory.java:381)
+ * at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil( SWTBotFactory.java:369) at
+ * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject. getProjectTreeItem(UIProject.java:108) at
+ * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject. getUIItemFromResource(UIProject.java:137)
+ * at org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
* mouseRigthClickOnResource(UIProject.java:171) at
* org.eclipse.sirius.tests.swtbot.ExportDiagramsAsImagesAndHtmlTest
* .testExportDiagramsOfTransientSessionAsSVGFromModelContentView(
@@ -402,15 +384,13 @@
expandedProjectTreeItem.select(airdFilename);
SWTBotUtils.clickContextMenu(airdFileTreeItem, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAMS_AS_IMAGE));
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAMS_AS_IMAGE);
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAMS_AS_IMAGE));
+ assertNotNull(exportBot.comboBoxWithLabel("To directory"));
- assertNotNull(bot.comboBoxWithLabel("To directory"));
-
- bot.comboBox(1).setSelection(imageExtension);
- bot.checkBox("Export to HTML").select();
- bot.button("OK").click();
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.checkBox("Export to HTML").select();
+ exportBot.button("OK").click();
}
/**
@@ -419,13 +399,11 @@
* @param imageExtension
* The extension to choose in the export dialog
* @param newDestinationFolderName
- * The name of the folder to add to the default folder used for
- * destination (this folder will be created)
+ * The name of the folder to add to the default folder used for destination (this folder will be created)
* @param errorMessageToCheck
- * null if no error message to check, a message if the export
- * dialog must display an error message. If the message is not
- * null, a test is done to check if it is displayed and the
- * Cancel button is then check.
+ * null if no error message to check, a message if the export dialog must display an error message. If
+ * the message is not null, a test is done to check if it is displayed and the Cancel button is then
+ * check.
* @throws Exception
*/
private void exportAsImageFromProjectExplorerView(String imageExtension, String newDestinationFolderName, String errorMessageToCheck) throws Exception {
@@ -438,28 +416,26 @@
expandedProjectTreeItem.select(airdFilename);
SWTBotUtils.clickContextMenu(airdFileTreeItem, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAMS_AS_IMAGE));
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAMS_AS_IMAGE);
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAMS_AS_IMAGE));
-
- assertNotNull(bot.comboBoxWithLabel("To directory"));
+ assertNotNull(exportBot.comboBoxWithLabel("To directory"));
if (newDestinationFolderName != null) {
- File newFolder = new File(bot.comboBox(0).getText() + File.separator + newDestinationFolderName);
+ File newFolder = new File(exportBot.comboBox(0).getText() + File.separator + newDestinationFolderName);
newFolder.mkdir();
- bot.comboBox(0).setText(newFolder.getAbsolutePath());
+ exportBot.comboBox(0).setText(newFolder.getAbsolutePath());
}
- bot.comboBox(1).setSelection(imageExtension);
- bot.checkBox("Export to HTML").select();
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.checkBox("Export to HTML").select();
if (errorMessageToCheck != null) {
try {
- bot.label(errorMessageToCheck);
+ exportBot.label(errorMessageToCheck);
} catch (WidgetNotFoundException e) {
fail("The error message \"" + errorMessageToCheck + "\" is expected in the export dialog but is not displayed");
}
- bot.button("Cancel").click();
+ exportBot.button("Cancel").click();
} else {
- bot.button("OK").click();
+ exportBot.button("OK").click();
}
}
@@ -470,20 +446,18 @@
SWTBotUtils.clickContextMenu(semanticRoot, Messages.ExportRepresentationsAction_label);
int nbRepsToExport = DialectManager.INSTANCE.getAllRepresentations(localSession.getOpenedSession()).size();
-
+ SWTBot exportBot = null;
if (nbRepsToExport == 1) {
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAM_AS_IMAGE));
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAM_AS_IMAGE));
- assertNotNull(bot.comboBoxWithLabel("To file"));
+ exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAM_AS_IMAGE);
+ assertNotNull(exportBot.comboBoxWithLabel("To file"));
} else {
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAMS_AS_IMAGE));
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAMS_AS_IMAGE));
- assertNotNull(bot.comboBoxWithLabel("To directory"));
+ exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAMS_AS_IMAGE);
+ assertNotNull(exportBot.comboBoxWithLabel("To directory"));
}
- bot.comboBox(1).setSelection(imageExtension);
- bot.checkBox("Export to HTML").select();
- bot.button("OK").click();
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.checkBox("Export to HTML").select();
+ exportBot.button("OK").click();
}
private void exportAsImageFromEditorTabBar(String imageExtension) throws Exception {
@@ -493,15 +467,13 @@
bot.activeEditor().bot().toolbarButtonWithTooltip("Export diagram as image").click();
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAM_AS_IMAGE));
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAM_AS_IMAGE);
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAM_AS_IMAGE));
+ assertNotNull(exportBot.comboBoxWithLabel("To file"));
- assertNotNull(bot.comboBoxWithLabel("To file"));
-
- bot.comboBox(1).setSelection(imageExtension);
- bot.checkBox("Export to HTML").select();
- bot.button("OK").click();
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.checkBox("Export to HTML").select();
+ exportBot.button("OK").click();
}
private void exportAsImageFromEditorTabBar() throws Exception {
@@ -511,23 +483,21 @@
bot.activeEditor().bot().toolbarButtonWithTooltip("Export diagram as image").click();
- bot.waitUntil(Conditions.shellIsActive(EXPORT_DIAGRAM_AS_IMAGE));
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(EXPORT_DIAGRAM_AS_IMAGE);
- assertThat("The dialog is not correct for the export", bot.activeShell().getText(), equalTo(EXPORT_DIAGRAM_AS_IMAGE));
+ assertNotNull(exportBot.comboBoxWithLabel("To file"));
- assertNotNull(bot.comboBoxWithLabel("To file"));
-
- StringBuffer filePath = new StringBuffer(bot.comboBoxWithLabel("To file").getText());
+ StringBuffer filePath = new StringBuffer(exportBot.comboBoxWithLabel("To file").getText());
filePath.append("/export.png");
- bot.comboBoxWithLabel("To file").getText();
+ exportBot.comboBoxWithLabel("To file").getText();
- bot.comboBoxWithLabel("To file").setText(filePath.toString());
+ exportBot.comboBoxWithLabel("To file").setText(filePath.toString());
- bot.button(0).setFocus();
+ exportBot.button(0).setFocus();
- assertThat("The image format is not correct", bot.comboBox(1).getText(), equalTo("PNG"));
+ assertThat("The image format is not correct", exportBot.comboBox(1).getText(), equalTo("PNG"));
IPath path = new Path(filePath.toString());
@@ -535,20 +505,20 @@
path = path.addFileExtension("txt");
- bot.comboBoxWithLabel("To file").setText(path.toString());
+ exportBot.comboBoxWithLabel("To file").setText(path.toString());
- bot.button(0).setFocus();
+ exportBot.button(0).setFocus();
- bot.comboBox(1).setSelection("JPG");
+ exportBot.comboBox(1).setSelection("JPG");
// This part not working
// if (!path.toString().contains(".txt.jpg")) {
// fail("the update file path does not correct");
// }
- bot.checkBox("Export to HTML").select();
+ exportBot.checkBox("Export to HTML").select();
- bot.button("OK").click();
+ exportBot.button("OK").click();
}
private void valideExportResult(final String imageExtension, final String... expectedFileNames) throws Exception {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesTest.java
index c79588f..6ee1928 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExportDiagramsAsImagesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -24,9 +24,10 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckTreeItemEnabled;
import org.eclipse.sirius.tests.swtbot.support.api.dialog.ExportAsImageHelper;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.viewpoint.provider.Messages;
-import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -100,8 +101,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for JPG export.
+ * Validate the functionality "Export representations as images" on an aird file for JPG export.
*
* @throws Exception
* Test error.
@@ -114,8 +114,7 @@
}
/**
- * Validate the functionality "Export representations as images" on a big
- * aird file for JPG export.
+ * Validate the functionality "Export representations as images" on a big aird file for JPG export.
*
* @throws Exception
* Test error.
@@ -135,8 +134,7 @@
}
/**
- * Validate the functionality "Export representations as images" on a big
- * aird file for PNG export.
+ * Validate the functionality "Export representations as images" on a big aird file for PNG export.
*
* @throws Exception
* Test error.
@@ -156,9 +154,8 @@
}
/**
- * Validate the functionality "Export representations as images" on a big
- * aird file for SVG export. Since VP-3958, we export correctly big SVG
- * image.
+ * Validate the functionality "Export representations as images" on a big aird file for SVG export. Since VP-3958,
+ * we export correctly big SVG image.
*
* @throws Exception
* Test error.
@@ -178,8 +175,8 @@
}
/**
- * Validate the functionality "Export diagram as images" from tab bar for
- * JPG export, with a big representation (size > 50 000 000 pixels).
+ * Validate the functionality "Export diagram as images" from tab bar for JPG export, with a big representation
+ * (size > 50 000 000 pixels).
*
* @throws Exception
* Test error.
@@ -207,8 +204,8 @@
}
/**
- * Validate the functionality "Export diagram as images" from tab bar for
- * PNG export, with a big representation (size > 50 000 000 pixels).
+ * Validate the functionality "Export diagram as images" from tab bar for PNG export, with a big representation
+ * (size > 50 000 000 pixels).
*
* @throws Exception
* Test error.
@@ -229,9 +226,8 @@
}
/**
- * Validate the functionality "Export diagram as images" from tab bar for
- * SVG export, with a big representation (size > 50 000 000 pixels). Since
- * VP-3958, we export correctly big SVG image.
+ * Validate the functionality "Export diagram as images" from tab bar for SVG export, with a big representation
+ * (size > 50 000 000 pixels). Since VP-3958, we export correctly big SVG image.
*
* @throws Exception
* Test error.
@@ -252,8 +248,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for PNG export.
+ * Validate the functionality "Export representations as images" on an aird file for PNG export.
*
* @throws Exception
* Test error.
@@ -266,8 +261,7 @@
}
/**
- * Validate the functionality "Export representations as images" on an aird
- * file for SVG export.
+ * Validate the functionality "Export representations as images" on an aird file for SVG export.
*
* @throws Exception
* Test error.
@@ -280,8 +274,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for JPG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for JPG export.
*
* @throws Exception
* Test error.
@@ -294,8 +287,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for PNG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for PNG export.
*
* @throws Exception
* Test error.
@@ -308,8 +300,7 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for SVG export.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for SVG export.
*
* @throws Exception
* Test error.
@@ -322,8 +313,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for JPG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for JPG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -340,8 +330,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for PNG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for PNG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -349,21 +338,15 @@
public void testExportDiagramsOfTransientSessionAsPNGFromTabBar() throws Exception {
if (TestsUtil.shouldSkipUnreliableTests()) {
/*
- * org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException:
- * Could not find node with text: vp867.ecore at
- * org.eclipse.swtbot.swt
- * .finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334)
- * at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(
- * SWTBotTreeItem.java:308) at
- * org.eclipse.swtbot.swt.finder.widgets.
- * SWTBotTreeItem.getNode(SWTBotTreeItem.java:346) at
- * org.eclipse.sirius .tests.swtbot.support.api.business.UIProject.
- * getUIItemFromResource (UIProject.java:152) at
- * org.eclipse.sirius.tests.swtbot.support.api
- * .business.UIProject.mouseRigthClickOnResource(UIProject.java:171)
- * at org.eclipse.sirius.tests.swtbot.ExportDiagramsAsImagesTest.
- * testExportDiagramsOfTransientSessionAsPNGFromTabBar
- * (ExportDiagramsAsImagesTest.java:372)
+ * org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find node with text:
+ * vp867.ecore at org.eclipse.swtbot.swt .finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334) at
+ * org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode( SWTBotTreeItem.java:308) at
+ * org.eclipse.swtbot.swt.finder.widgets. SWTBotTreeItem.getNode(SWTBotTreeItem.java:346) at
+ * org.eclipse.sirius .tests.swtbot.support.api.business.UIProject. getUIItemFromResource
+ * (UIProject.java:152) at org.eclipse.sirius.tests.swtbot.support.api
+ * .business.UIProject.mouseRigthClickOnResource(UIProject.java:171) at
+ * org.eclipse.sirius.tests.swtbot.ExportDiagramsAsImagesTest.
+ * testExportDiagramsOfTransientSessionAsPNGFromTabBar (ExportDiagramsAsImagesTest.java:372)
*/
return;
}
@@ -379,8 +362,7 @@
}
/**
- * Validate the functionality "Export diagram as image" from tab bar for SVG
- * export, with a transient session.
+ * Validate the functionality "Export diagram as image" from tab bar for SVG export, with a transient session.
*
* @throws Exception
* Test error.
@@ -388,22 +370,15 @@
public void testExportDiagramsOfTransientSessionAsSVGFromTabBar() throws Exception {
if (TestsUtil.shouldSkipUnreliableTests()) {
/*
- * org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException:
- * Could not find node with text: vp867.ecore at
- * org.eclipse.swtbot.swt
- * .finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334)
- * at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(
- * SWTBotTreeItem.java:308) at
- * org.eclipse.swtbot.swt.finder.widgets.
- * SWTBotTreeItem.getNode(SWTBotTreeItem.java:346) at
- * org.eclipse.sirius .tests.swtbot.support.api.business.UIProject.
- * getUIItemFromResource (UIProject.java:152) at
- * org.eclipse.sirius.tests.swtbot.support.api
- * .business.UIProject.mouseRigthClickOnResource(UIProject.java:171)
- * at
+ * org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find node with text:
+ * vp867.ecore at org.eclipse.swtbot.swt .finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334) at
+ * org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode( SWTBotTreeItem.java:308) at
+ * org.eclipse.swtbot.swt.finder.widgets. SWTBotTreeItem.getNode(SWTBotTreeItem.java:346) at
+ * org.eclipse.sirius .tests.swtbot.support.api.business.UIProject. getUIItemFromResource
+ * (UIProject.java:152) at org.eclipse.sirius.tests.swtbot.support.api
+ * .business.UIProject.mouseRigthClickOnResource(UIProject.java:171) at
* org.eclipse.sirius.tests.swtbot.ExportDiagramsAsImagesAndHtmlTest
- * .testExportDiagramsOfTransientSessionAsSVGFromTabBar(
- * ExportDiagramsAsImagesAndHtmlTest.java:306)
+ * .testExportDiagramsOfTransientSessionAsSVGFromTabBar( ExportDiagramsAsImagesAndHtmlTest.java:306)
*/
return;
}
@@ -419,8 +394,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for JPG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for JPG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -442,8 +417,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for PNG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for PNG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -451,25 +426,16 @@
public void testExportDiagramsOfTransientSessionAsPNGFromModelContentView() throws Exception {
if (TestsUtil.shouldSkipUnreliableTests()) {
/*
- * org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout
- * after: 10000 ms.: tree item with text DesignerTestProject is not
- * expanded at
- * org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
- * SWTBotFactory.java:407) at
- * org.eclipse.swtbot.swt.finder.SWTBotFactory
- * .waitUntil(SWTBotFactory.java:381) at
- * org.eclipse.swtbot.swt.finder
- * .SWTBotFactory.waitUntil(SWTBotFactory.java:369) at
- * org.eclipse.sirius
- * .tests.swtbot.support.api.business.UIProject.getProjectTreeItem
- * (UIProject.java:108) at
- * org.eclipse.sirius.tests.swtbot.support.api
- * .business.UIProject.getUIItemFromResource(UIProject.java:137) at
- * org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
+ * org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 10000 ms.: tree item with text
+ * DesignerTestProject is not expanded at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
+ * SWTBotFactory.java:407) at org.eclipse.swtbot.swt.finder.SWTBotFactory .waitUntil(SWTBotFactory.java:381)
+ * at org.eclipse.swtbot.swt.finder .SWTBotFactory.waitUntil(SWTBotFactory.java:369) at org.eclipse.sirius
+ * .tests.swtbot.support.api.business.UIProject.getProjectTreeItem (UIProject.java:108) at
+ * org.eclipse.sirius.tests.swtbot.support.api .business.UIProject.getUIItemFromResource(UIProject.java:137)
+ * at org.eclipse.sirius.tests.swtbot.support.api.business.UIProject.
* mouseRigthClickOnResource(UIProject.java:171) at
* org.eclipse.sirius.tests.swtbot.ExportDiagramsAsImagesTest.
- * testExportDiagramsOfTransientSessionAsPNGFromModelContentView
- * (ExportDiagramsAsImagesTest.java:463)
+ * testExportDiagramsOfTransientSessionAsPNGFromModelContentView (ExportDiagramsAsImagesTest.java:463)
*/
return;
}
@@ -487,8 +453,8 @@
}
/**
- * Validate the functionality "Export representations as images" on the root
- * of a semantic model for SVG export, with a transient session.
+ * Validate the functionality "Export representations as images" on the root of a semantic model for SVG export,
+ * with a transient session.
*
* @throws Exception
* Test error.
@@ -508,8 +474,7 @@
}
/**
- * Validate that file separators in representation name are correctly
- * replaced during the diagram export.
+ * Validate that file separators in representation name are correctly replaced during the diagram export.
*
* @throws Exception
* Test error.
@@ -523,10 +488,10 @@
uiDiagramRepresentation.open();
SWTBotUtils.clickContextMenu(uiDiagramRepresentation.getTreeItem(), Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportOneRepresentationAsImageDialog_dialogTitle));
- bot.comboBox(1).setSelection("SVG");
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportOneRepresentationAsImageDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection("SVG");
- bot.button("OK").click();
+ exportBot.button("OK").click();
// exportAsImageFromEditorTabBar("SVG");
valideExportResult("svg", REPRESENTATION_INSTANCE_NAME3_RENAMED);
}
@@ -536,9 +501,9 @@
SWTBotTreeItem airdFile = tree.expandNode(designerProject.getName()).select(SESSION_FILE);
SWTBotUtils.clickContextMenu(airdFile, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
SWTBotUtils.waitAllUiEvents();
SWTBotUtils.waitAllUiEvents();
}
@@ -548,9 +513,9 @@
SWTBotTreeItem airdFile = tree.expandNode(designerProject.getName()).select(BIG_SESSION);
SWTBotUtils.clickContextMenu(airdFile, Messages.ExportRepresentationsAction_label);
SWTBotUtils.waitAllUiEvents();
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
SWTBotUtils.waitAllUiEvents();
// The session should still be opened after having performed an export as image.
Session opennedSession = localSession.getOpenedSession();
@@ -564,9 +529,9 @@
SWTBotTreeItem semanticRoot = localSession.getSemanticResourceNode(new UIResource(designerProject, FILE_DIR, MODEL)).select(rootElementName);
SWTBotUtils.clickContextMenu(semanticRoot, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
}
private void exportAsImageTranscientSessionFromModelContentView(String imageExtension, String rootElementName) throws Exception {
@@ -575,9 +540,9 @@
SWTBotTreeItem semanticRoot = localSession.getSemanticResourceNode(new UIResource(designerProject, FILE_DIR, MODEL)).select(rootElementName);
SWTBotUtils.clickContextMenu(semanticRoot, Messages.ExportRepresentationsAction_label);
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportSeveralRepresentationsAsImagesDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
}
private void exportAsImageFromEditorTabBar(String imageExtension) throws Exception {
@@ -587,9 +552,9 @@
bot.activeEditor().bot().toolbarButtonWithTooltip("Export diagram as image").click();
- bot.waitUntil(Conditions.shellIsActive(Messages.ExportOneRepresentationAsImageDialog_dialogTitle));
- bot.comboBox(1).setSelection(imageExtension);
- bot.button("OK").click();
+ SWTBot exportBot = SWTBotSiriusHelper.getShellBot(Messages.ExportOneRepresentationAsImageDialog_dialogTitle);
+ exportBot.comboBox(1).setSelection(imageExtension);
+ exportBot.button("OK").click();
}
private void valideExportResult(String imageExtension, final String... expectedFileNames) throws Exception {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExtensionActivationOrderTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExtensionActivationOrderTest.java
index 25754f5..45b193d 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExtensionActivationOrderTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ExtensionActivationOrderTest.java
@@ -26,20 +26,18 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.dialog.ViewpointSelectionDialog;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * This tests for a bug (VP-2529) when a viewpoint which contains a
- * representation extension is enabled before the viewpoint which contains the
- * extended representation: if the extension references the base viewpoint
- * through "viewpoint:/" URIs, the base VSM was loaded through that logical URI
- * instead of a concrete "platform:/" one, which causes problems in other parts
- * of Sirius.
+ * This tests for a bug (VP-2529) when a viewpoint which contains a representation extension is enabled before the
+ * viewpoint which contains the extended representation: if the extension references the base viewpoint through
+ * "viewpoint:/" URIs, the base VSM was loaded through that logical URI instead of a concrete "platform:/" one, which
+ * causes problems in other parts of Sirius.
*
* See VP-2529
*
@@ -93,15 +91,13 @@
}
/**
- * Part of VP-2529 was that when the user selects the base viewpoint and all
- * its extensions, the viewpoints were enabled in a pseudo-random order, and
- * some orders (extensions before base) cause problems.
+ * Part of VP-2529 was that when the user selects the base viewpoint and all its extensions, the viewpoints were
+ * enabled in a pseudo-random order, and some orders (extensions before base) cause problems.
*/
public void _testEnableBaseAndExtensions() {
/*
- * The bug is not systematic, it depends on the unpredictable order in
- * which the selected viewpoints are actually enabled, so we try several
- * times.
+ * The bug is not systematic, it depends on the unpredictable order in which the selected viewpoints are
+ * actually enabled, so we try several times.
*/
for (int i = 0; i < 5; i++) {
UIResource semanticResource = new UIResource(designerProject, "example.ecore");
@@ -112,9 +108,8 @@
SWTBotTreeItem mainPackage = session.getSemanticResourceNode(semanticResource).getNode("package");
UIDiagramRepresentation diagram = session.newDiagramRepresentation("new " + DIAGRAM_NAME, DIAGRAM_NAME).on(mainPackage).withDefaultName().ok();
/*
- * The next line fails (with an NPE) if the bug in VP-2529 is
- * present, as the pseudo-editor which was opened shows an error
- * message instead of a real diagram.
+ * The next line fails (with an NPE) if the bug in VP-2529 is present, as the pseudo-editor which was opened
+ * shows an error message instead of a real diagram.
*/
diagram.getEditor();
session.closeAndDiscardChanges();
@@ -123,11 +118,9 @@
}
/**
- * In order to ensure that all the dependencies of a viewpoint are enabled
- * when a viewpoint is enabled, a new validation UI has been added to the
- * viewpoints selection dialog. Test that when we try to enable just
- * Extension_A, the UI pops up and refuses to finish the action until we
- * have also selected Base.
+ * In order to ensure that all the dependencies of a viewpoint are enabled when a viewpoint is enabled, a new
+ * validation UI has been added to the viewpoints selection dialog. Test that when we try to enable just
+ * Extension_A, the UI pops up and refuses to finish the action until we have also selected Base.
*/
public void testEnableOnlyExtension() {
UIResource semanticResource = new UIResource(designerProject, "example.ecore");
@@ -136,14 +129,14 @@
Set<String> viewpointToSelect = Collections.singleton("Extension_A");
/*
- * We can not use session.changeSiriusSelection() directly, so the
- * following code is copied and adapted from there.
+ * We can not use session.changeSiriusSelection() directly, so the following code is copied and adapted from
+ * there.
*/
SWTBotTreeItem rootTreeItem = session.getRootSessionTreeItem().select();
SWTBotUtils.clickContextMenu(rootTreeItem, ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME);
bot.waitUntil(Conditions.shellIsActive(ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME));
- SWTBotShell shellSiriussSelection = bot.shell(ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME);
+ SWTBot botSiriusSelection = bot.shell(ViewpointSelectionDialog.VIEWPOINT_DIALOG_NAME).bot();
if (viewpointToSelect != null) {
Set<String> allSiriusNames = viewpointToSelect;
@@ -152,9 +145,9 @@
viewpointSelection.put(vpName, viewpointToSelect.contains(vpName));
}
if (!viewpointSelection.isEmpty()) {
- for (int rowPosition = 0; rowPosition < bot.table().rowCount(); rowPosition++) {
+ for (int rowPosition = 0; rowPosition < botSiriusSelection.table().rowCount(); rowPosition++) {
- final SWTBotTableItem item = bot.table().getTableItem(rowPosition);
+ final SWTBotTableItem item = botSiriusSelection.table().getTableItem(rowPosition);
final String text = item.getText(0);
if (viewpointSelection.containsKey(text)) {
@@ -162,13 +155,12 @@
viewpointSelection.remove(text);
}
}
- final SWTBotButton okButton = bot.button("OK");
+ final SWTBotButton okButton = botSiriusSelection.button("OK");
/*
- * There is an invalid selection ("Extension_A" requires
- * "Base"). Check that the 'OK' button is invalid.
+ * There is an invalid selection ("Extension_A" requires "Base"). Check that the 'OK' button is invalid.
*/
- bot.waitUntil(new DefaultCondition() {
+ botSiriusSelection.waitUntil(new DefaultCondition() {
@Override
public String getFailureMessage() {
@@ -185,14 +177,13 @@
}
/*
- * Check that the error message exists on the dialog. Throws a
- * WidgetNotFoundException if the message does not exist.
+ * Check that the error message exists on the dialog. Throws a WidgetNotFoundException if the message does not
+ * exist.
*/
- shellSiriussSelection.bot().text(" Extension_A requires: Base");
+ botSiriusSelection.text(" Extension_A requires: Base");
/*
- * We got the "error" message, now we complete the selection normally
- * and try to create a diagram.
+ * We got the "error" message, now we complete the selection normally and try to create a diagram.
*/
bot.button("Cancel").click();
session.changeViewpointSelection(new HashSet<String>(Arrays.asList("Base", "Extension_A")), Collections.<String> emptySet());
@@ -200,9 +191,8 @@
UIDiagramRepresentation diagram = session.newDiagramRepresentation("new " + DIAGRAM_NAME, DIAGRAM_NAME).on(mainPackage).withDefaultName().ok();
/*
- * The next line fails (with an NPE) if the bug in VP-2529 is present,
- * as the pseudo-editor which was opened shows an error message instead
- * of a real diagram.
+ * The next line fails (with an NPE) if the bug in VP-2529 is present, as the pseudo-editor which was opened
+ * shows an error message instead of a real diagram.
*/
diagram.getEditor();
session.closeAndDiscardChanges();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java
index d9defc8..b5939ee 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java
@@ -28,10 +28,11 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.view.SiriusOutlineView;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.junit.Assert;
@@ -106,8 +107,7 @@
}
/**
- * Ensures that label icon are correctly displayed when modifying the
- * preferences using API.
+ * Ensures that label icon are correctly displayed when modifying the preferences using API.
*/
public void testChangeHidingLabelIconsUsingAPI() {
// Test 1
@@ -155,8 +155,8 @@
}
/**
- * Ensures that label icon are correctly displayed when modifying the
- * preferences using API, faced to filters activations/deactivations.
+ * Ensures that label icon are correctly displayed when modifying the preferences using API, faced to filters
+ * activations/deactivations.
*/
public void testChangeLabelIconsHidingWithFilters() {
// We activate the oldUi to be able to active filters
@@ -181,8 +181,7 @@
}
/**
- * Ensures that label icon are correctly displayed when modifying the
- * preferences using Eclipse UI.
+ * Ensures that label icon are correctly displayed when modifying the preferences using Eclipse UI.
*/
public void testChangeLabelIconsHidingUsingPreferencesUI() {
@@ -237,15 +236,12 @@
}
/**
- * Ensures that label icons are correctly displayed according to the given
- * parameters.
+ * Ensures that label icons are correctly displayed according to the given parameters.
*
* @param hideLabelIconsForShapes
- * indicates if all label icons of shapes (node and containers)
- * should be hidden
+ * indicates if all label icons of shapes (node and containers) should be hidden
* @param hideLabelIconsForConnectors
- * indicates if all label icons of connectors (edges) should be
- * hidden
+ * indicates if all label icons of connectors (edges) should be hidden
*/
protected void checkLabelIconsAreCorrectlyDisplayed(boolean hideLabelIconsForShapes, boolean hideLabelIconsForConnectors) {
@@ -258,13 +254,11 @@
}
/**
- * Returns the current icon of the edit part with the given name (null if no
- * icon).
+ * Returns the current icon of the edit part with the given name (null if no icon).
*
* @param editPartName
* the name of the edit part
- * @return the current icon of the edit part with the given name (null if no
- * icon)
+ * @return the current icon of the edit part with the given name (null if no icon)
*/
private Image getLabelIconOfEditPart(String editPartName) {
// We must not call , that would recalculate the icon according to
@@ -280,15 +274,12 @@
}
/**
- * Changes the values of preferences related to label icons hiding using
- * standard API.
+ * Changes the values of preferences related to label icons hiding using standard API.
*
* @param hideLabelIconsForShapes
- * indicates if all label icons of shapes (node and containers)
- * should be hidden
+ * indicates if all label icons of shapes (node and containers) should be hidden
* @param hideLabelIconsForConnectors
- * indicates if all label icons of connectors (edges) should be
- * hidden
+ * indicates if all label icons of connectors (edges) should be hidden
*/
protected void changeHideLabeIconPreferencesUsingAPI(final boolean hideLabelIconsForShapes, final boolean hideLabelIconsForConnectors) {
UIThreadRunnable.syncExec(new VoidResult() {
@@ -302,57 +293,52 @@
}
/**
- * Changes the values of preferences related to label icons hiding using the
- * preferences UI.
+ * Changes the values of preferences related to label icons hiding using the preferences UI.
*
* @param hideLabelIconsForShapes
- * indicates if all label icons of shapes (node and containers)
- * should be hidden
+ * indicates if all label icons of shapes (node and containers) should be hidden
* @param hideLabelIconsForConnectors
- * indicates if all label icons of connectors (edges) should be
- * hidden
+ * indicates if all label icons of connectors (edges) should be hidden
*/
protected void changeHideLabelIconPreferences(boolean hideLabelIconsForShapes, boolean hideLabelIconsForConnectors) {
bot.menu("Window").menu("Preferences").click();
- bot.waitUntil(Conditions.shellIsActive("Preferences"));
- bot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select();
+ SWTBot preferenceBot = SWTBotSiriusHelper.getShellBot("Preferences");
+ preferenceBot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select();
if (hideLabelIconsForShapes) {
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select();
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select();
} else {
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect();
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect();
}
if (hideLabelIconsForConnectors) {
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select();
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select();
} else {
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect();
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect();
}
- bot.button(TestsUtil.isOxygenPlatform() ? JFaceResources.getString("PreferencesDialog.okButtonLabel") : IDialogConstants.OK_LABEL).click();
+ preferenceBot.button(TestsUtil.isOxygenPlatform() ? JFaceResources.getString("PreferencesDialog.okButtonLabel") : IDialogConstants.OK_LABEL).click();
}
/**
- * Tests that label incons hiding preferences are correctly displayed in the
- * preference UI.
+ * Tests that label incons hiding preferences are correctly displayed in the preference UI.
*
* @param expectedHideLabelIconsForShapes
* expected value for the hide label icons for shapes properties
* @param expectedHideLabelIconsForConnectors
- * expected value for the hide label icons for connectors
- * properties
+ * expected value for the hide label icons for connectors properties
*/
protected void checkHideLabelIconPreferences(boolean expectedHideLabelIconsForShapes, boolean expectedHideLabelIconsForConnectors) {
bot.menu("Window").menu("Preferences").click();
- bot.waitUntil(Conditions.shellIsActive("Preferences"));
- bot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select();
+ SWTBot preferenceBot = SWTBotSiriusHelper.getShellBot("Preferences");
+ preferenceBot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select();
Assert.assertEquals("Preference " + Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel + " has not expected value ", expectedHideLabelIconsForShapes,
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked());
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked());
Assert.assertEquals("Preference " + " Hide label icons on connectors" + " has not expected value ", expectedHideLabelIconsForConnectors,
- bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked());
- bot.shell("Preferences").close();
+ preferenceBot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked());
+ preferenceBot.shell("Preferences").close();
}
/**
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java
index b8ddb91..0dc99cf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014, 2018 Obeo.
+ * Copyright (c) 2014, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -12,9 +12,7 @@
*******************************************************************************/
package org.eclipse.sirius.tests.swtbot;
-import org.eclipse.sirius.tests.support.api.TestsUtil;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
-import org.eclipse.sirius.tests.swtbot.support.api.condition.TreeItemExpanded;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
@@ -79,17 +77,16 @@
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
// accesses to tab Meta-model
- SWTBotSiriusHelper.selectPropertyTabItem(METAMODELS);
+ SWTBotSiriusHelper.selectPropertyTabItem(METAMODELS, propertiesBot.bot());
checkMessageErrorLog();
}
/**
- * Check that the error message for invalid meta-model URI appears in the
- * "Error Log" view.
+ * Check that the error message for invalid meta-model URI appears in the "Error Log" view.
*/
private void checkMessageErrorLog() {
try {
- openErrorLogView();
+ openErrorLogViewByAPI();
SWTBotView logViewBot = bot.viewByPartName("Error Log");
assertTrue("Invalid Metamodel URI does not appear in the error log.", isMessageInErrorLog(logViewBot));
logViewBot.close();
@@ -100,23 +97,6 @@
}
/**
- * Open the error log view.
- */
- private void openErrorLogView() {
- bot.menu("Window").menu("Show View").menu("Other...").click();
- SWTBotTree viewsTreeBot = bot.tree();
- bot.text().setText("Error");
- SWTBotTreeItem expandNode = viewsTreeBot.expandNode("General");
- bot.waitUntil(new TreeItemExpanded(expandNode, expandNode.getText()));
- expandNode.getNode("Error Log").click();
- if (TestsUtil.isBeforeOxygenPlatform()) {
- bot.button("OK").click();
- } else {
- bot.button("Open").click();
- }
- }
-
- /**
* Check that the error message appears in the "Error Log" view.
*
* @param logViewBot
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LabelFieldTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LabelFieldTest.java
index 0c7eff5..caf3b73 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LabelFieldTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LabelFieldTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -18,13 +18,14 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.junit.Test;
/**
- * Test that label field was selected when user focus on. Test if user remove
- * label field when focus out the label field is fills with id field value.
+ * Test that label field was selected when user focus on. Test if user remove label field when focus out the label field
+ * is fills with id field value.
*
* @author jdupont
*/
@@ -88,20 +89,20 @@
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode(VIEWPOIT_NAME).select();
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// accesses to tab General
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
// access to label field
- labelText = bot.viewByTitle(PROPERTIES).bot().text(1);
+ labelText = propertiesView.bot().text(1);
// focus on label field
labelText.setFocus();
}
/**
- * Test that label field was removed if is same that id or selected
- * otherwise when user focus on.
+ * Test that label field was removed if is same that id or selected otherwise when user focus on.
*/
@Test
public void testSelectedLabelFieldOnFocus() {
@@ -117,8 +118,7 @@
}
/**
- * Test if user remove label field when focus out the label field is fills
- * with id field value.
+ * Test if user remove label field when focus out the label field is fills with id field value.
*/
public void testLabelFieldFillsIfEmpty() {
// remove label field value
@@ -138,6 +138,7 @@
* the name of viewpoint specification model (.odesing)
* @return odesignEditor
*/
+ @Override
public SWTBotVSMEditor openViewpointSpecificationModel(String viewpointSpecificationModel) {
SWTBotCommonHelper.openEditor(getProjectName(), viewpointSpecificationModel);
SWTBotVSMEditor odesignEditor = SWTBotVSMHelper.getVSMEditorContainingName(viewpointSpecificationModel);
@@ -154,8 +155,10 @@
*/
private boolean isFieldLabelAllCharacterSelected(SWTBotText label) {
RunnableWithResult<Boolean> runnable = new RunnableWithResult.Impl<Boolean>() {
+ @Override
public void run() {
labelText.widget.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
setResult(labelText.getText().length() != 0 && labelText.widget.getSelectionCount() == labelText.getText().length());
}
@@ -163,7 +166,7 @@
}
};
labelText.widget.getDisplay().syncExec(runnable);
- return ((Boolean) runnable.getResult()).booleanValue();
+ return runnable.getResult().booleanValue();
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LineStyleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LineStyleTest.java
index 0e51602..6020113 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LineStyleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LineStyleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2018 Obeo.
+ * Copyright (c) 2015, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -45,6 +45,7 @@
import org.eclipse.sirius.viewpoint.Customizable;
import org.eclipse.sirius.viewpoint.Style;
import org.eclipse.swt.SWT;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
@@ -92,8 +93,7 @@
}
/**
- * Ensure that the border line style of nodes and containers is correctly
- * updated from the property section.
+ * Ensure that the border line style of nodes and containers is correctly updated from the property section.
*/
public void testContainerBorderLineStyleCustomization() {
for (DDiagramElementContainer container : ((DDiagram) editor.getDRepresentation()).getContainers()) {
@@ -102,8 +102,7 @@
}
/**
- * Ensure that the border line style of nodes and containers is correctly
- * updated from the property section.
+ * Ensure that the border line style of nodes and containers is correctly updated from the property section.
*/
public void testNodeBorderLineStyleCustomization() {
for (DNode node : ((DDiagram) editor.getDRepresentation()).getNodes()) {
@@ -112,8 +111,7 @@
}
/**
- * Ensure that the line style of edge is correctly updated from the property
- * section.
+ * Ensure that the line style of edge is correctly updated from the property section.
*/
public void testEdgeLineStyleCustomization() {
for (DEdge edge : ((DDiagram) editor.getDRepresentation()).getEdges()) {
@@ -139,9 +137,8 @@
}
/**
- * Ensure that the border line style of nodes and containers and the line
- * style of edges are correctly updated from a description change
- * (activation of layer triggering a style customization).
+ * Ensure that the border line style of nodes and containers and the line style of edges are correctly updated from
+ * a description change (activation of layer triggering a style customization).
*/
public void testLineStyleUpdateFromDescriptionChange() {
// Activate Dot layer
@@ -249,17 +246,18 @@
private void changeLineStyle(LineStyle lineStyle, boolean edge) {
ICondition done = new OperationDoneCondition();
- bot.viewByTitle(PROPERTIES).setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(STYLE);
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem(STYLE, propertiesView.bot());
SWTBotTreeItem style;
- SWTBotTree propertiesTree = bot.viewByTitle(PROPERTIES).bot().tree(0);
+ SWTBotTree propertiesTree = propertiesView.bot().tree(0);
if (edge) {
style = propertiesTree.getTreeItem("General").expand().getNode("Line Style");
} else {
style = propertiesTree.getTreeItem("Border").expand().getNode("Border Line Style");
}
style.click();
- SWTBotCCombo lineStyleCombo = bot.viewByTitle(PROPERTIES).bot().ccomboBox();
+ SWTBotCCombo lineStyleCombo = propertiesView.bot().ccomboBox();
lineStyleCombo.setFocus();
lineStyleCombo.setSelection(lineStyle.getName());
// In photon we need to press ENTER to leave the combo
@@ -267,7 +265,7 @@
lineStyleCombo.pressShortcut(Keystrokes.CR);
}
// apply change with change focus
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesView.bot());
bot.waitUntil(done);
editor.setFocus();
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedAppearanceTabTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedAppearanceTabTest.java
index 296600e..9439568 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedAppearanceTabTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedAppearanceTabTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Obeo.
+ * Copyright (c) 2014, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
@@ -34,8 +35,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToggleButton;
/**
- * Ensure that when DDiagram is locked by using a permission authority all
- * actions are disabled in the appearance tab of the property view.
+ * Ensure that when DDiagram is locked by using a permission authority all actions are disabled in the appearance tab of
+ * the property view.
*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=444267
*
@@ -79,8 +80,8 @@
}
/**
- * Check that actions in the appearance tab of the property view are enabled
- * or disabled depending on the permission authority.
+ * Check that actions in the appearance tab of the property view are enabled or disabled depending on the permission
+ * authority.
*/
public void testActionsEnablement() {
// check that tested actions are enabled for the diagram
@@ -164,8 +165,8 @@
}
/**
- * Check that widgets should be enabled depending on the parameter. Theses
- * widgets are available when the diagram is selected.
+ * Check that widgets should be enabled depending on the parameter. Theses widgets are available when the diagram is
+ * selected.
*
* @param enabled
* true if widgets should be enabled
@@ -177,8 +178,8 @@
}
/**
- * Check that widgets should be enabled depending on the parameter. Theses
- * widgets are available when there is a selection.
+ * Check that widgets should be enabled depending on the parameter. Theses widgets are available when there is a
+ * selection.
*
* @param enabled
* true if widgets should be enabled
@@ -203,9 +204,10 @@
* true if widgets should be enabled
*/
private void checkActionEnabled(int nbPushButtons, int nbToogleButtons, int nbCombos, boolean enabled) {
- SWTBot propertiesBot = bot.viewByTitle("Properties").bot();
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ SWTBot propertiesBot = propertiesView.bot();
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
// Push buttons
for (int i = 0; i < nbPushButtons; i++) {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NavigateToNewRepresentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NavigateToNewRepresentationTest.java
index ce682fc..0f67d9f 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NavigateToNewRepresentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NavigateToNewRepresentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,8 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
/**
@@ -89,7 +91,8 @@
SWTBotPreferences.TIMEOUT = 1000;
editor.click(65, 40);
editor.clickContextMenu(EXPECTED_NEW_REPRESENTATION_NAME);
- bot.button("OK").click();
+ SWTBot representationBot = SWTBotSiriusHelper.getShellBot("New VP-1737.2");
+ representationBot.button("OK").click();
assertEditorIsNotError("Right click New representation editor did not opened correctly", bot.activeEditor());
assertEquals("The active editor is not the one expected", EXPECTED_NEW_REPRESENTATION_INSTANCE_NAME, bot.activeEditor().getTitle());
} finally {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NoteCreationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NoteCreationTest.java
index 3acc709..935bfaf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NoteCreationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NoteCreationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -48,6 +48,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.view.DesignerViews;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.ui.business.api.session.SessionEditorInput;
@@ -55,6 +56,7 @@
import org.eclipse.sirius.viewpoint.description.Viewpoint;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.ui.PartInitException;
@@ -567,8 +569,9 @@
private void selectTargetRepresentation(DRepresentationDescriptor link) {
Viewpoint vp = (Viewpoint) link.getDescription().eContainer();
int size = DialectManager.INSTANCE.getRepresentations(link.getDescription(), localSession.getOpenedSession()).size();
- bot.tree().expandNode(vp.getName(), link.getDescription().getName() + " (" + size + ")").getNode(link.getName()).select();
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Select representation");
+ wizardBot.tree().expandNode(vp.getName(), link.getDescription().getName() + " (" + size + ")").getNode(link.getName()).select();
+ wizardBot.button("OK").click();
}
// doubleclick should open the editor for the targeted representation
@@ -601,8 +604,8 @@
validateLinkDoubleclick(link);
/*
- * Now change the target representation to something else. This
- * loses the selection, so select the note again afterwards
+ * Now change the target representation to something else. This loses the selection, so select the note
+ * again afterwards
*/
DRepresentationDescriptor otherLink = getOtherLinkTarget(link);
editor.clickContextMenu(SET_TARGET_REPRESENTATION);
@@ -621,8 +624,7 @@
note = editor.getEditPart(MY_NOTE).parent().select();
/*
- * Rename the target representation, this should update the note
- * header label
+ * Rename the target representation, this should update the note header label
*/
TransactionalEditingDomain ted = localSession.getOpenedSession().getTransactionalEditingDomain();
ted.getCommandStack().execute(new RenameRepresentationCommand(ted, link, LINK_TARGET_NEW_NAME));
@@ -828,9 +830,8 @@
}
/**
- * Check that the note is near the expected location. We don't check
- * precisely the location because the zoom can have round effect on the
- * location.
+ * Check that the note is near the expected location. We don't check precisely the location because the zoom can
+ * have round effect on the location.
*
* @param excpectedLocation
* the absolute position within the graphical viewer
@@ -844,8 +845,7 @@
}
/**
- * Possibility to adapt the expected location according to some parameters
- * (snap to grid, ...).
+ * Possibility to adapt the expected location according to some parameters (snap to grid, ...).
*
* @param expectedLocation
* The initial expected location
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/OpenDiagramWithExceptionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/OpenDiagramWithExceptionTest.java
index 4508de0..1177791 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/OpenDiagramWithExceptionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/OpenDiagramWithExceptionTest.java
@@ -15,9 +15,9 @@
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys;
import org.eclipse.sirius.viewpoint.DRepresentation;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
/**
@@ -49,7 +49,6 @@
private static final String REPRESENTATION_NAME2 = "new " + DESC_NAME2;
-
/**
* Make sure that when a {@link ClassCastException} occurs while opening a diagram (because of an unsynchronized
* issue between GMF and Sirius model), the dialog asking for refreshing the editor is open and when accepting, the
@@ -102,8 +101,7 @@
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), descName, representationName, DDiagram.class);
});
thread.start();
- bot.waitUntil(Conditions.shellIsActive("Refresh the diagram"));
- bot.activeShell().bot().button("OK").click();
+ SWTBotSiriusHelper.getShellBot("Refresh the diagram").button("OK").click();
bot.waitUntil(new DefaultCondition() {
@Override
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/PortsOnNodePositionStabilityTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/PortsOnNodePositionStabilityTest.java
index d8eef68..c73c73d 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/PortsOnNodePositionStabilityTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/PortsOnNodePositionStabilityTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -1271,8 +1271,7 @@
}
/**
- * Test that when a label size become high the label is relocated in another
- * side.
+ * Test that when a label size become high the label is relocated in another side.
*/
public void test_DNode4EditPart_LabelSizeIncrease() {
SWTBotGefEditPart borderEditPart = editor.getEditPart("DN2EP_on_DN2EP_a", AbstractDiagramBorderNodeEditPart.class);
@@ -1285,7 +1284,7 @@
editor.restore();
SWTBotView propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesBot.bot());
propertiesBot.bot().ccomboBox(1).setSelection("72");
SWTBotUtils.waitAllUiEvents();
@@ -1306,8 +1305,7 @@
/*
* (non-Javadoc)
- * @see org.eclipse.sirius.tests.swtbot.support.api.
- * AbstractSiriusSwtBotGefTestCase#tearDown()
+ * @see org.eclipse.sirius.tests.swtbot.support.api. AbstractSiriusSwtBotGefTestCase#tearDown()
*/
@Override
protected void tearDown() throws Exception {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ReconnectEdgeWithChangedRoutingStyleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ReconnectEdgeWithChangedRoutingStyleTest.java
index a0dba12..31d866f 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ReconnectEdgeWithChangedRoutingStyleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ReconnectEdgeWithChangedRoutingStyleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -45,8 +45,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
/**
- * Test a reconnect edge with change edge routing style. By default the routing
- * style is Rectilinear Style Routing. Test VP-2954 and VP-3047.
+ * Test a reconnect edge with change edge routing style. By default the routing style is Rectilinear Style Routing. Test
+ * VP-2954 and VP-3047.
*
* @author jdupont
*/
@@ -96,9 +96,8 @@
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_NAME, DDiagram.class);
/*
- * Force the addition of a dependency to the sample ecore editor
- * otherwise the interpreter has no way to retrieve the service class
- * hence any call to "render()" will fail.
+ * Force the addition of a dependency to the sample ecore editor otherwise the interpreter has no way to
+ * retrieve the service class hence any call to "render()" will fail.
*/
localSession.getOpenedSession().getInterpreter().setProperty(IInterpreter.FILES, Collections.singleton("/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign"));
}
@@ -108,12 +107,9 @@
* <ol>
* <li>Step 1 : select edge [0..1] ref3-1 between EClass 3 and ECLass 2</li>
* <li>Step 2 : Check that routing style is Tree</li>
- * <li>Step 3 : Change routing style to Straight from tab Style of
- * Properties view</li>
- * <li>Step 4 : Reconnect edge to EClass 4 and check that routing style is
- * always Straight</li>
- * <li>Step 5 : Reconnect edge to EClass 3 and check that routing style is
- * always Straight</li>
+ * <li>Step 3 : Change routing style to Straight from tab Style of Properties view</li>
+ * <li>Step 4 : Reconnect edge to EClass 4 and check that routing style is always Straight</li>
+ * <li>Step 5 : Reconnect edge to EClass 3 and check that routing style is always Straight</li>
* </ol>
*/
public void testReconnectEdgeWithChangingRoutingStyleFromStyleView() {
@@ -156,12 +152,9 @@
* <ol>
* <li>Step 1 : select edge [0..1] ref3-1 between EClass 3 and ECLass 2</li>
* <li>Step 2 : Check that routing style is Tree</li>
- * <li>Step 3 : Change routing style to Straight from tab Appearance of
- * Properties view</li>
- * <li>Step 4 : Reconnect edge to EClass 4 and check that routing style is
- * always Straight</li>
- * <li>Step 5 : Reconnect edge to EClass 3 and check that routing style is
- * always Straight</li>
+ * <li>Step 3 : Change routing style to Straight from tab Appearance of Properties view</li>
+ * <li>Step 4 : Reconnect edge to EClass 4 and check that routing style is always Straight</li>
+ * <li>Step 5 : Reconnect edge to EClass 3 and check that routing style is always Straight</li>
* </ol>
*/
public void testReconnectEdgeWithChangingRoutingStyleFromAppearanceView() {
@@ -223,7 +216,7 @@
SWTBotUtils.waitAllUiEvents();
propertiesBot.setFocus();
// accesses to tab Style
- SWTBotSiriusHelper.selectPropertyTabItem(STYLE);
+ SWTBotSiriusHelper.selectPropertyTabItem(STYLE, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
// select routing syle Straight in combo
tree.expandNode("Misc").select().getNode("Routing Style").doubleClick();
@@ -232,7 +225,7 @@
comboBox.setSelection(routingStyleLitteral);
// applied change with change focus
tree.expandNode("Misc").click();
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesBot.bot());
checkRoutingStyleInAppearance();
checkRoutingStyle(routingStyle, dedge);
@@ -244,11 +237,11 @@
SWTBotUtils.waitAllUiEvents();
propertiesBot.setFocus();
// accesses to tab Style
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesBot.bot());
assertEquals("The 'Tree' style should be selected", true, bot.viewByTitle(PROPERTIES).bot().radioInGroup("Tree", STYLES).isSelected());
new WrappedSWTBotRadio(bot.viewByTitle(PROPERTIES).bot().radioInGroup("Oblique", STYLES)).click();
// applied change with change focus
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesBot.bot());
checkRoutingStyleInAppearance();
checkRoutingStyle(routingStyle, dedge);
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RefreshWithCustomizedStyleTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RefreshWithCustomizedStyleTests.java
index 3ca14c1..77243f5 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RefreshWithCustomizedStyleTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RefreshWithCustomizedStyleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -393,12 +393,13 @@
public void testLabelSizeCustomization() throws Exception {
editor.select(eClass1WithSquareStyleBot);
// set the focus on the Properties view
+ final SWTBot propertiesBot = bot.viewByTitle(PROPERTIES).bot();
bot.viewByTitle(PROPERTIES).setFocus();
// set the focus on the Style tab
- SWTBotSiriusHelper.selectPropertyTabItem(STYLE);
+ SWTBotSiriusHelper.selectPropertyTabItem(STYLE, propertiesBot);
// Access the Label Size field
- final SWTBot propertiesBot = bot.viewByTitle(PROPERTIES).bot();
+
SWTBotTree tree = propertiesBot.tree();
tree.expandNode("Misc").select().getNode("Label Size").select().click();
SWTBotText text = propertiesBot.text();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RemovedDefaultColorMenuTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RemovedDefaultColorMenuTest.java
index a1a5e0a..ae891c5 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RemovedDefaultColorMenuTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RemovedDefaultColorMenuTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -31,14 +31,15 @@
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckSelectedCondition;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton;
/**
- * Test the default color menu was removed from Contextual menu, property view
- * appearance and toolbar. Test for ticket vp-1701.
+ * Test the default color menu was removed from Contextual menu, property view appearance and toolbar. Test for ticket
+ * vp-1701.
*
* @author jdupont
*/
@@ -115,9 +116,8 @@
sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE);
localSession = designerPerspective.openSessionFromFile(sessionAirdResource);
/*
- * Force the addition of a dependency to the sample ecore editor
- * otherwise the interpreter has no way to retrieve the service class
- * hence any call to "render()" will fail.
+ * Force the addition of a dependency to the sample ecore editor otherwise the interpreter has no way to
+ * retrieve the service class hence any call to "render()" will fail.
*/
localSession.getOpenedSession().getInterpreter().setProperty(IInterpreter.FILES, Collections.singleton("/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign"));
@@ -125,8 +125,8 @@
}
/**
- * Test no default color menu in contextual menu from a container mapping.
- * Test no default color menu from fill color, font color and line color.
+ * Test no default color menu in contextual menu from a container mapping. Test no default color menu from fill
+ * color, font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromContainerMapping() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
@@ -139,8 +139,8 @@
}
/**
- * Test no default color menu in contextual menu from a container 2 mapping.
- * Test no default color menu from fill color, font color and line color.
+ * Test no default color menu in contextual menu from a container 2 mapping. Test no default color menu from fill
+ * color, font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromContainer2Mapping() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
@@ -153,8 +153,8 @@
}
/**
- * Test no default color menu in contextual menu from a node 3 mapping. Test
- * no default color menu from fill color, font color and line color.
+ * Test no default color menu in contextual menu from a node 3 mapping. Test no default color menu from fill color,
+ * font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromNode3Mapping() {
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
@@ -167,8 +167,8 @@
}
/**
- * Test no default color menu in contextual menu from a node 2 mapping. Test
- * no default color menu from fill color, font color and line color.
+ * Test no default color menu in contextual menu from a node 2 mapping. Test no default color menu from fill color,
+ * font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromNode2Mapping() {
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
@@ -181,8 +181,8 @@
}
/**
- * Test no default color menu in contextual menu from a node mapping. Test
- * no default color menu from fill color, font color and line color.
+ * Test no default color menu in contextual menu from a node mapping. Test no default color menu from fill color,
+ * font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromNodeMapping() {
selectAndCheckEditPart(NODE, DNodeEditPart.class);
@@ -195,9 +195,8 @@
}
/**
- * Test no default color menu in contextual menu from a relation base edge
- * mapping. Test no default color menu from fill color, font color and line
- * color.
+ * Test no default color menu in contextual menu from a relation base edge mapping. Test no default color menu from
+ * fill color, font color and line color.
*/
public void testNoDefaulColortMenuInContextualMenuRelationBaseEdgeMapping() {
selectAndCheckEditPart(SUPER, DEdgeEditPart.class);
@@ -210,9 +209,8 @@
}
/**
- * Test no default color menu in contextual menu from a element base edge
- * mapping. Test no default color menu from fill color, font color et line
- * color.
+ * Test no default color menu in contextual menu from a element base edge mapping. Test no default color menu from
+ * fill color, font color et line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromElementBaseEdgeMapping() {
selectAndCheckEditPart(REF, DEdgeEditPart.class);
@@ -225,9 +223,8 @@
}
/**
- * Test no default color menu in contextual menu from a bordered node
- * mapping. Test no default color menu from fill color, font color et line
- * color.
+ * Test no default color menu in contextual menu from a bordered node mapping. Test no default color menu from fill
+ * color, font color et line color.
*/
public void testNoDefaulColortMenuInContextualMenuFromBorderedNodeMapping() {
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
@@ -240,8 +237,7 @@
}
/**
- * Test no default color menu in tool bar from a container mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a container mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromContainerMappingFontColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
@@ -256,8 +252,7 @@
}
/**
- * Test no default color menu in tool bar from a container mapping. Test no
- * default color menu from line color.
+ * Test no default color menu in tool bar from a container mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInToolBarFromContainerMappingLineColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
@@ -272,8 +267,7 @@
}
/**
- * Test no default color menu in tool bar from a container mapping. Test no
- * default color menu from fill color.
+ * Test no default color menu in tool bar from a container mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromContainerMappingFillColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
@@ -288,8 +282,7 @@
}
/**
- * Test no default color menu in tool bar from a container 2 mapping. Test
- * no default color menu from fill color.
+ * Test no default color menu in tool bar from a container 2 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromContainer2MappingFillColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
@@ -304,8 +297,7 @@
}
/**
- * Test no default color menu in tool bar from a container 2 mapping. Test
- * no default color menu from font color.
+ * Test no default color menu in tool bar from a container 2 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromContainer2MappingFontColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
@@ -320,8 +312,7 @@
}
/**
- * Test no default color menu in tool bar from a container 2 mapping. Test
- * no default color menu from line color.
+ * Test no default color menu in tool bar from a container 2 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInToolBarFromContainer2MappingLineColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
@@ -336,8 +327,7 @@
}
/**
- * Test no default color menu in tool bar from a node 3 mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a node 3 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromNode3MappingFontColor() {
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
@@ -352,8 +342,7 @@
}
/**
- * Test no default color menu in tool bar from a node 3 mapping. Test no
- * default color menu from line color.
+ * Test no default color menu in tool bar from a node 3 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInToolBarFromNode3MappingLineColor() {
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
@@ -368,8 +357,7 @@
}
/**
- * Test no default color menu in tool bar from a node 3 mapping. Test no
- * default color menu from fill color.
+ * Test no default color menu in tool bar from a node 3 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromNode3MappingFillColor() {
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
@@ -384,8 +372,7 @@
}
/**
- * Test no default color menu in tool bar from a node mapping. Test no
- * default color menu from fill color.
+ * Test no default color menu in tool bar from a node mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromNodeMappingFillColor() {
selectAndCheckEditPart(NODE, DNodeEditPart.class);
@@ -400,8 +387,7 @@
}
/**
- * Test no default color menu in tool bar from a node mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a node mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromNodeMappingFontColor() {
selectAndCheckEditPart(NODE, DNodeEditPart.class);
@@ -416,8 +402,7 @@
}
/**
- * Test no default color menu in tool bar from a node mapping. Test no
- * default color menu from line color.
+ * Test no default color menu in tool bar from a node mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInToolBarFromNodeMappingLineColor() {
selectAndCheckEditPart(NODE, DNodeEditPart.class);
@@ -432,8 +417,7 @@
}
/**
- * Test no default color menu in tool bar from a node 2 mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a node 2 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromNode2MappingFontColor() {
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
@@ -448,8 +432,7 @@
}
/**
- * Test no default color menu in tool bar from a node 2 mapping. Test no
- * default color menu from fill color.
+ * Test no default color menu in tool bar from a node 2 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromNode2MappingFillColor() {
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
@@ -464,8 +447,7 @@
}
/**
- * Test no default color menu in tool bar from a node 2 mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a node 2 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromNode2MappingLineColor() {
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
@@ -480,8 +462,8 @@
}
/**
- * Test no default color menu in tool bar from a relation base edge mapping.
- * Test no default color menu from line color.
+ * Test no default color menu in tool bar from a relation base edge mapping. Test no default color menu from line
+ * color.
*/
public void testNoDefaulColortMenuInToolBarFromRelationBaseEdgeMappingFontColor() {
selectAndCheckEditPart(REF, DEdgeEditPart.class);
@@ -496,8 +478,8 @@
}
/**
- * Test no default color menu in tool bar from a relation base edge mapping.
- * Test no default color menu from font color.
+ * Test no default color menu in tool bar from a relation base edge mapping. Test no default color menu from font
+ * color.
*/
public void testNoDefaulColortMenuInToolBarFromRelationBaseEdgeMappingLineColor() {
selectAndCheckEditPart(REF, DEdgeEditPart.class);
@@ -511,8 +493,7 @@
}
/**
- * Test no default color menu in tool bar from a node 4 mapping. Test no
- * default color menu from font color.
+ * Test no default color menu in tool bar from a node 4 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInToolBarFromBorderedNodeMappingFontColor() {
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
@@ -527,8 +508,7 @@
}
/**
- * Test no default color menu in tool bar from a node 4 mapping. Test no
- * default color menu from fill color.
+ * Test no default color menu in tool bar from a node 4 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInToolBarFromBorderedNodeMappingFillColor() {
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
@@ -543,8 +523,7 @@
}
/**
- * Test no default color menu in tool bar from a node 4 mapping. Test no
- * default color menu from line color.
+ * Test no default color menu in tool bar from a node 4 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInToolBarFromBorderedNodeMappingLineColor() {
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
@@ -559,15 +538,16 @@
}
/**
- * Test no default color menu in contextual menu from a container mapping.
- * Test no default color menu from font color.
+ * Test no default color menu in contextual menu from a container mapping. Test no default color menu from font
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainerMappingFontColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
- bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
+ propertiesView.bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
} catch (WidgetNotFoundException e) {
// Expected exception, do nothing.
@@ -575,13 +555,14 @@
}
/**
- * Test no default color menu in contextual menu from a container mapping.
- * Test no default color menu from line color.
+ * Test no default color menu in contextual menu from a container mapping. Test no default color menu from line
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainerMappingLineColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -591,13 +572,14 @@
}
/**
- * Test no default color menu in contextual menu from a container mapping.
- * Test no default color menu from fill color.
+ * Test no default color menu in contextual menu from a container mapping. Test no default color menu from fill
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainerMappingFillColor() {
selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -607,13 +589,14 @@
}
/**
- * Test no default color menu in contextual menu from a container 2 mapping.
- * Test no default color menu from font color.
+ * Test no default color menu in contextual menu from a container 2 mapping. Test no default color menu from font
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainer2MappingFontColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -623,13 +606,14 @@
}
/**
- * Test no default color menu in contextual menu from a container 2 mapping.
- * Test no default color menu from line color.
+ * Test no default color menu in contextual menu from a container 2 mapping. Test no default color menu from line
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainer2MappingLineColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -639,16 +623,17 @@
}
/**
- * Test no default color menu in contextual menu from a container 2 mapping.
- * Test no default color menu from fill color.
+ * Test no default color menu in contextual menu from a container 2 mapping. Test no default color menu from fill
+ * color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainer2MappingFillColor() {
selectAndCheckEditPart(NODE_CONTAINER2, DNodeContainer2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
SWTBotPreferences.TIMEOUT = 1000;
- bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
+ propertiesView.bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
} catch (WidgetNotFoundException e) {
// Expected exception, do nothing.
@@ -658,13 +643,13 @@
}
/**
- * Test no default color menu in contextual menu from a node mapping. Test
- * no default color menu from font color.
+ * Test no default color menu in contextual menu from a node mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNodeMappingFontColor() {
selectAndCheckEditPart(NODE, DNodeEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
SWTBotPreferences.TIMEOUT = 1000;
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
@@ -677,14 +662,14 @@
}
/**
- * Test no default color menu in contextual menu from a node mapping. Test
- * no default color menu from line color.
+ * Test no default color menu in contextual menu from a node mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNodeMappingLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE, DNodeEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -696,14 +681,14 @@
}
/**
- * Test no default color menu in contextual menu from a node mapping. Test
- * no default color menu from fill color.
+ * Test no default color menu in contextual menu from a node mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNodeMappingFillColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE, DNodeEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -715,14 +700,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 2 mapping. Test
- * no default color menu from font color.
+ * Test no default color menu in contextual menu from a node 2 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode2MappingFontColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -734,14 +719,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 2 mapping. Test
- * no default color menu from line color.
+ * Test no default color menu in contextual menu from a node 2 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode2MappingLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -753,14 +738,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 2 mapping. Test
- * no default color menu from fill color.
+ * Test no default color menu in contextual menu from a node 2 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode2MappingFillColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE2, DNode2EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -772,14 +757,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 3 mapping. Test
- * no default color menu from font color.
+ * Test no default color menu in contextual menu from a node 3 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode3MappingFontColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -791,14 +776,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 3 mapping. Test
- * no default color menu from line color.
+ * Test no default color menu in contextual menu from a node 3 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode3MappingLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -810,14 +795,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 3 mapping. Test
- * no default color menu from fill color.
+ * Test no default color menu in contextual menu from a node 3 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode3MappingFillColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE3, DNode3EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -829,14 +814,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 4 mapping. Test
- * no default color menu from font color.
+ * Test no default color menu in contextual menu from a node 4 mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode4MappingFontColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -848,14 +833,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 4 mapping. Test
- * no default color menu from line color.
+ * Test no default color menu in contextual menu from a node 4 mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode4MappingLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -867,14 +852,14 @@
}
/**
- * Test no default color menu in contextual menu from a node 4 mapping. Test
- * no default color menu from fill color.
+ * Test no default color menu in contextual menu from a node 4 mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromNode4MappingFillColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(NODE4, DNode4EditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -886,14 +871,15 @@
}
/**
- * Test no default color menu in contextual menu from a Relation based edge
- * mapping. Test no default color menu from font color.
+ * Test no default color menu in contextual menu from a Relation based edge mapping. Test no default color menu from
+ * font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewRelationBaseEdgeMappingFontColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(REF, DEdgeEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -905,14 +891,15 @@
}
/**
- * Test no default color menu in contextual menu from a Relation based edge
- * mapping. Test no default color menu from line color.
+ * Test no default color menu in contextual menu from a Relation based edge mapping. Test no default color menu from
+ * line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewRelationBaseEdgeMappingLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
selectAndCheckEditPart(REF, DEdgeEditPart.class);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -924,15 +911,15 @@
}
/**
- * Test no default color menu in contextual menu from a Diagram mapping.
- * Test no default color menu from font color.
+ * Test no default color menu in contextual menu from a Diagram mapping. Test no default color menu from font color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromDiagramFontColor() {
SWTBotPreferences.TIMEOUT = 1000;
editor.setFocus();
editor.click(1, 1);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -944,15 +931,15 @@
}
/**
- * Test no default color menu in contextual menu from a Diagram mapping.
- * Test no default color menu from line color.
+ * Test no default color menu in contextual menu from a Diagram mapping. Test no default color menu from line color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromDiagramLineColor() {
SWTBotPreferences.TIMEOUT = 1000;
editor.setFocus();
editor.click(1, 1);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 1).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -964,15 +951,15 @@
}
/**
- * Test no default color menu in contextual menu from a Diagram mapping.
- * Test no default color menu from fill color.
+ * Test no default color menu in contextual menu from a Diagram mapping. Test no default color menu from fill color.
*/
public void testNoDefaulColortMenuInAppearancePropertyViewFromDiagramFillColor() {
SWTBotPreferences.TIMEOUT = 1000;
editor.setFocus();
editor.click(1, 1);
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesView.bot());
try {
bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 2).click().contextMenu(DEFAULT_COLOR);
fail();
@@ -994,4 +981,4 @@
return botPart;
}
-}
\ No newline at end of file
+}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
index 93a532f..317096c 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -30,8 +30,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton;
/**
- * Test that the action "Reset style properties to default values" is refreshed
- * in tabbar when style is changed. Test VP-3449.
+ * Test that the action "Reset style properties to default values" is refreshed in tabbar when style is changed. Test
+ * VP-3449.
*
* @author jdupont
*/
@@ -81,8 +81,8 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on Fill Color in tabbar for a list container.
+ * Test refresh "Reset style properties to default values" button after click on Fill Color in tabbar for a list
+ * container.
*/
public void testRefreshActionCancelCustomStyleTabbarForListContainer() {
selectAndCheckEditPart(C1, AbstractDiagramListEditPart.class);
@@ -102,8 +102,8 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on Fill Color in tabbar for a Container.
+ * Test refresh "Reset style properties to default values" button after click on Fill Color in tabbar for a
+ * Container.
*/
public void testRefreshActionCancelCustomStyleTabbarForContainer() {
selectAndCheckEditPart(P1, AbstractDiagramContainerEditPart.class);
@@ -123,8 +123,7 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on bold button in tabbar for an edge.
+ * Test refresh "Reset style properties to default values" button after click on bold button in tabbar for an edge.
*/
public void _testRefreshActionCancelCustomStyleTabbarForEdgeWithBoldFontStyle() {
selectAndCheckEditPart(REF1, AbstractDiagramEdgeEditPart.class);
@@ -147,8 +146,7 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on Line Color in tabbar for an edge.
+ * Test refresh "Reset style properties to default values" button after click on Line Color in tabbar for an edge.
*/
public void testRefreshActionCancelCustomStyleTabbarForEdgeWithLineColor() {
selectAndCheckEditPart(REF1, AbstractDiagramEdgeEditPart.class);
@@ -168,8 +166,8 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on Style in properties view Appearance for an edge.
+ * Test refresh "Reset style properties to default values" button after click on Style in properties view Appearance
+ * for an edge.
*/
public void testRefreshActionCancelCustomStylePropertiesViewForEdge() {
selectAndCheckEditPart(REF1, AbstractDiagramEdgeEditPart.class);
@@ -192,8 +190,8 @@
}
/**
- * Test refresh "Reset style properties to default values" button after
- * click on Fill Color on contextual menu for a list Container.
+ * Test refresh "Reset style properties to default values" button after click on Fill Color on contextual menu for a
+ * list Container.
*/
public void testRefreshActionCancelCustomStyleContextualMenuForListContainer() {
selectAndCheckEditPart(C1, AbstractDiagramListEditPart.class);
@@ -234,7 +232,7 @@
SWTBotView propertiesView = bot.viewByTitle("Properties");
propertiesView.setFocus();
SWTBot propertiesBot = propertiesView.bot();
- SWTBotSiriusHelper.selectPropertyTabItem("Appearance");
+ SWTBotSiriusHelper.selectPropertyTabItem("Appearance", propertiesBot);
return propertiesBot;
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RoutingStyleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RoutingStyleTest.java
index fcac816..97def11 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RoutingStyleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/RoutingStyleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.widget.WrappedSWTBotRadio;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton;
@@ -102,8 +103,7 @@
}
/**
- * Test the routing style UI with a selection that does not contain only
- * edges.
+ * Test the routing style UI with a selection that does not contain only edges.
*
* @throws Exception
* Test error.
@@ -134,10 +134,11 @@
if (checkPropertiesView) {
// select the routing style with properties view
- bot.viewByTitle(PROPERTIES).setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE);
- new WrappedSWTBotRadio(bot.viewByTitle(PROPERTIES).bot().radioInGroup("Tree", STYLES)).click();
- new WrappedSWTBotRadio(bot.viewByTitle(PROPERTIES).bot().radioInGroup("Oblique", STYLES)).click();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem(APPEARANCE, propertiesView.bot());
+ new WrappedSWTBotRadio(propertiesView.bot().radioInGroup("Tree", STYLES)).click();
+ new WrappedSWTBotRadio(propertiesView.bot().radioInGroup("Oblique", STYLES)).click();
}
// select the routing style with the diagram menu
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SVGImageBundleTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SVGImageBundleTest.java
index ab11c4b..78be0bf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SVGImageBundleTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SVGImageBundleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -184,8 +184,7 @@
}
/**
- * Check that the node is a Bundled image description and the shape
- * corresponding to shape pass in parameters.
+ * Check that the node is a Bundled image description and the shape corresponding to shape pass in parameters.
*
* @param name
* the name of edit part
@@ -228,8 +227,8 @@
}
/**
- * Change property node class corresponding to name parameters, to abstract.
- * This change causes the modification shape to ellipse
+ * Change property node class corresponding to name parameters, to abstract. This change causes the modification
+ * shape to ellipse
*
* @param name
* the name of edit part
@@ -238,7 +237,7 @@
selectAndcheckEditPart(name, AbstractDiagramNodeEditPart.class);
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC);
+ SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode("Class1 -> Class2").select().getNode("Abstract").doubleClick();
if (TestsUtil.isPhotonPlatformOrLater()) {
@@ -266,7 +265,7 @@
private void modifyVSM(String oldShape, String shape) {
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesBot.bot());
try {
SWTBotCombo comboBox = propertiesBot.bot().comboBox(oldShape);
comboBox.setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SecurityExceptionPopupTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SecurityExceptionPopupTest.java
index beb4acf..08d3889 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SecurityExceptionPopupTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SecurityExceptionPopupTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2016, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,13 +16,13 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.sirius.tests.SiriusTestsPlugin;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
-import org.eclipse.sirius.tests.swtbot.support.api.condition.ShellChangedCondition;
+import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
/**
- * This test checks that the securityException opens a popup only in the case of
- * a nonempty message.
+ * This test checks that the securityException opens a popup only in the case of a nonempty message.
*
* @author Florian Barbin
*
@@ -30,16 +30,14 @@
public class SecurityExceptionPopupTest extends AbstractSiriusSwtBotGefTestCase {
/**
- * Logs a SecurityException with a message and makes sure the pop-up is
- * opened.
+ * Logs a SecurityException with a message and makes sure the pop-up is opened.
*/
public void testSecurityExceptionWithMessage() {
launchExceptionAndCheck(true);
}
/**
- * Logs a SecurityException without message and checks that no pop-up is
- * opened.
+ * Logs a SecurityException without message and checks that no pop-up is opened.
*/
public void testSecurityExceptionWithoutMessage() {
launchExceptionAndCheck(false);
@@ -54,7 +52,6 @@
} else {
exception = new SecurityException();
}
- ShellChangedCondition shellChangedCondition = new ShellChangedCondition(bot.activeShell());
SiriusTestsPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusTestsPlugin.PLUGIN_ID, "exception occurs", exception));
// Step 2 - Check whether the dialog is opened
@@ -63,8 +60,9 @@
SWTBotShell shell = null;
try {
- bot.waitUntil(shellChangedCondition);
- shell = bot.activeShell();
+ ICondition shellIsActive = Conditions.shellIsActive("Permission Issue");
+ bot.waitUntil(shellIsActive);
+ shell = bot.shell("Permission Issue");
assertEquals("Permission Issue", shell.getText());
} catch (TimeoutException e) {
// We throw the exception only in the case where the
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionEditorTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionEditorTest.java
index 6518a83..5c7dd81 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionEditorTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionEditorTest.java
@@ -140,7 +140,6 @@
protected void tearDown() throws Exception {
sessionEditor.close(false);
sessionEditor = null;
- sessionEditor2.close(false);
sessionEditor2 = null;
sessionAirdResource2 = null;
localSession2.close(false);
@@ -150,9 +149,8 @@
}
/**
- * Test that changing a viewpoint activation status of a viewpoint in a
- * session editor does not change the activation status of a viewpoint in
- * another opened session editor.
+ * Test that changing a viewpoint activation status of a viewpoint in a session editor does not change the
+ * activation status of a viewpoint in another opened session editor.
*/
public void testViewpointActivationStatusChange() {
SWTBotEditor activeEditor = bot.activeEditor();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionSaveableTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionSaveableTest.java
index 7b3fbb7..1d87491 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionSaveableTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SessionSaveableTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.condition.SessionSavedCondition;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.tools.api.command.ui.UICallBack;
@@ -30,6 +31,7 @@
import org.eclipse.sirius.ui.tools.api.command.AbstractSWTCallback;
import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
@@ -41,10 +43,9 @@
/**
*
- * Test pop ups appears when closing editors with session dirty. - Test personal
- * UiCallback for pop up message on close dirty representations correspond to
- * message defines in personal UICallback. - Test pop up appears when many
- * editors dirty closed. Test VP-2458 VP-2454. Test VP-2457.
+ * Test pop ups appears when closing editors with session dirty. - Test personal UiCallback for pop up message on close
+ * dirty representations correspond to message defines in personal UICallback. - Test pop up appears when many editors
+ * dirty closed. Test VP-2458 VP-2454. Test VP-2457.
*
* @author jdupont
*/
@@ -110,8 +111,8 @@
}
/**
- * Test that when closing dirty representation it's a good message display
- * in pop up. The message is define in own UICallBack test.
+ * Test that when closing dirty representation it's a good message display in pop up. The message is define in own
+ * UICallBack test.
*/
public void testSessionProvideOwnSaveable() {
// Restore the default preference values of Sirius (not a customer
@@ -141,10 +142,8 @@
}
/**
- * When closing a dirty representation, a dialog appears to choice what to
- * do. This test checks that when the user clicks on the escape key, the
- * dialog is closed and nothing happens (session still dirty and editor
- * still opened).
+ * When closing a dirty representation, a dialog appears to choice what to do. This test checks that when the user
+ * clicks on the escape key, the dialog is closed and nothing happens (session still dirty and editor still opened).
*/
public void testEscapeKeyEffectOnSaveDialog() {
// Restore the default preference values of Sirius (not a customer
@@ -176,9 +175,8 @@
}
/**
- * When closing a dirty representation, a dialog appears to choice what to
- * do. This test checks that when the user closes this dialog, nothing
- * happens (session still dirty and editor still opened).
+ * When closing a dirty representation, a dialog appears to choice what to do. This test checks that when the user
+ * closes this dialog, nothing happens (session still dirty and editor still opened).
*/
public void testCloseEffectOnSaveDialog() {
// Restore the default preference values of Sirius (not a customer
@@ -210,10 +208,8 @@
}
/**
- * When closing many editors, a dialog appears to choice what to do. This
- * test checks that when the user closes this dialog by pressing "No"
- * button, nothing happens (sessions must not be saved and editor are
- * closed).
+ * When closing many editors, a dialog appears to choice what to do. This test checks that when the user closes this
+ * dialog by pressing "No" button, nothing happens (sessions must not be saved and editor are closed).
*/
public void testCloseAllEditorsWithoutSaving() {
// Open session
@@ -228,10 +224,12 @@
createNode(200, 150);
// Close all representations
bot.activeEditor().bot().menu("Close All").click();
+ SWTBot saveBot = SWTBotSiriusHelper.getShellBot("Save");
// Close the first save dialog.
- bot.button("No").click();
+ saveBot.button("No").click();
// Close the second save dialog.
- bot.button("No").click();
+ saveBot = SWTBotSiriusHelper.getShellBot("Save");
+ saveBot.button("No").click();
// Check that the sessions are not saved and editors are closed
assertEquals("The editors must be closed.", 0, editor.getReference().getPage().getEditorReferences().length);
editor = openDiagram(REPRESENTATION_NAME, REPRESENTATION_INSTANCE_NAME);
@@ -241,9 +239,8 @@
}
/**
- * Test when many editors opened that a pop up with many check appears. Test
- * with _Pref_ReloadOnLastEditorClose and _Pref_SaveWhenNoEditor to false
- * value. The preference 'Prompt when saveable still open' is set to true.
+ * Test when many editors opened that a pop up with many check appears. Test with _Pref_ReloadOnLastEditorClose and
+ * _Pref_SaveWhenNoEditor to false value. The preference 'Prompt when saveable still open' is set to true.
*/
public void testCloseAllEditorWithDesignPrefTrueAndElipsePrefFalse() {
closeAllEditorOpened(true, false);
@@ -254,9 +251,8 @@
}
/**
- * Test when many editors opened that a pop up with many check appears.
- * _Pref_ReloadOnLastEditorClose and _Pref_SaveWhenNoEditor are set to true
- * value and preference 'Prompt when saveable still open' is set to true.
+ * Test when many editors opened that a pop up with many check appears. _Pref_ReloadOnLastEditorClose and
+ * _Pref_SaveWhenNoEditor are set to true value and preference 'Prompt when saveable still open' is set to true.
*/
public void testCloseAllEditorWithDesignPrefTrueAndElipsePrefTrue() {
closeAllEditorOpened(true, true);
@@ -267,10 +263,9 @@
}
/**
- * Test when many editors opened that a pop up with many check appears. It's
- * necessary to this test to passed _Pref_ReloadOnLastEditorClose and
- * _Pref_SaveWhenNoEditor to false value.Preference 'Prompt when saveable
- * stil open' is set to false.
+ * Test when many editors opened that a pop up with many check appears. It's necessary to this test to passed
+ * _Pref_ReloadOnLastEditorClose and _Pref_SaveWhenNoEditor to false value.Preference 'Prompt when saveable stil
+ * open' is set to false.
*/
public void testCloseAllEditorWithDesignPrefFalseAndElipsePrefFalse() {
closeAllEditorOpened(false, false);
@@ -281,9 +276,8 @@
}
/**
- * Test when many editors opened that a pop up with many check appears.
- * _Pref_ReloadOnLastEditorClose and _Pref_SaveWhenNoEditor are set to true
- * value. Preference 'Prompt when saveable stil open' is set to false.
+ * Test when many editors opened that a pop up with many check appears. _Pref_ReloadOnLastEditorClose and
+ * _Pref_SaveWhenNoEditor are set to true value. Preference 'Prompt when saveable stil open' is set to false.
*/
public void testCloseAllEditorWithDesignPrefFalseAndElipsePrefTrue() {
closeAllEditorOpened(false, true);
@@ -332,11 +326,11 @@
}
private void checkSaveDialog() {
- bot.waitUntil(Conditions.shellIsActive("Save"));
+ SWTBot saveBot = SWTBotSiriusHelper.getShellBot("Save");
// Check the message (must start with the session name, instead of
// editor name).
- final SWTBotButton buttonNo = bot.button("No");
- final SWTBotLabel labelOfPopup = bot.label(1);
+ final SWTBotButton buttonNo = saveBot.button("No");
+ final SWTBotLabel labelOfPopup = saveBot.label(1);
final String msgOfPopup = labelOfPopup.getText();
assertTrue("The message (\"" + msgOfPopup + "\") should be contains: (" + TEST_UI_CALLBACK + ").", msgOfPopup.contains(TEST_UI_CALLBACK));
buttonNo.click();
@@ -346,6 +340,8 @@
bot.waitUntil(Conditions.shellIsActive("Save"));
SWTBotShell saveShell = bot.shell("Save");
try {
+ saveShell.activate();
+ saveShell.setFocus();
saveShell.pressShortcut(KeyStroke.getInstance(IKeyLookup.ESC_NAME));
} catch (ParseException e) {
fail("Problem to press escape key");
@@ -361,28 +357,27 @@
}
private void checkSaveResourcesDialog() {
- bot.waitUntil(Conditions.shellIsActive("Save Resources"));
- final SWTBotButton buttonOk = bot.button(TestsUtil.isPhotonPlatformOrLater() ? "Save Selected" : "OK");
- assertTrue("The popup should be contains 2 elements", bot.table().rowCount() == 2);
+ SWTBot saveBot = SWTBotSiriusHelper.getShellBot("Save Resources");
+ final SWTBotButton buttonOk = saveBot.button(TestsUtil.isPhotonPlatformOrLater() ? "Save Selected" : "OK");
+ assertTrue("The popup should be contains 2 elements", saveBot.table().rowCount() == 2);
buttonOk.click();
SessionSavedCondition sessionCondition = new SessionSavedCondition(localSession.getOpenedSession());
bot.waitUntil(sessionCondition);
}
private void checkSaveResourcesDialogWithPrefTrue() {
- bot.waitUntil(Conditions.shellIsActive("Save"));
- SWTBotButton buttonYes = bot.button("Yes");
+ SWTBot saveBot = SWTBotSiriusHelper.getShellBot("Save");
+ SWTBotButton buttonYes = saveBot.button("Yes");
buttonYes.click();
- bot.waitUntil(Conditions.shellIsActive("Save Resource"));
- buttonYes = bot.button(TestsUtil.isOxygenPlatform() ? "Save" : "Yes");
+ saveBot = SWTBotSiriusHelper.getShellBot("Save Resources");
+ buttonYes = saveBot.button(TestsUtil.isOxygenPlatform() ? "Save" : "Yes");
buttonYes.click();
SessionSavedCondition sessionCondition = new SessionSavedCondition(localSession.getOpenedSession());
bot.waitUntil(sessionCondition);
}
/**
- * Create a new node using the defined Node Creation tool, at the given
- * position.
+ * Create a new node using the defined Node Creation tool, at the given position.
*
* @param xOfNodeToCreate
* position of the note to create
@@ -405,20 +400,20 @@
* @return the opened representation
*/
private SWTBotEditor createRepresentation(String representation, String semanticElement) {
- secondWizard(representation);
+ SWTBot secondWizardBot = secondWizard(representation);
SWTBotUtils.waitAllUiEvents();
- bot.tree().expandNode("platform:/resource/" + TEMP_PROJECT_NAME + "/" + MODEL).expandNode(semanticElement).select();
+ secondWizardBot.tree().expandNode("platform:/resource/" + TEMP_PROJECT_NAME + "/" + MODEL).expandNode(semanticElement).select();
SWTBotUtils.waitAllUiEvents();
- checkButtonAfterSelectionSecondWizard();
- bot.button(FINISH).click();
+ checkButtonAfterSelectionSecondWizard(secondWizardBot);
+ secondWizardBot.button(FINISH).click();
SWTBotUtils.waitAllUiEvents();
// choose the representation name
SWTBotShell shell = bot.shell("New Entities");
shell.activate();
- bot.button(OK).click();
+ shell.bot().button(OK).click();
SWTBotUtils.waitAllUiEvents();
SWTBotUtils.waitProgressMonitorClose("Representation creation");
@@ -429,23 +424,25 @@
* Open the second wizard.
*
* @param representation
+ * @return
*/
- private void secondWizard(String representation) {
+ private SWTBot secondWizard(String representation) {
// create representation
createOnContextMenu();
// select representation to create
SWTBotShell shell = bot.shell("Create Representation Wizard");
shell.activate();
-
- bot.tree().expandNode(VIEWPOINT_NAME).expandNode(representation).select();
- checkButtonAfterSelectionFirstWizard();
- bot.button(NEXT).click();
+ SWTBot wizardBot = shell.bot();
+ wizardBot.tree().expandNode(VIEWPOINT_NAME).expandNode(representation).select();
+ checkButtonAfterSelectionFirstWizard(wizardBot);
+ wizardBot.button(NEXT).click();
// select semantic element of the new representation
shell = bot.shell("Create Representation");
shell.activate();
- checkButtonBeforeSelectionSecondWizard();
+ checkButtonBeforeSelectionSecondWizard(shell.bot());
+ return shell.bot();
}
/**
@@ -461,24 +458,24 @@
}
}
- private void checkButtonAfterSelectionFirstWizard() {
- assertFalse(bot.button(FINISH).isEnabled());
- assertFalse(bot.button(BACK).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonAfterSelectionFirstWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(FINISH).isEnabled());
+ assertFalse(swtBot.button(BACK).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
- private void checkButtonBeforeSelectionSecondWizard() {
- assertFalse(bot.button(FINISH).isEnabled());
- assertTrue(bot.button(BACK).isEnabled());
- assertFalse(bot.button(NEXT).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
+ private void checkButtonBeforeSelectionSecondWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(FINISH).isEnabled());
+ assertTrue(swtBot.button(BACK).isEnabled());
+ assertFalse(swtBot.button(NEXT).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
}
- private void checkButtonAfterSelectionSecondWizard() {
- assertFalse(bot.button(NEXT).isEnabled());
- assertTrue(bot.button(BACK).isEnabled());
- assertTrue(bot.button(CANCEL).isEnabled());
- assertTrue(bot.button(FINISH).isEnabled());
+ private void checkButtonAfterSelectionSecondWizard(SWTBot swtBot) {
+ assertFalse(swtBot.button(NEXT).isEnabled());
+ assertTrue(swtBot.button(BACK).isEnabled());
+ assertTrue(swtBot.button(CANCEL).isEnabled());
+ assertTrue(swtBot.button(FINISH).isEnabled());
}
private class SessionCallBack extends AbstractSWTCallback {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/VSMAndDiagramEditorSynchronisationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/VSMAndDiagramEditorSynchronisationTest.java
index 0e5b3bd..de27a52 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/VSMAndDiagramEditorSynchronisationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/VSMAndDiagramEditorSynchronisationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -240,7 +240,7 @@
private void modifyVSM(String oldColor, String color) {
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(COLOR);
+ SWTBotSiriusHelper.selectPropertyTabItem(COLOR, propertiesBot.bot());
SWTBotUtils.waitAllUiEvents();
SWTBotCCombo comboBox = propertiesBot.bot().ccomboBox(oldColor);
comboBox.setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ValidationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ValidationTest.java
index fc98caf..e2e64dd 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ValidationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ValidationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -22,12 +22,14 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UISessionCreationWizardFlow.SessionChoice;
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckSelectedCondition;
import org.eclipse.sirius.tests.swtbot.support.api.condition.OpenedSessionCondition;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.ui.ISharedImages;
@@ -95,13 +97,15 @@
semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
ecoreTreeItem = semanticResourceNode.getNode("ecore").select();
SWTBotUtils.clickContextMenu(ecoreTreeItem, "Classes in ecore package");
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New Classes");
+ wizardBot.button("OK").click();
bot.sleep(1000);
SWTBotUtils.waitProgressMonitorClose("Progress Information");
// Close the table
SWTBotCommonHelper.closeCurrentEditor();
- bot.button(TestsUtil.isOxygenPlatform() ? "Don't Save" : "No").click();
+ wizardBot = SWTBotSiriusHelper.getShellBot("Save");
+ wizardBot.button(TestsUtil.isOxygenPlatform() ? "Don't Save" : "No").click();
bot.sleep(500);
// Check that all editors are closes
@@ -121,8 +125,8 @@
assertEquals(activeEditor.getReference(), editor.getReference());
assertEquals("The wrong editor was opened", "ecore package entities", editor.getTitle());
assertEquals("There should not be more than one open session.", 1, SessionManager.INSTANCE.getSessions().size());
- assertEquals("The selection should be the element concerned by the marker", NEW_ECLASS_1, ((IDiagramElementEditPart) ((IStructuredSelection) editor.getSelection()).iterator().next())
- .resolveDiagramElement().getName());
+ assertEquals("The selection should be the element concerned by the marker", NEW_ECLASS_1,
+ ((IDiagramElementEditPart) ((IStructuredSelection) editor.getSelection()).iterator().next()).resolveDiagramElement().getName());
// Close the session and save it
editor.close();
@@ -179,13 +183,11 @@
}
/**
- * Indicates if the given editPart has an image decoration indicating a
- * validation info.
+ * Indicates if the given editPart has an image decoration indicating a validation info.
*
* @param editPart
* the edit part to test
- * @return true if the given editPart has an image decoration indicating a
- * validation info, false otherwise
+ * @return true if the given editPart has an image decoration indicating a validation info, false otherwise
*/
private boolean hasValidationInfoDecoration(IDiagramElementEditPart editPart) {
return new AbstractDecoratorMatcher() {
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/celleditor/CellEditorExtensionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/celleditor/CellEditorExtensionTest.java
index 81830d5..a5e2b11 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/celleditor/CellEditorExtensionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/celleditor/CellEditorExtensionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2018 Obeo.
+ * Copyright (c) 2015, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -41,8 +41,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
/**
- * Test case to check properties CellEditor extensibility. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=451364
+ * Test case to check properties CellEditor extensibility. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=451364
*
* @author Florian Barbin
*/
@@ -134,7 +133,7 @@
private void checkCellEditorValue() {
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Semantic");
+ SWTBotSiriusHelper.selectPropertyTabItem("Semantic", propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode("NewEClass1").select().getNode("Name").click();
SWTBotText text = propertiesBot.bot().text();
@@ -143,8 +142,7 @@
}
/**
- * Installs dynamically an extension that adds "custom" at the end of the
- * value of the "name" field CellEditor.
+ * Installs dynamically an extension that adds "custom" at the end of the value of the "name" field CellEditor.
*/
private void registerExtension() {
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/clipboard/AbstractClipboardSupportTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/clipboard/AbstractClipboardSupportTest.java
index eeef479..78e8462 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/clipboard/AbstractClipboardSupportTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/clipboard/AbstractClipboardSupportTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -340,11 +340,11 @@
* expected cut menu enablement
*/
protected void assertCopyCutToolBarActivation(boolean copyState, boolean cutState) {
- SWTBotMenu copyMenu = bot.menu("Edit").menu("Copy");
+ SWTBotMenu copyMenu = editor.bot().menu("Edit").menu("Copy");
assertEquals(true, copyMenu.isVisible());
assertEquals("Copy action enabled ?", copyState, copyMenu.isEnabled());
- SWTBotMenu cutMenu = bot.menu("Edit").menu("Cut");
+ SWTBotMenu cutMenu = editor.bot().menu("Edit").menu("Cut");
assertEquals(true, cutMenu.isVisible());
assertEquals("Cut action enabled ?", cutState, cutMenu.isEnabled());
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsSizeTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsSizeTest.java
index a5e840c..3531e93 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsSizeTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsSizeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018-2019 Obeo.
+ * Copyright (c) 2018, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -65,6 +65,9 @@
@Override
protected void tearDown() throws Exception {
+ if (editor != null) {
+ editor.close();
+ }
if (oldFont != null) {
changeDefaultFontName(oldFont);
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/crossTable/CrossTableIntersectionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/crossTable/CrossTableIntersectionTest.java
index 91b4b2b..ba166c0 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/crossTable/CrossTableIntersectionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/crossTable/CrossTableIntersectionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Obeo.
+ * Copyright (c) 2014, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,11 +17,11 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
/**
- * Test that the default value of the Label Expression for Intersection in cross
- * Table is setted to "X".
+ * Test that the default value of the Label Expression for Intersection in cross Table is setted to "X".
*
* @author jmallet
*/
@@ -85,10 +85,11 @@
*/
private void checkLabelDefaultValue() {
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// accesses to tab Label
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesView.bot());
// Check if value of the Label Expression is given by "X"
- assertEquals("Wrong value for LabelExpression.", "X", bot.viewByTitle(PROPERTIES).bot().text(0).getText());
+ assertEquals("Wrong value for LabelExpression.", "X", propertiesView.bot().text(0).getText());
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderNodeSidePropertySectionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderNodeSidePropertySectionTest.java
index 9024761..aa6b90b 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderNodeSidePropertySectionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderNodeSidePropertySectionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2018 Obeo.
+ * Copyright (c) 2016, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -99,7 +99,7 @@
});
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Advanced");
+ SWTBotSiriusHelper.selectPropertyTabItem("Advanced", propertiesBot.bot());
if (shouldBeVisible) {
try {
propertiesBot.bot().checkBoxWithLabel("Authorized Sides:");
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderSizeComputationExpressionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderSizeComputationExpressionTest.java
index 0dbd6e3..98584cf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderSizeComputationExpressionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/BorderSizeComputationExpressionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Obeo.
+ * Copyright (c) 2014, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -58,8 +59,7 @@
}
/**
- * For each style mapping, Check that the Border Size Computation Expression
- * can not be empty.
+ * For each style mapping, Check that the Border Size Computation Expression can not be empty.
*/
public void testBorderSizeComputationExpression() {
// Open VSM
@@ -82,19 +82,20 @@
private void testBorderSizeComputationExpression(SWTBotTreeItem tree, String node, String style, String expectedDefaultSize) {
tree.expandNode(DEFAULT).expandNode(node).expandNode(style).select();
// set the focus on the Properties view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// set the focus on the Border tab
- SWTBotSiriusHelper.selectPropertyTabItem(BORDER);
+ SWTBotSiriusHelper.selectPropertyTabItem(BORDER, propertiesView.bot());
// get the label expression
- labelText = bot.viewByTitle(PROPERTIES).bot().text(0);
+ labelText = propertiesView.bot().text(0);
// focus on label field
labelText.setFocus();
// Set Border Size Computation Expression to empty
labelText.setText("");
// set the focus on the General tab
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
// set the focus on the Border tab
- SWTBotSiriusHelper.selectPropertyTabItem(BORDER);
+ SWTBotSiriusHelper.selectPropertyTabItem(BORDER, propertiesView.bot());
assertEquals("Border Size Computation Expression should not be empty for " + style, expectedDefaultSize, labelText.getText());
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CompletionProposalInVSMTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CompletionProposalInVSMTest.java
index 6c36f61..3edfe08 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CompletionProposalInVSMTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CompletionProposalInVSMTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -54,8 +54,7 @@
import com.google.common.base.Joiner;
/**
- * Tests completion in MTL interpreted expression and domain class property
- * section.
+ * Tests completion in MTL interpreted expression and domain class property section.
*
* @author mporhel
*/
@@ -102,16 +101,14 @@
}
/**
- * Initialize the context by copying new resources and waiting all build
- * process. This method is unreliable...
+ * Initialize the context by copying new resources and waiting all build process. This method is unreliable...
*
* @exception InterruptedException
* if this thread is interrupted while waiting
* @exception OperationCanceledException
* if the progress monitor is canceled while waiting
* @exception CoreException
- * In case of problem during setting workspace description to
- * disable auto build.
+ * In case of problem during setting workspace description to disable auto build.
* @throws CommandException
*/
private void initContext(List<String> nodes) throws InterruptedException, OperationCanceledException, CoreException, CommandException {
@@ -170,7 +167,7 @@
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesBot.bot());
}
private void addAcceleoNature(IProject projet) throws CommandException {
@@ -194,8 +191,7 @@
}
/**
- * There is problem on linux with this test so we are waiting build or
- * refresh jobs by joining them.
+ * There is problem on linux with this test so we are waiting build or refresh jobs by joining them.
*/
private void waitJobsBuildOrRefresh() throws InterruptedException, OperationCanceledException {
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new NullProgressMonitor());
@@ -237,11 +233,10 @@
}
/**
- * Check that the right Java service appears in the completion proposals
- * with Acceleo interpreter.
+ * Check that the right Java service appears in the completion proposals with Acceleo interpreter.
*
- * Warning: To ensure the non regression of the associated bug 500253, the
- * manifest must not have a direct reference to org.eclipse.emf.ecore.
+ * Warning: To ensure the non regression of the associated bug 500253, the manifest must not have a direct reference
+ * to org.eclipse.emf.ecore.
*
* @exception Exception
* In case of problem during context initialization.
@@ -272,11 +267,10 @@
}
/**
- * Check that the right Java service appears in the completion proposals
- * with service keyword used.
+ * Check that the right Java service appears in the completion proposals with service keyword used.
*
- * Warning: To ensure the non regression of the associated bug 500253, the
- * manifest must not have a direct reference to org.eclipse.emf.ecore.
+ * Warning: To ensure the non regression of the associated bug 500253, the manifest must not have a direct reference
+ * to org.eclipse.emf.ecore.
*
* @exception Exception
* In case of problem during context initialization.
@@ -307,11 +301,10 @@
}
/**
- * Check that the right Java service appears in the completion proposals
- * with AQL interpreter.
+ * Check that the right Java service appears in the completion proposals with AQL interpreter.
*
- * Warning: To ensure the non regression of the associated bug 500253, the
- * manifest must not have a direct reference to org.eclipse.emf.ecore.
+ * Warning: To ensure the non regression of the associated bug 500253, the manifest must not have a direct reference
+ * to org.eclipse.emf.ecore.
*
* @exception Exception
* In case of problem during context initialization.
@@ -370,8 +363,8 @@
Collection<String> contentAssistProposal = getContentAssistProposal(precondition, 13);
// Expected mtl queries.
- Collection<String> mtlServices = Arrays.asList("getName() : String", "getNameQuery() : String", "getImportedName() : String", "getImportedQueryName() : String",
- "isAbstractQuery() : Boolean", "eContentsQuery() : Collection(EObject)", "selfQuery() : EObject", "selfImportedQuery() : EObject");
+ Collection<String> mtlServices = Arrays.asList("getName() : String", "getNameQuery() : String", "getImportedName() : String", "getImportedQueryName() : String", "isAbstractQuery() : Boolean",
+ "eContentsQuery() : Collection(EObject)", "selfQuery() : EObject", "selfImportedQuery() : EObject");
Collection<String> unfoundServices = new ArrayList<>();
for (String mtlService : mtlServices) {
@@ -428,7 +421,7 @@
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesBot.bot());
SWTBotText domainClass = propertiesBot.bot().text(2);
domainClass.setFocus();
@@ -448,19 +441,18 @@
// Select a meta model : Sirius
SWTBotView propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Metamodels");
+ SWTBotSiriusHelper.selectPropertyTabItem("Metamodels", propertiesBot.bot());
SWTBotTable metamodelsTableBot = propertiesBot.bot().table();
SWTBotButton addFromRegistryButtonBot = propertiesBot.bot().button("Add from registry");
addFromRegistryButtonBot.click();
- final SWTBot metamodelsSelectionFromRegistryBot = bot.activeShell().bot();
- bot.waitUntil(Conditions.shellIsActive("Metamodel selection"));
- bot.waitUntil(new DefaultCondition() {
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Metamodel selection");
+ wizardBot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
for (String nsURI : expectedNsURIs) {
- if (metamodelsSelectionFromRegistryBot.table().indexOf(nsURI) == -1) {
+ if (wizardBot.table().indexOf(nsURI) == -1) {
return false;
}
}
@@ -472,8 +464,8 @@
return "Some of the expected metamodels were not found: " + Joiner.on(", ").join(expectedNsURIs);
}
});
- metamodelsSelectionFromRegistryBot.text().setText("*sirius*");
- SWTBotTable metamodelsFromRegistryTableBot = metamodelsSelectionFromRegistryBot.table();
+ wizardBot.text().setText("*sirius*");
+ SWTBotTable metamodelsFromRegistryTableBot = wizardBot.table();
int nbOfMetamodelsFromRegistry = metamodelsFromRegistryTableBot.rowCount();
int[] selection = new int[nbOfMetamodelsFromRegistry];
@@ -481,9 +473,9 @@
selection[i] = i;
}
metamodelsFromRegistryTableBot.select(selection);
- bot.waitUntil(new TableSelectionCondition(metamodelsFromRegistryTableBot, nbOfMetamodelsFromRegistry));
+ wizardBot.waitUntil(new TableSelectionCondition(metamodelsFromRegistryTableBot, nbOfMetamodelsFromRegistry));
- metamodelsSelectionFromRegistryBot.button("OK").click();
+ wizardBot.button("OK").click();
bot.waitUntil(Conditions.tableHasRows(metamodelsTableBot, nbOfMetamodelsFromRegistry));
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ContainerDropPropertySectionsTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ContainerDropPropertySectionsTests.java
index 2bbe6ce..0faae41 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ContainerDropPropertySectionsTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ContainerDropPropertySectionsTests.java
@@ -83,8 +83,7 @@
}
/**
- * Test Containers sections. The items in the section must have their label
- * qualified.
+ * Test Containers sections. The items in the section must have their label qualified.
*/
public void testContainersReferences() {
SWTBotTreeItem layerNode = viewpointItemBot.getNode(0).getNode(0).getNode(0).getNode(DEFAULT_LAYER_NAME);
@@ -96,7 +95,7 @@
SWTBotButton appliedOnButton = propertiesBot.bot().button(0);
appliedOnButton.click();
- SWTBotShell appliedOnSelectorShell = bot.activeShell();
+ SWTBotShell appliedOnSelectorShell = bot.shell("Containers -- Ticket #1041 > Test case for ticket #1041 > TC1041 representation 1 > Default > tools > Drag & Drop R1");
SWTBot appliedOnSelectorShellBot = appliedOnSelectorShell.bot();
SWTBotTable table1 = appliedOnSelectorShellBot.table(0);
assertEquals("The left containers selection table does not contains all elements it should.", 16, table1.rowCount());
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
index c72478c8..994d47f 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
@@ -315,8 +315,7 @@
}
/**
- * Ensure that the order displayed in properties view of VSM file is (Left -
- * Center - Right).
+ * Ensure that the order displayed in properties view of VSM file is (Left - Center - Right).
*/
public void testLabelAlignmentInVSM() {
SWTBotTreeItem diagramDescItem = viewpointItemBot.getNode(DIAGRAM_DESCRIPTION_NAME).select().expand();
@@ -325,7 +324,7 @@
mappingItem.getNode("Gradient white to light_gray").select();
propertiesBot = bot.viewByTitle("Properties");
- SWTBotSiriusHelper.selectPropertyTabItem("Label");
+ SWTBotSiriusHelper.selectPropertyTabItem("Label", propertiesBot.bot());
SWTBotUtils.waitAllUiEvents();
SWTBotRadio left = propertiesBot.bot().radio(0);
SWTBotRadio center = propertiesBot.bot().radio(1);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/MetamodelPropertyTabTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/MetamodelPropertyTabTests.java
index 7c3ff55..67a8594 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/MetamodelPropertyTabTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/MetamodelPropertyTabTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -39,8 +39,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * A SWTBot test for metamodels selection on a RepresentationDescription (See
- * VP-2651).
+ * A SWTBot test for metamodels selection on a RepresentationDescription (See VP-2651).
*
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
@@ -99,16 +98,14 @@
}
/**
- * Test the metamodel tab of the property view on the edition table
- * description.
+ * Test the metamodel tab of the property view on the edition table description.
*/
public void testMetamodelsAddingFromRegistryOnEditionTableDescription() {
testMetamodelsAddingFromRegistry(EDITION_TABLE_DESCRIPTION_NAME);
}
/**
- * Test the metamodel tab of the property view on the cross table
- * description.
+ * Test the metamodel tab of the property view on the cross table description.
*/
public void testMetamodelsAddingFromRegistryOnCrossTableDescription() {
testMetamodelsAddingFromRegistry(CROSS_TABLE_DESCRIPTION_NAME);
@@ -122,16 +119,14 @@
}
/**
- * Test the metamodel tab of the property view on the sequence diagram
- * description.
+ * Test the metamodel tab of the property view on the sequence diagram description.
*/
public void testMetamodelsAddingFromRegistryOnSequenceDiagramDescription() {
testMetamodelsAddingFromRegistry(SEQUENCE_DIAGRAM_DESCRIPTION_NAME);
}
/**
- * Test the metamodel tab of the property view on the diagram extension
- * description.
+ * Test the metamodel tab of the property view on the diagram extension description.
*/
public void testMetamodelsAddingFromRegistryOnDiagramExtensionDescription() {
testMetamodelsAddingFromRegistry("Diagram Extension " + DIAGRAM_EXTENSION_DESCRIPTION_NAME);
@@ -154,7 +149,7 @@
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Metamodels");
+ SWTBotSiriusHelper.selectPropertyTabItem("Metamodels", propertiesBot.bot());
SWTBotTable metamodelsTableBot = propertiesBot.bot().table();
SWTBotButton addFromRegistryButtonBot = propertiesBot.bot().button("Add from registry");
@@ -165,8 +160,7 @@
addFromRegistryButtonBot.click();
- SWTBot metamodelsSelectionFromRegistryBot = bot.activeShell().bot();
- bot.waitUntil(Conditions.shellIsActive("Metamodel selection"));
+ SWTBot metamodelsSelectionFromRegistryBot = SWTBotSiriusHelper.getShellBot("Metamodel selection");
metamodelsSelectionFromRegistryBot.text().setText("*sirius*");
SWTBotTable metamodelsFromRegistryTableBot = metamodelsSelectionFromRegistryBot.table();
@@ -176,7 +170,7 @@
selection[i] = i;
}
metamodelsFromRegistryTableBot.select(selection);
- bot.waitUntil(new TableSelectionCondition(metamodelsFromRegistryTableBot, nbOfMetamodelsFromRegistry));
+ metamodelsSelectionFromRegistryBot.waitUntil(new TableSelectionCondition(metamodelsFromRegistryTableBot, nbOfMetamodelsFromRegistry));
metamodelsSelectionFromRegistryBot.button("OK").click();
bot.waitUntil(Conditions.tableHasRows(metamodelsTableBot, nbOfMetamodelsFromRegistry));
@@ -206,8 +200,7 @@
}
/**
- * Assert that the added EPackages from registry are referenced using their
- * nsURI in the odesign resource.
+ * Assert that the added EPackages from registry are referenced using their nsURI in the odesign resource.
*/
private void assertEPackageReferenceFromRegistry(String representationDescriptionName) {
URI modelerResourceURI = URI.createPlatformResourceURI(getProjectName() + "/" + MODELER_RESOURCE_NAME, true);
@@ -218,14 +211,14 @@
Viewpoint viewpoint = group.getOwnedViewpoints().get(0);
List<EPackage> ePackages = getEPackages(viewpoint, representationDescriptionName);
for (EPackage ePackage : ePackages) {
- assertFalse("The EPackage with the nsURI " + ePackage.getNsURI()
- + " has not been added using the EPackage from the registry (i.e. the nsURI is not used to reference it in the odesign xmi)", ePackage.eResource().getURI().isPlatform());
+ assertFalse(
+ "The EPackage with the nsURI " + ePackage.getNsURI() + " has not been added using the EPackage from the registry (i.e. the nsURI is not used to reference it in the odesign xmi)",
+ ePackage.eResource().getURI().isPlatform());
}
}
/**
- * Get the EPackages referenced by the {@link RepresentationDescription} or
- * {@link DiagramExtensionDescription}.
+ * Get the EPackages referenced by the {@link RepresentationDescription} or {@link DiagramExtensionDescription}.
*/
private List<EPackage> getEPackages(Viewpoint viewpoint, String representationDescriptionName) {
List<EPackage> ePackages = null;
@@ -255,15 +248,14 @@
}
/**
- * Test that adding a EPackage with its properties (name, nsURI) to null
- * doesn't throws exceptions.
+ * Test that adding a EPackage with its properties (name, nsURI) to null doesn't throws exceptions.
*/
public void testMetamodelAddingFromEPackageWithNullProperties() {
viewpointItemBot.getNode(TREE_DESCRIPTION_NAME).select();
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Metamodels");
+ SWTBotSiriusHelper.selectPropertyTabItem("Metamodels", propertiesBot.bot());
SWTBotTable metamodelsTableBot = propertiesBot.bot().table();
int nbOfSelectedMetamodels = metamodelsTableBot.rowCount();
@@ -272,9 +264,7 @@
addFromWorkspaceButtonBot.click();
- SWTBot metamodelsSelectionFromWorkspaceBot = bot.activeShell().bot();
-
- bot.waitUntil(Conditions.shellIsActive("Ecore resource selection"));
+ SWTBot metamodelsSelectionFromWorkspaceBot = SWTBotSiriusHelper.getShellBot("Ecore resource selection");
SWTBotTree workspaceBrowserBot = metamodelsSelectionFromWorkspaceBot.tree();
workspaceBrowserBot.setFocus();
workspaceBrowserBot.expandNode(getProjectName());
@@ -316,6 +306,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean test() throws Exception {
return expectedSelectionCound == swtBotTable.selectionCount();
}
@@ -323,6 +314,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public String getFailureMessage() {
return "The selection count is not the expected one, expected (" + expectedSelectionCound + "), " + swtBotTable.selectionCount();
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ResizeKindEditorTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ResizeKindEditorTest.java
index 6b5ac33..da9da58 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ResizeKindEditorTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ResizeKindEditorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -24,9 +25,8 @@
import org.eclipse.ui.PlatformUI;
/**
- * Test that the editor contains checkBox for editor and that the semantic model
- * was updated when VSM was modified. Test also that all resize were activated
- * by default. Test VP-2694 VP-2637
+ * Test that the editor contains checkBox for editor and that the semantic model was updated when VSM was modified. Test
+ * also that all resize were activated by default. Test VP-2694 VP-2637
*
* @author jdupont
*/
@@ -71,8 +71,8 @@
}
/**
- * Test that the resizeKind field have 2 checkBox named Vertically and
- * Horizontally. And that the check modify the model value.
+ * Test that the resizeKind field have 2 checkBox named Vertically and Horizontally. And that the check modify the
+ * model value.
*/
public void testCheckBoxResizeKind() {
// Use the workaround as described here:
@@ -90,8 +90,7 @@
}
/**
- * Modify resize kind field (Allow resizing field in properties view).
- * viewpoint specific model (.odesign).
+ * Modify resize kind field (Allow resizing field in properties view). viewpoint specific model (.odesign).
*
* @param odesignEditor
* the odesign editor.
@@ -118,7 +117,7 @@
// Create a conditional style
nodeMappingClass.select();
SWTBotUtils.clickContextMenu(tree, "Conditional Style");
-
+
// Create a bundled image description in conditional style
nodeMappingClass.select("Conditional Style");
SWTBotUtils.clickContextMenu(tree, "Basic Shape");
@@ -146,24 +145,25 @@
*/
private void checkCheckBoxSelected(int checkboxNumber, boolean isSelected) {
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// accesses to tab Advanced
- SWTBotSiriusHelper.selectPropertyTabItem(ADVANCED);
+ SWTBotSiriusHelper.selectPropertyTabItem(ADVANCED, propertiesView.bot());
// Check if checkBox 'horizontally' and 'vertically' were checked
if (checkboxNumber == 0) {
if (isSelected) {
- assertEquals("The checkbox horizontally must be checked", true, bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).isChecked());
+ assertEquals("The checkbox horizontally must be checked", true, propertiesView.bot().checkBox(checkboxNumber).isChecked());
} else {
- assertEquals("The checkbox horizontally should not be checked", false, bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).isChecked());
+ assertEquals("The checkbox horizontally should not be checked", false, propertiesView.bot().checkBox(checkboxNumber).isChecked());
}
- assertEquals("The name of checkBox must be : 'Horizontally'", "Horizontally", bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).getText());
+ assertEquals("The name of checkBox must be : 'Horizontally'", "Horizontally", propertiesView.bot().checkBox(checkboxNumber).getText());
} else {
if (isSelected) {
- assertEquals("The checkbox vertically must be checked", true, bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).isChecked());
+ assertEquals("The checkbox vertically must be checked", true, propertiesView.bot().checkBox(checkboxNumber).isChecked());
} else {
- assertEquals("The checkbox vertically should not be checked", false, bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).isChecked());
+ assertEquals("The checkbox vertically should not be checked", false, propertiesView.bot().checkBox(checkboxNumber).isChecked());
}
- assertEquals("The name of checkBox must be : 'Vertically'", "Vertically", bot.viewByTitle(PROPERTIES).bot().checkBox(checkboxNumber).getText());
+ assertEquals("The name of checkBox must be : 'Vertically'", "Vertically", propertiesView.bot().checkBox(checkboxNumber).getText());
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
index 5bf517b..0dc8ff1 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 Obeo
+ * Copyright (c) 2018, 2019 Obeo
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -45,8 +45,7 @@
import org.eclipse.ui.IEditorReference;
/**
- * Test the service implementation navigation from VSM service call in
- * interpreted expressions.
+ * Test the service implementation navigation from VSM service call in interpreted expressions.
*
* @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a>
*
@@ -59,8 +58,7 @@
/**
* @param javaEditorOpened
- * true if the Java editor should be opened at some point.
- * False it should never be opened.
+ * true if the Java editor should be opened at some point. False it should never be opened.
*/
public JavaEditorOpenedCondition(boolean javaEditorOpened) {
this.javaEditorOpened = javaEditorOpened;
@@ -119,16 +117,14 @@
}
/**
- * Initialize the context by copying new resources and waiting all build
- * process.
+ * Initialize the context by copying new resources and waiting all build process.
*
* @exception InterruptedException
* if this thread is interrupted while waiting
* @exception OperationCanceledException
* if the progress monitor is canceled while waiting
* @exception CoreException
- * In case of problem during setting workspace description to
- * disable auto build.
+ * In case of problem during setting workspace description to disable auto build.
* @throws CommandException
*/
private void initContext(List<String> nodes, boolean selectPropertyField) throws InterruptedException, OperationCanceledException, CoreException, CommandException {
@@ -147,7 +143,7 @@
String MANIFEST_MF = "MANIFEST.MF";
EclipseTestsSupportHelper.INSTANCE.copyFile(Activator.PLUGIN_ID, PATH + MANIFEST_MF, VSM_PROJECT_NAME + "/META-INF/" + MANIFEST_MF);
EclipseTestsSupportHelper.INSTANCE.copyFile(Activator.PLUGIN_ID, PATH + VSM, VSM_PROJECT_NAME + "/description/" + TESTED_ODESIGN_NAME);
- waitJobsBuildOrRefresh();
+
// We open the new design used by the test. We avoid replacing the
// already existing one because sometime the refresh is not correctly
// done and tests can fail.
@@ -155,6 +151,10 @@
modelExplorerView.setFocus();
SWTBotTreeItem projectNode = modelExplorerView.bot().tree().expandNode("org.eclipse.sirius.test.design");
SWTBotTreeItem descriptionNode = projectNode.expandNode("description");
+
+ viewpointSpecificationProject.refreshLocal(IProject.DEPTH_INFINITE, new NullProgressMonitor());
+ waitJobsBuildOrRefresh();
+
SWTBotTreeItem designNode = descriptionNode.getNode(TESTED_ODESIGN_NAME);
designNode.doubleClick();
@@ -185,13 +185,12 @@
if (selectPropertyField) {
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesBot.bot());
}
}
/**
- * There is problem on linux with this test so we are waiting build or
- * refresh jobs by joining them.
+ * There is problem on linux with this test so we are waiting build or refresh jobs by joining them.
*/
private void waitJobsBuildOrRefresh() throws InterruptedException, OperationCanceledException {
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new NullProgressMonitor());
@@ -202,14 +201,12 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the starting position</li>
* <li>The service called is present in two different classes</li>
- * <li>The service from which the navigation is done is the first one in the
- * wizard.</li>
+ * <li>The service from which the navigation is done is the first one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -217,14 +214,13 @@
*/
public void testServiceNavigationWithSameServiceInDifferentClasses() throws Exception {
List<String> expectedItemLabels = new ArrayList<>();
- expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design");
- expectedItemLabels.add("BasicService2");
+ expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
+ expectedItemLabels.add("BasicService2 - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
testNavigation("service:sampleService()", 2, expectedItemLabels, 0, 0);
}
/**
- * Tests that double clicking a Java service declaration will open
- * corresponding Java editor.
+ * Tests that double clicking a Java service declaration will open corresponding Java editor.
*
* @exception Exception
* if a problem occurs.
@@ -237,8 +233,8 @@
}
/**
- * Tests that double clicking a Java service declaration pointing at an
- * unknown class opens a dialog with an error message.
+ * Tests that double clicking a Java service declaration pointing at an unknown class opens a dialog with an error
+ * message.
*
* @exception Exception
* if a problem occurs.
@@ -253,7 +249,7 @@
propertiesBot = bot.viewByTitle("Properties");
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("General");
+ SWTBotSiriusHelper.selectPropertyTabItem("General", propertiesBot.bot());
SWTBotText text = propertiesBot.bot().text(0);
text.setFocus();
@@ -266,14 +262,12 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the starting position</li>
* <li>The service called is present in two different classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -281,14 +275,13 @@
*/
public void testServiceNavigationWithSameServiceInDifferentClasses2() throws Exception {
List<String> expectedItemLabels = new ArrayList<>();
- expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design");
- expectedItemLabels.add("BasicService2");
+ expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
+ expectedItemLabels.add("BasicService2 - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
testNavigation("service:sampleService()", 2, expectedItemLabels, 1, 0);
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the 12 index position</li>
@@ -304,13 +297,11 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the starting position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -321,13 +312,11 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the last position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -338,13 +327,11 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 27 index position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -355,15 +342,12 @@
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 13 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -371,21 +355,18 @@
*/
public void testDualServiceNavigationWithAqlInterpreter() throws Exception {
List<String> expectedItemLabels = new ArrayList<>();
- expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design");
- expectedItemLabels.add("BasicService2");
+ expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
+ expectedItemLabels.add("BasicService2 - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
testNavigation("aql:self.sampleService() and self.sampleService(self)->", 2, expectedItemLabels, 1, 13);
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 9 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -393,21 +374,18 @@
*/
public void testDualServiceNavigationWithAqlInterpreter2() throws Exception {
List<String> expectedItemLabels = new ArrayList<>();
- expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design");
- expectedItemLabels.add("BasicService2");
+ expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
+ expectedItemLabels.add("BasicService2 - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
testNavigation("aql:self.sampleService() and self.sampleService(self)->", 2, expectedItemLabels, 1, 9);
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 23 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -415,14 +393,13 @@
*/
public void testDualServiceNavigationWithAqlInterpreter3() throws Exception {
List<String> expectedItemLabels = new ArrayList<>();
- expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design");
- expectedItemLabels.add("BasicService2");
+ expectedItemLabels.add("BasicService - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
+ expectedItemLabels.add("BasicService2 - org.eclipse.sirius.test.design - org.eclipse.sirius.test.design/src");
testNavigation("aql:self.sampleService() and self.sampleService(self)->", 2, expectedItemLabels, 1, 23);
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 38 index position</li>
@@ -438,22 +415,18 @@
}
/**
- * Tests that Java service navigation from VSM expression is the expected
- * one.
+ * Tests that Java service navigation from VSM expression is the expected one.
*
* @param vsmExpression
* the VSM expression used to test Java service navigation.
* @param matchingJavaServiceNumber
- * the number of Java service that should be proposed for
- * navigation.
+ * the number of Java service that should be proposed for navigation.
* @param expectedItemLabels
* The Java service item's labels in their wizard's order.
* @param javaServiceIndex
- * the index of the Java service item to open with Java editor
- * when in Java service navigation wizard.
+ * the index of the Java service item to open with Java editor when in Java service navigation wizard.
* @param cursorPosition
- * the cursor position in the VSM expression before triggering
- * navigation with F3 key.
+ * the cursor position in the VSM expression before triggering navigation with F3 key.
*
* @throws InterruptedException
* if a problem occurs.
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/VSMFieldTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/VSMFieldTest.java
index f03406c..fbb40ea 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/VSMFieldTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/VSMFieldTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
import org.eclipse.sirius.tree.ui.provider.TreeUIPlugin;
import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo;
@@ -88,8 +89,7 @@
}
/**
- * Tests that the background style of Flat Container Style Description has 2
- * elements in the list.
+ * Tests that the background style of Flat Container Style Description has 2 elements in the list.
*/
public void testCheckFlatContainerBackgroundStyle() {
// Open VSM
@@ -100,8 +100,7 @@
}
/**
- * Tests that on a style in a diagram description, the label size minimal
- * value is 1.
+ * Tests that on a style in a diagram description, the label size minimal value is 1.
*/
public void testLabelSizeMinimalValueOnDiagramStyle() {
// Open VSM
@@ -111,8 +110,7 @@
}
/**
- * Tests that on a style in a table description, the label size minimal
- * value is 1.
+ * Tests that on a style in a table description, the label size minimal value is 1.
*/
public void testLabelSizeMinimalValueOnTableStyle() {
// Open VSM
@@ -122,8 +120,7 @@
}
/**
- * Tests that on a style in a table description, the label size minimal
- * value is 1.
+ * Tests that on a style in a table description, the label size minimal value is 1.
*/
public void testLabelSizeMinimalValueOnTreeStyle() {
// Open VSM
@@ -133,19 +130,19 @@
}
/**
- * Test that for Create Line Tool, 'Create View' operation is not available
- * in menu.
+ * Test that for Create Line Tool, 'Create View' operation is not available in menu.
*/
public void testThatCreateViewNotPresentForTable() {
if (TestsUtil.shouldSkipUnreliableTests()) {
/*
- org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find node with text: vsm.odesign
- at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334)
- at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(SWTBotTreeItem.java:308)
- at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(SWTBotTreeItem.java:346)
- at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.expandNode(SWTBotTreeItem.java:283)
- at org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper.openEditor(SWTBotCommonHelper.java:138)
- at org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase.openViewpointSpecificationModel(AbstractSiriusSwtBotGefTestCase.java:1553)
+ * org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find node with text:
+ * vsm.odesign at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNodes(SWTBotTreeItem.java:334) at
+ * org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(SWTBotTreeItem.java:308) at
+ * org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode(SWTBotTreeItem.java:346) at
+ * org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.expandNode(SWTBotTreeItem.java:283) at
+ * org.eclipse.sirius.tests.swtbot.support.utils.SWTBotCommonHelper.openEditor(SWTBotCommonHelper.java:138)
+ * at org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase.
+ * openViewpointSpecificationModel(AbstractSiriusSwtBotGefTestCase.java:1553)
*/
return;
}
@@ -156,8 +153,7 @@
}
/**
- * Test that for Create Line Tool and Create Column tool, 'Create View'
- * operation is not available in menu.
+ * Test that for Create Line Tool and Create Column tool, 'Create View' operation is not available in menu.
*/
public void testThatCreateViewNotPresentForCrossTable() {
String operationName = DiagramUIPlugin.getPlugin().getString(CREATE_VIEW);
@@ -169,8 +165,7 @@
}
/**
- * Test that for Create tool and Drop Tool, 'Create View' operation is not
- * available in menu.
+ * Test that for Create tool and Drop Tool, 'Create View' operation is not available in menu.
*/
public void testThatCreateViewNotPresentForTree() {
String operationName = DiagramUIPlugin.getPlugin().getString(CREATE_VIEW);
@@ -182,8 +177,7 @@
}
/**
- * Test that for Create Line Tool, 'Create Edge View' operation is not
- * available in menu.
+ * Test that for Create Line Tool, 'Create Edge View' operation is not available in menu.
*/
public void testThatCreateEdgeViewNotPresentForTable() {
String operationName = DiagramUIPlugin.getPlugin().getString(CREATE_EDGE_VIEW);
@@ -193,8 +187,7 @@
}
/**
- * Test that for Create Line Tool and Create Column tool, 'Create Edge View'
- * operation is not available in menu.
+ * Test that for Create Line Tool and Create Column tool, 'Create Edge View' operation is not available in menu.
*/
public void testThatCreateEdgeViewNotPresentForCrossTable() {
String operationName = DiagramUIPlugin.getPlugin().getString(CREATE_EDGE_VIEW);
@@ -206,8 +199,7 @@
}
/**
- * Test that for Create tool and Drop Tool, 'Create Edge View' operation is
- * not available in menu.
+ * Test that for Create tool and Drop Tool, 'Create Edge View' operation is not available in menu.
*/
public void testThatCreateEdgeViewNotPresentForTree() {
String operationName = DiagramUIPlugin.getPlugin().getString(CREATE_EDGE_VIEW);
@@ -219,8 +211,7 @@
}
/**
- * Test that for Create Line Tool, 'Delete View' operation is not available
- * in menu.
+ * Test that for Create Line Tool, 'Delete View' operation is not available in menu.
*/
public void testThateDeleteViewNotPresentForTable() {
String operationName = SiriusEditPlugin.getPlugin().getString(DELETE_VIEW);
@@ -230,8 +221,7 @@
}
/**
- * Test that for Create Line Tool and Create Column tool, 'Delete View'
- * operation is not available in menu.
+ * Test that for Create Line Tool and Create Column tool, 'Delete View' operation is not available in menu.
*/
public void testThateDeleteViewNotPresentForCrossTable() {
String operationName = SiriusEditPlugin.getPlugin().getString(DELETE_VIEW);
@@ -243,8 +233,7 @@
}
/**
- * Test that for Create tool and Drop Tool, 'Delete View' operation is not
- * available in menu.
+ * Test that for Create tool and Drop Tool, 'Delete View' operation is not available in menu.
*/
public void testThatDeleteViewNotPresentForTree() {
String operationName = SiriusEditPlugin.getPlugin().getString(DELETE_VIEW);
@@ -267,21 +256,22 @@
SWTBotTree tree = odesignEditor.bot().tree();
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode("vsm").expandNode("Diagram").expandNode("Package").expandNode(gradient + " white to light_gray").select();
// set the focus on the Properties view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// set the focus on the General tab
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesView.bot());
// get the label expression
- labelText = bot.viewByTitle(PROPERTIES).bot().text(0);
+ labelText = propertiesView.bot().text(0);
// focus on label field
labelText.setFocus();
String oldLabelExpression = labelText.getText();
// Set label to empty
labelText.setText("");
// set the focus on the General tab
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
bot.saveAllEditors();
// set the focus on the Label tab
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesView.bot());
assertEquals("The label expression should be empty", "", labelText.getText());
odesignEditor.close();
// Open VSM
@@ -289,11 +279,11 @@
// expands the tree : Container style description
odesignEditor.bot().tree().expandNode(ODESIGN).expandNode(GROUP).expandNode("vsm").expandNode("Diagram").expandNode("Package").expandNode(gradient + " white to light_gray").select();
// set the focus on the Properties view
- bot.viewByTitle(PROPERTIES).setFocus();
+ propertiesView.setFocus();
// set the focus on the Label tab
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesView.bot());
// get the label expression
- labelText = bot.viewByTitle(PROPERTIES).bot().text(0);
+ labelText = propertiesView.bot().text(0);
assertEquals("The label expression should be empty", "", labelText.getText());
// set the old label expression
labelText.setText(oldLabelExpression);
@@ -347,12 +337,13 @@
SWTBotTree tree = odesignEditor.bot().tree();
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode("vsm").expandNode("Diagram").expandNode("Package").expandNode(gradient + " white to light_gray").select();
// set the focus on the Properties view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// set the focus on the General tab
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
// check that background style field choices are correct
- SWTBotCCombo ccomboBox = bot.viewByTitle(PROPERTIES).bot().ccomboBox();
+ SWTBotCCombo ccomboBox = propertiesView.bot().ccomboBox();
assertEquals("BackgroundStyle must contain 3 elements", 3, ccomboBox.itemCount());
assertEquals("Fist element must be : " + gradientLeftToRight, gradientLeftToRight, ccomboBox.items()[0]);
assertEquals("Second element must be : " + liquid_oblique, liquid_oblique, ccomboBox.items()[1]);
@@ -361,8 +352,7 @@
}
/**
- * Check that the label size of a style in a diagram description cannot be
- * set as 0.
+ * Check that the label size of a style in a diagram description cannot be set as 0.
*
* @param odesignEditor
*/
@@ -383,8 +373,7 @@
}
/**
- * Check that the label size of a style in a table description cannot be set
- * as 0.
+ * Check that the label size of a style in a table description cannot be set as 0.
*
* @param odesignEditor
*/
@@ -396,8 +385,7 @@
}
/**
- * Check that the label size of a style in a table description cannot be set
- * as 0.
+ * Check that the label size of a style in a table description cannot be set as 0.
*
* @param odesignEditor
*/
@@ -413,12 +401,13 @@
*/
private void processLabelSizeTests(String initialValue) {
// set the focus on the Properties view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// set the focus on the General tab
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesView.bot());
// check that background style field choices are correct
- SWTBotSpinner ccomboBox = bot.viewByTitle(PROPERTIES).bot().spinner();
+ SWTBotSpinner ccomboBox = propertiesView.bot().spinner();
assertEquals("Initial value of the Label Size is expected to be " + initialValue, initialValue, ccomboBox.getText());
ccomboBox.setSelection(3);
assertEquals("Value of the Label Size is expected to have been changed to 3", "3", ccomboBox.getText());
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/pseudoclearcase/DiagramPseudoClearCaseTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/pseudoclearcase/DiagramPseudoClearCaseTest.java
index 2fea4b9..1f2a58f 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/pseudoclearcase/DiagramPseudoClearCaseTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/pseudoclearcase/DiagramPseudoClearCaseTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -22,6 +22,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.view.SiriusOutlineView;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
@@ -84,6 +85,7 @@
*/
public void testNodeDirectEdit() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.directNodeEditType("EC2", "New name but will be discard");
}
@@ -98,6 +100,7 @@
*/
public void testEdgeLabelDirectEdit() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.directEdgeEditType("EC3", "EC2", "New name but will be discard");
}
@@ -112,6 +115,7 @@
*/
public void testMoveDiagramElement() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.drag(PACKAGE_SP1, SOMEWHERE_IN_DIAGRAM.x, SOMEWHERE_IN_DIAGRAM.y);
}
@@ -126,6 +130,7 @@
*/
public void testCreatePackageFromPaletteInDiagram() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Package");
editor.click(SOMEWHERE_IN_DIAGRAM.x, SOMEWHERE_IN_DIAGRAM.y);
@@ -141,6 +146,7 @@
*/
public void testCreatePackageFromPaletteInPackage() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Package");
editor.click(IN_PACKAGE_SP1.x, IN_PACKAGE_SP1.y);
@@ -156,6 +162,7 @@
*/
public void testCreateClassFromPaletteInDiagram() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Class");
editor.click(SOMEWHERE_IN_DIAGRAM.x, SOMEWHERE_IN_DIAGRAM.y);
@@ -171,6 +178,7 @@
*/
public void testCreateClassFromPaletteInPackage() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Class");
editor.click(IN_PACKAGE_SP1.x, IN_PACKAGE_SP1.y);
@@ -186,6 +194,7 @@
*/
public void testCreateOperationInClass() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Operation");
editor.click(IN_ECLASS_EC2.x, IN_ECLASS_EC2.y);
@@ -201,6 +210,7 @@
*/
public void testCreateAttributeInClass() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Attribute");
editor.click(IN_ECLASS_EC2.x, IN_ECLASS_EC2.y);
@@ -216,6 +226,7 @@
*/
public void testCreateSuperTypeBetweenClasses() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("SuperType");
editor.click(IN_ECLASS_EC2.x, IN_ECLASS_EC2.y);
@@ -232,6 +243,7 @@
*/
public void testCreateReferenceBetweenClasses() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Reference");
editor.click(IN_ECLASS_EC2.x, IN_ECLASS_EC2.y);
@@ -248,6 +260,7 @@
*/
public void testPinElementWithPalette() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
editor.activateTool("Pin");
editor.click(IN_ECLASS_EC2.x, IN_ECLASS_EC2.y);
@@ -263,6 +276,7 @@
*/
public void testHideDiagramElement() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
final SWTBotGefEditPart hiddenEditPart = editor.getEditPart(PACKAGE_SP1);
@@ -280,6 +294,7 @@
*/
public void testRevealDiagramElement() throws Exception {
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
final SWTBotGefEditPart diagramEditPart = editor.mainEditPart();
@@ -298,6 +313,7 @@
public void testEnableLayer() throws Exception {
final SiriusOutlineView outlineView = designerViews.getOutlineView().layers();
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
outlineView.activateLayer("Dynamic");
}
@@ -313,6 +329,7 @@
public void testDisableLayer() throws Exception {
final SiriusOutlineView outlineView = designerViews.getOutlineView().layers();
UIThreadRunnable.asyncExec(new VoidResult() {
+ @Override
public void run() {
// Already activated, so becomes deactivated
outlineView.activateLayer("Package");
@@ -327,8 +344,9 @@
* Test error.
*/
public void testAddFilter() throws Exception {
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Filters");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Filters", propertiesView.bot());
final SWTBotTable availableFilters = bot.table(0);
availableFilters.getTableItem("Hide references").select();
@@ -343,8 +361,9 @@
* Test error.
*/
public void testRemoveFilter() throws Exception {
- bot.viewByTitle("Properties").setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem("Filters");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Filters", propertiesView.bot());
final SWTBotTable availableFilters = bot.table(1);
availableFilters.getTableItem("Hide generalizations").select();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/HeaderSequenceDiagramTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/HeaderSequenceDiagramTests.java
index 21a5a7e..518e94d 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/HeaderSequenceDiagramTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/HeaderSequenceDiagramTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.ui.IWorkbenchPart;
@@ -193,7 +194,9 @@
editor.click(1, 1);
- SWTBotSiriusHelper.selectPropertyTabItem("Rulers & Grid");
+ SWTBotView propertiesView = bot.viewByTitle("Properties");
+ propertiesView.setFocus();
+ SWTBotSiriusHelper.selectPropertyTabItem("Rulers & Grid", propertiesView.bot());
bot.checkBox("Show Ruler").select();
Rectangle boundsA = editor.getBounds(editPartA).getCopy();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/SequenceDiagramNoSnapTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/SequenceDiagramNoSnapTest.java
index 303dfd2..5cca617 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/SequenceDiagramNoSnapTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/sequence/SequenceDiagramNoSnapTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 2019 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -54,7 +54,7 @@
SWTBotView propertyView = bot.viewByTitle("Properties");
propertyView.setFocus();
SWTBot propertyViewBot = propertyView.bot();
- SWTBotSiriusHelper.selectPropertyTabItem("Rulers & Grid");
+ SWTBotSiriusHelper.selectPropertyTabItem("Rulers & Grid", propertyViewBot);
SWTBotCheckBox snapToGridCheckBox = propertyViewBot.checkBox("Snap To Grid");
assertFalse(snapToGridCheckBox.isChecked());
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java
index c1e935f..12b47b1 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java
@@ -45,17 +45,18 @@
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckToolIsActivated;
import org.eclipse.sirius.tests.swtbot.support.api.condition.OperationDoneCondition;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotSplitEditor;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefFigureCanvas;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton;
@@ -101,10 +102,9 @@
Messages.EditModeAction_Label, "Font Color", "Fill &Color", "Li&ne Color", "Line Style" };
private static final String[] CONTAINER_TOOLBARBUTTONS_TOOLTIPS = { Messages.PinElementsEclipseAction_text, Messages.UnpinElementsEclipseAction_text, Messages.CopyFormatAction_toolTipText,
- Messages.SiriusDiagramActionBarContributor_showElement,
- Messages.SiriusDiagramActionBarContributor_hideElement, Messages.RevealOutlineLabelsAction_label, Messages.SiriusDiagramActionBarContributor_hideLabel,
- Messages.SiriusDiagramActionBarContributor_deleteFromDiagram,
- Messages.SiriusDiagramActionBarContributor_deleteFromModel, "Font", Messages.SetStyleToWorkspaceImageAction_text, Messages.ResetStylePropertiesToDefaultValuesAction_text,
+ Messages.SiriusDiagramActionBarContributor_showElement, Messages.SiriusDiagramActionBarContributor_hideElement, Messages.RevealOutlineLabelsAction_label,
+ Messages.SiriusDiagramActionBarContributor_hideLabel, Messages.SiriusDiagramActionBarContributor_deleteFromDiagram, Messages.SiriusDiagramActionBarContributor_deleteFromModel, "Font",
+ Messages.SetStyleToWorkspaceImageAction_text, Messages.ResetStylePropertiesToDefaultValuesAction_text,
"Apply the applicable appearance properties of the last selected shape to the other selected shapes.", "Make height and width same size", "Auto Size" };
private static final String[] CONTAINER_TOOLBARTOGGLEBUTTONS_TOOLTIPS = { "Bold Font Style", "Italic Font Style" };
@@ -210,9 +210,9 @@
SWTBotTreeItem representationTreeItem = localSession.getLocalSessionBrowser().perCategory().selectViewpoint(VIEWPOINT_NAME).selectRepresentation(REPRESENTATION_NAME)
.selectRepresentationInstance(REPRESENTATION_INSTANCE_NAME, UIDiagramRepresentation.class).getTreeItem().select();
SWTBotUtils.clickContextMenu(representationTreeItem, "Copy");
- bot.waitUntilWidgetAppears(Conditions.shellIsActive("Copy representation"));
- bot.text(REPRESENTATION_INSTANCE_NAME).setText(REPRESENTATION_INSTANCE_NAME + "_Copy");
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Copy representation");
+ wizardBot.text(REPRESENTATION_INSTANCE_NAME).setText(REPRESENTATION_INSTANCE_NAME + "_Copy");
+ wizardBot.button("OK").click();
SWTBotSiriusDiagramEditor editorCopy = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME, REPRESENTATION_INSTANCE_NAME + "_Copy",
DDiagram.class);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/table/SetPropertyOfTableTreeByPropertiesViewTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/table/SetPropertyOfTableTreeByPropertiesViewTest.java
index aa2518e..09fd55e 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/table/SetPropertyOfTableTreeByPropertiesViewTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/table/SetPropertyOfTableTreeByPropertiesViewTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -30,9 +30,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
/**
- * Test setting property of a table editor by the properties view with an other
- * editor tree open and setting property of a tree editor by the properties view
- * with an other table editor open. Test VP-1896.
+ * Test setting property of a table editor by the properties view with an other editor tree open and setting property of
+ * a tree editor by the properties view with an other table editor open. Test VP-1896.
*
*
* @author jdupont
@@ -88,8 +87,8 @@
* <p>
* Step 2 : select an element
* <p>
- * Step 3 : check the properties view title is equals to the label of the
- * semantic element ("equals" -> the title comes from the item provider.
+ * Step 3 : check the properties view title is equals to the label of the semantic element ("equals" -> the title
+ * comes from the item provider.
*/
public void testTablePropertiesViewTitle() {
// Step 1: open table
@@ -114,8 +113,8 @@
* <p>
* Step 2 : select an element
* <p>
- * Step 3 : check the properties view title is equals to the label of the
- * semantic element ("equals" -> the title comes from the item provider.
+ * Step 3 : check the properties view title is equals to the label of the semantic element ("equals" -> the title
+ * comes from the item provider.
*/
public void testTreePropertiesViewTitle() {
// Step 1: open tree
@@ -124,7 +123,7 @@
// Step 2: select a table element.
tree.getTree().select(0, 0);
- String cell = tree.getTree().selection().get(0,0);
+ String cell = tree.getTree().selection().get(0, 0);
// Step 3: check the properties view title.
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
@@ -135,19 +134,16 @@
}
/**
- * Test modify string field (name of semantic element) in property view of
- * table.
+ * Test modify string field (name of semantic element) in property view of table.
* <P>
* Step 1 : open a tree and table representations
* <p>
* Step 2 : change name of semantic element
* <p>
- * Step 3 : Verify that the tree and table representation element have name
- * modified
+ * Step 3 : Verify that the tree and table representation element have name modified
* <p>
- * Step 4 : Undo change; Verify that the tree and table representation have
- * the name stating. Verify that the undo command next, has nothing to do
- * with renaming.
+ * Step 4 : Undo change; Verify that the tree and table representation have the name stating. Verify that the undo
+ * command next, has nothing to do with renaming.
*/
public void testModifyTablePropertyViewStringField() {
// Step 1 : open tree and table
@@ -171,19 +167,16 @@
}
/**
- * Test modify string field (name of semantic element) in property view of
- * tree.
+ * Test modify string field (name of semantic element) in property view of tree.
* <P>
* Step 1 : open a tree and table representations
* <p>
* Step 2 : change name of semantic element
* <p>
- * Step 3 : Verify that the tree and table representation element have name
- * modified
+ * Step 3 : Verify that the tree and table representation element have name modified
* <p>
- * Step 4 : Undo change; Verify that the tree and table representation have
- * the name stating. Verify that the undo command next, has nothing to do
- * with renaming.
+ * Step 4 : Undo change; Verify that the tree and table representation have the name stating. Verify that the undo
+ * command next, has nothing to do with renaming.
*/
public void testModifyTreePropertyViewStringField() {
// Step 1 : open tree and table
@@ -207,19 +200,16 @@
}
/**
- * Test modify boolean field (field to pass semantic element to abstract) in
- * property view of table.
+ * Test modify boolean field (field to pass semantic element to abstract) in property view of table.
* <P>
* Step 1 : open a tree and table representations
* <p>
* Step 2 : change type abstract of semantic element
* <p>
- * Step 3 : Verify that the tree and table representation have abstract type
- * modified
+ * Step 3 : Verify that the tree and table representation have abstract type modified
* <p>
- * Step 4 : Undo change; Verify that the tree and table representation have
- * the abstract stating. Verify that the undo command next, has nothing to
- * do with change abstract.
+ * Step 4 : Undo change; Verify that the tree and table representation have the abstract stating. Verify that the
+ * undo command next, has nothing to do with change abstract.
*/
public void testModifyTablePropertyViewBooleanField() {
// Step 1 : open tree and table
@@ -245,19 +235,16 @@
}
/**
- * Test modify boolean field (field to pass semantic element to abstract) in
- * property view of tree.
+ * Test modify boolean field (field to pass semantic element to abstract) in property view of tree.
* <P>
* Step 1 : open a tree and table representations
* <p>
* Step 2 : change type abstract of semantic element
* <p>
- * Step 3 : Verify that the tree and table representation have abstract type
- * modified
+ * Step 3 : Verify that the tree and table representation have abstract type modified
* <p>
- * Step 4 : Undo change; Verify that the tree and table representation have
- * the abstract stating. Verify that the undo command next, has nothing to
- * do with change abstract.
+ * Step 4 : Undo change; Verify that the tree and table representation have the abstract stating. Verify that the
+ * undo command next, has nothing to do with change abstract.
*/
public void testModifyTreePropertyViewBooleanField() {
// Step 1 : open tree and table
@@ -331,7 +318,7 @@
table.getTable().getTreeItem(content).select();
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC);
+ SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode(content).select().getNode("Name").doubleClick();
SWTBotText text = propertiesBot.bot().text();
@@ -353,7 +340,7 @@
tree.getTree().getTreeItem(content).select();
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC);
+ SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode(content).select().getNode("Name").doubleClick();
SWTBotText text = propertiesBot.bot().text();
@@ -372,7 +359,7 @@
swtBotTree.getTreeItem(content).select();
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC);
+ SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode(content).select().getNode("Abstract").doubleClick();
if (TestsUtil.isPhotonPlatformOrLater()) {
@@ -440,7 +427,7 @@
swtBotTree.getTreeItem(element).select();
SWTBotView propertiesBot = bot.viewByTitle(PROPERTIES);
propertiesBot.setFocus();
- SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC);
+ SWTBotSiriusHelper.selectPropertyTabItem(SEMANTIC, propertiesBot.bot());
SWTBotTree tree = propertiesBot.bot().tree();
tree.expandNode(element).select().getNode("Abstract").doubleClick();
boolean value;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/AbstractTreeSiriusSWTBotGefTestCase.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/AbstractTreeSiriusSWTBotGefTestCase.java
index eee4169..0054caf 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/AbstractTreeSiriusSWTBotGefTestCase.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/AbstractTreeSiriusSWTBotGefTestCase.java
@@ -115,8 +115,8 @@
* @param widget
* the tree item widget.
*
- * @return the background color on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the background color on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public Color getWidgetBackgroundColor(final TreeItem widget) {
@@ -134,8 +134,7 @@
* @param widget
* the tree item widget.
*
- * @return the label color on the widget, or <code>null</code> if the widget
- * is not an instance of {@link Control}.
+ * @return the label color on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public Color getWidgetLabelColor(final TreeItem widget) {
@@ -154,8 +153,8 @@
* @param widget
* the tree item widget.
*
- * @return the label expression on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the label expression on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public String getWidgetLabelExpression(final TreeItem widget) {
@@ -174,8 +173,7 @@
* @param widget
* the tree item widget.
*
- * @return the image on the widget, or <code>null</code> if the widget is
- * not an instance of {@link Control}.
+ * @return the image on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public Image getWidgetImage(final TreeItem widget) {
@@ -194,8 +192,8 @@
* @param widget
* the tree item widget.
*
- * @return the size of the label on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the size of the label on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public Integer getWidgetSize(final TreeItem widget) {
@@ -219,8 +217,7 @@
* @param widget
* the tree item widget.
*
- * @return the label size on the widget, or <code>null</code> if the widget
- * is not an instance of {@link Control}.
+ * @return the label size on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public int getLabelSize(final TreeItem widget) {
@@ -238,8 +235,8 @@
* @param widget
* the tree item widget.
*
- * @return the label background color on the widget, or <code>null</code> if
- * the widget is not an instance of {@link Control}.
+ * @return the label background color on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public Color getLabelBackgroundColor(final TreeItem widget) {
@@ -257,8 +254,7 @@
* @param widget
* the tree item widget.
*
- * @return the label color on the widget, or <code>null</code> if the widget
- * is not an instance of {@link Control}.
+ * @return the label color on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public Color getLabelColor(final TreeItem widget) {
@@ -312,8 +308,8 @@
* @param widget
* the tree item widget.
*
- * @return the semantic element on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the semantic element on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public String getSemanticElement(final TreeItem widget) {
@@ -331,8 +327,7 @@
* @param widget
* the tree item widget.
*
- * @return the domain class on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the domain class on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public String getDomainClass(final TreeItem widget) {
@@ -350,8 +345,7 @@
* @param widget
* the tree item widget.
*
- * @return the id on the widget, or <code>null</code> if the widget is not
- * an instance of {@link Control}.
+ * @return the id on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public String getId(final TreeItem widget) {
@@ -369,8 +363,7 @@
* @param widget
* the tree item widget.
*
- * @return the label on the widget, or <code>null</code> if the widget is
- * not an instance of {@link Control}.
+ * @return the label on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public String getLabel(final TreeItem widget) {
@@ -388,8 +381,8 @@
* @param widget
* the tree item widget.
*
- * @return the precondition expression on the widget, or <code>null</code>
- * if the widget is not an instance of {@link Control}.
+ * @return the precondition expression on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public String getPreconditionExpression(final TreeItem widget) {
@@ -407,8 +400,7 @@
* @param widget
* the tree item widget.
*
- * @return the semantic candidate expression on the widget, or
- * <code>null</code> if the widget is not an instance of
+ * @return the semantic candidate expression on the widget, or <code>null</code> if the widget is not an instance of
* {@link Control}.
* @since 1.0
*/
@@ -427,8 +419,8 @@
* @param widget
* the tree item widget.
*
- * @return the reused tree item mappings on the widget, or <code>null</code>
- * if the widget is not an instance of {@link Control}.
+ * @return the reused tree item mappings on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public EList<TreeItemMapping> getReusedTreeItemMappings(final TreeItem widget) {
@@ -446,8 +438,8 @@
* @param widget
* the tree item widget.
*
- * @return the detail description on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the detail description on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public EList<RepresentationCreationDescription> getDetailDescriptions(final TreeItem widget) {
@@ -465,8 +457,8 @@
* @param widget
* the tree item widget.
*
- * @return the navigation description on the widget, or <code>null</code> if
- * the widget is not an instance of {@link Control}.
+ * @return the navigation description on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public EList<RepresentationNavigationDescription> getNavigationDescriptions(final TreeItem widget) {
@@ -484,8 +476,7 @@
* @param widget
* the tree item widget.
*
- * @return the label format on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the label format on the widget, or <code>null</code> if the widget is not an instance of {@link Control}.
* @since 1.0
*/
public List<String> getLabelFormat(final TreeItem widget) {
@@ -511,8 +502,8 @@
* @param widget
* the tree item widget.
*
- * @return the label alignment on the widget, or <code>null</code> if the
- * widget is not an instance of {@link Control}.
+ * @return the label alignment on the widget, or <code>null</code> if the widget is not an instance of
+ * {@link Control}.
* @since 1.0
*/
public String getLabelAlignment(final TreeItem widget) {
@@ -546,10 +537,11 @@
* the name of viewpoint specification model (.odesing)
*/
public void closeAndSaveViewpointSpecificationModel(String viewpointSpecificationModel) {
- bot.editorByTitle(viewpointSpecificationModel).setFocus();
- bot.menu(FILE).menu(SAVE).click();
- bot.editorByTitle(viewpointSpecificationModel).setFocus();
- bot.editorByTitle(viewpointSpecificationModel).close();
+ SWTBotEditor editorBot = bot.editorByTitle(viewpointSpecificationModel);
+ editorBot.setFocus();
+ editorBot.bot().menu(FILE).menu(SAVE).click();
+ editorBot.setFocus();
+ editorBot.close();
}
/**
@@ -560,11 +552,9 @@
* @param viewpointName
* the viewpoint name
* @param representationName
- * the representation name in representation per
- * resource/category
+ * the representation name in representation per resource/category
* @param representationInstanceName
- * the representation instance name in representation per
- * category/resource
+ * the representation instance name in representation per category/resource
* @return treeRepresentation corresponding.
*/
public UITreeRepresentation openEditor(UILocalSession localSession, String viewpointName, String representationName, String representationInstanceName) {
@@ -579,13 +569,13 @@
* the name of viewpoint specification model (.odesing).
*/
public void saveViewpointSpecificationModel(String viewpointSpecificationModel) {
- bot.editorByTitle(viewpointSpecificationModel).setFocus();
- bot.menu(FILE).menu(SAVE).click();
+ SWTBotEditor editorBot = bot.editorByTitle(viewpointSpecificationModel);
+ editorBot.setFocus();
+ editorBot.bot().menu(FILE).menu(SAVE).click();
}
/**
- * Close and save viewpoint specification model, close and save viewpoint
- * editor and close and save session.
+ * Close and save viewpoint specification model, close and save viewpoint editor and close and save session.
*
* @param viewpointSpecificationModel
* the viewpoint specification model name
@@ -595,10 +585,11 @@
* the local session
*/
public void closeAndSaveAll(String viewpointSpecificationModel, SWTBotEditor editor, UILocalSession localSession) {
- bot.editorByTitle(viewpointSpecificationModel).setFocus();
- bot.menu(FILE).menu(SAVE).click();
- bot.editorByTitle(viewpointSpecificationModel).setFocus();
- bot.editorByTitle(viewpointSpecificationModel).close();
+ SWTBotEditor editorBot = bot.editorByTitle(viewpointSpecificationModel);
+ editorBot.setFocus();
+ editorBot.bot().menu(FILE).menu(SAVE).click();
+ editorBot.setFocus();
+ editorBot.close();
}
/**
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/ConditionalTreeItemStyleDescriptionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/ConditionalTreeItemStyleDescriptionTest.java
index afadb90..0c98f6e 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/ConditionalTreeItemStyleDescriptionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/ConditionalTreeItemStyleDescriptionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -26,14 +26,14 @@
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Test;
/**
- * Test condtional tree item description. Test automatic refresh and manual
- * refresh. Test undo/redo after each test type Test opening and closing model
- * or editor to verify that all changes are effective
+ * Test condtional tree item description. Test automatic refresh and manual refresh. Test undo/redo after each test type
+ * Test opening and closing model or editor to verify that all changes are effective
*
* @author jdupont
*/
@@ -280,10 +280,10 @@
String treeItemName = null;
if (editor.bot().tree().getAllItems().length > 0) {
- treeItemName = ((SWTBotTreeItem) editor.bot().tree().getAllItems()[1]).getText();
+ treeItemName = editor.bot().tree().getAllItems()[1].getText();
}
if (treeItemName != null) {
- widgetTestTailleNomSup13 = (TreeItem) editor.bot().tree().getTreeItem(treeItemName).widget;
+ widgetTestTailleNomSup13 = editor.bot().tree().getTreeItem(treeItemName).widget;
}
Color colorBackground = null;
@@ -328,7 +328,7 @@
}
}
if (treeItemName != null) {
- widgetTestTailleNomSup13 = (TreeItem) editor.bot().tree().getTreeItem(treeItemName).widget;
+ widgetTestTailleNomSup13 = editor.bot().tree().getTreeItem(treeItemName).widget;
}
labelColor = getLabelColor(widgetTestTailleNomSup13);
@@ -341,7 +341,7 @@
SWTBotUtils.waitAllUiEvents();
// Undo
- bot.menu("Edit").menu(UNDO).click();
+ editor.bot().menu("Edit").menu(UNDO).click();
if (editor.bot().tree().getAllItems().length > 0) {
for (SWTBotTreeItem treeItem : editor.bot().tree().getAllItems()) {
@@ -352,7 +352,7 @@
}
}
if (treeItemName != null) {
- widgetTestTailleNomSup13 = (TreeItem) editor.bot().tree().getTreeItem(treeItemName).widget;
+ widgetTestTailleNomSup13 = editor.bot().tree().getTreeItem(treeItemName).widget;
}
labelColor = getLabelColor(widgetTestTailleNomSup13);
@@ -365,7 +365,7 @@
// SWTBotUtils.waitAllUiEvents();
// ReDo
- bot.menu("Edit").menu(REDO).click();
+ editor.bot().menu("Edit").menu(REDO).click();
SWTBotUtils.waitAllUiEvents();
if (editor.bot().tree().getAllItems().length > 0) {
@@ -377,7 +377,7 @@
}
}
if (treeItemName != null) {
- widgetTestTailleNomSup13 = (TreeItem) editor.bot().tree().getTreeItem(treeItemName).widget;
+ widgetTestTailleNomSup13 = editor.bot().tree().getTreeItem(treeItemName).widget;
}
labelColor = getLabelColor(widgetTestTailleNomSup13);
@@ -399,8 +399,7 @@
}
/**
- * Modify all fields in properties view of tree item style description in
- * viewpoint specific model (.odesign).
+ * Modify all fields in properties view of tree item style description in viewpoint specific model (.odesign).
*
* @param odesignEditor
* the odesign editor.
@@ -411,12 +410,13 @@
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode("Design").expandNode("Tree").expandNode("Class").expandNode("Conditional Style").select();
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// accesses to tab General
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
changeAndTestPropertyTabGeneral("aql:self.name.size() > 13");
- SWTBotSiriusHelper.selectPropertyTabItem("All");
+ SWTBotSiriusHelper.selectPropertyTabItem("All", propertiesView.bot());
odesignEditor.bot().tree().setFocus();
// Save odesign
@@ -446,7 +446,7 @@
}
}
if (treeItemName != null) {
- widgetTestTailleNomSup13 = (TreeItem) editor.bot().tree().getTreeItem(treeItemName).widget;
+ widgetTestTailleNomSup13 = editor.bot().tree().getTreeItem(treeItemName).widget;
}
Color colorBackground = null;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/CopyTreeRepresentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/CopyTreeRepresentationTest.java
index 523e810..dd14666 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/CopyTreeRepresentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/CopyTreeRepresentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -15,9 +15,11 @@
import org.eclipse.sirius.tests.swtbot.Activator;
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Test;
@@ -98,9 +100,9 @@
treeItem = localSession.getLocalSessionBrowser().perSemantic().expandNode("p1").expandNode("myTree").select();
// Copy tree
SWTBotUtils.clickContextMenu(treeItem, "Copy");
-
- bot.activeShell().bot().text(0).setText("myTreeCopy");
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Copy representation");
+ wizardBot.text(0).setText("myTreeCopy");
+ wizardBot.button("OK").click();
treeItem = localSession.getLocalSessionBrowser().perSemantic().expandNode("p1").expandNode("myTreeCopy").select();
@@ -117,8 +119,9 @@
private void createTree(SWTBotTreeItem treeItem) {
SWTBotUtils.clickContextMenu(treeItem, "new Tree");
- bot.activeShell().bot().text(0).setText("myTree");
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New Tree");
+ wizardBot.text(0).setText("myTree");
+ wizardBot.button("OK").click();
SWTBotVSMEditor odesignEditor = SWTBotVSMHelper.getVSMEditorContainingName("myTree");
odesignEditor.setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/NavigateInTreeRepresentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/NavigateInTreeRepresentationTest.java
index 0acb508..559d89a 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/NavigateInTreeRepresentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/NavigateInTreeRepresentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,10 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.business.UITreeRepresentation;
+import org.eclipse.sirius.tests.swtbot.support.api.business.sessionbrowser.UILSCategoryBrowser;
+import org.eclipse.sirius.tests.swtbot.support.api.business.sessionbrowser.UILSRepresentationBrowser;
+import org.eclipse.sirius.tests.swtbot.support.api.business.sessionbrowser.UILSViewpointBrowser;
+import org.eclipse.sirius.tests.swtbot.support.api.business.sessionbrowser.UILocalSessionBrowser;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
@@ -65,17 +69,11 @@
*/
private UILocalSession localSession;
- /**
- * {@inheritDoc}
- */
@Override
protected void onSetUpBeforeClosingWelcomePage() throws Exception {
copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE, ECORE_FILE);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception {
sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE);
@@ -91,21 +89,35 @@
*/
@Test
public void testNavigationInTreeRepresentation() throws Exception {
- final UITreeRepresentation tree = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Tree").selectTreeInstance("new Tree").open();
- assertEquals("The tree editor was not open.", bot.activeEditor().getTitle(), ("new Tree"));
- // navigate from the context menu
- SWTBotTree select = tree.getEditorBot().tree().select("EClass1");
- SWTBotUtils.clickContextMenu(select, "new Tree Creation on Class");
- bot.waitUntil(new DefaultCondition() {
+ UITreeRepresentation tree;
+ try {
+ UILocalSessionBrowser localSessionBrowser = localSession.getLocalSessionBrowser();
+ UILSCategoryBrowser perCategory = localSessionBrowser.perCategory();
+ UILSViewpointBrowser selectViewpoint = perCategory.selectViewpoint("Design");
+ UILSRepresentationBrowser selectRepresentation = selectViewpoint.selectRepresentation("Tree");
+ UITreeRepresentation selectTreeInstance = selectRepresentation.selectTreeInstance("new Tree");
+ tree = selectTreeInstance.open();
- public boolean test() throws Exception {
- return ((SWTWorkbenchBot) bot).activeEditor().getTitle().equals("new Tree Creation on Class");
- }
+ assertEquals("The tree editor was not open.", bot.activeEditor().getTitle(), ("new Tree"));
+ // navigate from the context menu
+ SWTBotTree select = tree.getEditorBot().tree().select("EClass1");
+ SWTBotUtils.clickContextMenu(select, "new Tree Creation on Class");
+ bot.waitUntil(new DefaultCondition() {
- public String getFailureMessage() {
- return "The tree editor was not open from the navigate menu.";
- }
- });
+ @Override
+ public boolean test() throws Exception {
+ return ((SWTWorkbenchBot) bot).activeEditor().getTitle().equals("new Tree Creation on Class");
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "The tree editor was not open from the navigate menu.";
+ }
+ });
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ }
assertEquals("The tree editor was not open from the navigate menu.", bot.activeEditor().getTitle(), ("new Tree Creation on Class"));
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/OpenCloseCreateDeleteTreeRepresentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/OpenCloseCreateDeleteTreeRepresentationTest.java
index 5573dd4..a93ebc4 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/OpenCloseCreateDeleteTreeRepresentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/OpenCloseCreateDeleteTreeRepresentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -23,7 +23,7 @@
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
-import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Test;
@@ -151,9 +151,9 @@
*/
private void createTree(SWTBotTreeItem treeItem) {
SWTBotUtils.clickContextMenu(treeItem, "new Tree");
-
- bot.activeShell().bot().text(0).setText(editor);
- bot.button(OK).click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New Tree");
+ wizardBot.text(0).setText(editor);
+ wizardBot.button(OK).click();
// waiting for editor opening
SWTBotSiriusHelper.getTreeDialectEditorBots(editor);
treeItem = localSession.getLocalSessionBrowser().perSemantic().expandNode(P1).expandNode(editor).select();
@@ -207,8 +207,8 @@
private void deleteTree(SWTBotTreeItem treeItem) {
treeItem = localSession.getLocalSessionBrowser().perSemantic().expandNode(P1).expandNode(editor).select();
SWTBotUtils.clickContextMenu(treeItem, "Delete");
- bot.waitUntil(Conditions.shellIsActive("Delete representation"));
- bot.button(OK).click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Delete representation");
+ wizardBot.button(OK).click();
try {
treeItem = localSession.getLocalSessionBrowser().perSemantic().expandNode(P1).expandNode(editor).select();
assertFalse("The DTree editor must be delete", true);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/RenameTreeRepresentationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/RenameTreeRepresentationTest.java
index 94c57c3..ebe0055 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/RenameTreeRepresentationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/RenameTreeRepresentationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,10 +16,11 @@
import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
import org.eclipse.sirius.tests.swtbot.support.api.condition.TreeItemTextCondition;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMEditor;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotVSMHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Test;
@@ -116,8 +117,11 @@
// Rename tree
SWTBotUtils.clickContextMenu(treeItem, "Rename");
- bot.activeShell().bot().text(0).setText(TREE_RENAME);
- bot.button("OK").click();
+
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("Rename representation");
+
+ wizardBot.text(0).setText(TREE_RENAME);
+ wizardBot.button("OK").click();
bot.waitUntil(new TreeItemTextCondition(treeItem, TREE_RENAME));
@@ -137,10 +141,9 @@
private void createTree(SWTBotTreeItem treeItem) {
SWTBotUtils.clickContextMenu(treeItem, "new Tree");
- bot.waitUntil(Conditions.shellIsActive("New Tree"));
-
- bot.activeShell().bot().text(0).setText(TREE_NAME);
- bot.button("OK").click();
+ SWTBot wizardBot = SWTBotSiriusHelper.getShellBot("New Tree");
+ wizardBot.text(0).setText(TREE_NAME);
+ wizardBot.button("OK").click();
SWTBotVSMEditor odesignEditor = SWTBotVSMHelper.getVSMEditorContainingName(TREE_NAME);
odesignEditor.setFocus();
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemMappingTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemMappingTest.java
index 2059190..4df507a 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemMappingTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemMappingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -28,14 +28,14 @@
import org.eclipse.sirius.viewpoint.description.tool.RepresentationNavigationDescription;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.junit.Test;
/**
- * Test tree item mapping. Test automatic refresh and manual refresh. Test
- * undo/redo after each test type Test opening and closing model or editor to
- * verify that all changes are effective
+ * Test tree item mapping. Test automatic refresh and manual refresh. Test undo/redo after each test type Test opening
+ * and closing model or editor to verify that all changes are effective
*
* @author jdupont
*/
@@ -183,7 +183,7 @@
editor.setFocus();
// Manual refreh with click context menu
- bot.toolbarButtonWithTooltip("Force a refresh of the tree").click();
+ editor.bot().toolbarButtonWithTooltip("Force a refresh of the tree").click();
refreshEditorTest();
@@ -310,8 +310,7 @@
}
/**
- * Modify all fields in properties view of tree item style description in
- * viewpoint specific model (.odesign).
+ * Modify all fields in properties view of tree item style description in viewpoint specific model (.odesign).
*
* @param odesignEditor
* the odesign editor.
@@ -322,22 +321,23 @@
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode("Design").expandNode("Tree").expandNode("Enum").select();
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView propertiesView = bot.viewByTitle(PROPERTIES);
+ propertiesView.setFocus();
// accesses to tab General
- SWTBotSiriusHelper.selectPropertyTabItem(GENERAL);
+ SWTBotSiriusHelper.selectPropertyTabItem(GENERAL, propertiesView.bot());
changeAndTestPropertyTabGeneral("EDataType", "DataTypeId", "DataType", "[eContents()->select(not oclIsKindOf(EObject) or oclIsKindOf(EDataType))/]");
// accesses to tab import
- SWTBotSiriusHelper.selectPropertyTabItem(IMPORT);
+ SWTBotSiriusHelper.selectPropertyTabItem(IMPORT, propertiesView.bot());
// changeAndTestPropertyTabImport("");
// accesses to tab Behaviour
- SWTBotSiriusHelper.selectPropertyTabItem(BEHAVIOR);
+ SWTBotSiriusHelper.selectPropertyTabItem(BEHAVIOR, propertiesView.bot());
// changeAndTestPropertyTabBehavior("", "");
// accesses to tab Advanced
- SWTBotSiriusHelper.selectPropertyTabItem(ADVANCED);
+ SWTBotSiriusHelper.selectPropertyTabItem(ADVANCED, propertiesView.bot());
changeAndTestPropertyTabAdvanced("[eContents()->select(not oclIsKindOf(EObject) or oclIsKindOf(EAttribute))/]", "[name.size() > 4/]");
// Save odesign
@@ -357,7 +357,7 @@
TreeItem widgetDataType = null;
if (editor.bot().tree().getTreeItem("datatype").widget instanceof TreeItem) {
- widgetDataType = (TreeItem) editor.bot().tree().getTreeItem("datatype").widget;
+ widgetDataType = editor.bot().tree().getTreeItem("datatype").widget;
}
String semanticElement = null;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemStyleDescriptionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemStyleDescriptionTest.java
index b29b80b..59ab754 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemStyleDescriptionTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tree/TreeItemStyleDescriptionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -39,14 +39,15 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.ui.PlatformUI;
import org.junit.Test;
/**
- * Test Style description item. Test automatic refresh and manual refresh. Test
- * undo/redo after each test type Test opening and closing model or editor to
- * verify that all changes are effective
+ * Test Style description item. Test automatic refresh and manual refresh. Test undo/redo after each test type Test
+ * opening and closing model or editor to verify that all changes are effective
*
* @author jdupont
*/
@@ -324,10 +325,8 @@
}
/**
- * Tests that the Sirius tree item's font size is the runtime one and not
- * the VSM one when the option
- * {@link SiriusTreeUiPreferencesKeys#PREF_ALWAYS_USE_STANDARD_FONT_SIZE} is
- * set to true.
+ * Tests that the Sirius tree item's font size is the runtime one and not the VSM one when the option
+ * {@link SiriusTreeUiPreferencesKeys#PREF_ALWAYS_USE_STANDARD_FONT_SIZE} is set to true.
*/
@Test
public void testTreeItemStyleWithStandardFontSizeOptionActivated() {
@@ -450,8 +449,7 @@
}
/**
- * Modify all fields in properties view of tree item style description in
- * viewpoint specific model (.odesign).
+ * Modify all fields in properties view of tree item style description in viewpoint specific model (.odesign).
*
* @param odesignEditor
* the odesign editor.
@@ -462,20 +460,22 @@
tree.expandNode(ODESIGN).expandNode(GROUP).expandNode("Design").expandNode("Tree").expandNode("Class").expandNode("feature:name").select();
// accesses to property view
- bot.viewByTitle(PROPERTIES).setFocus();
+ SWTBotView viewByTitle = bot.viewByTitle(PROPERTIES);
+ viewByTitle.setFocus();
+ SWTBot propertiesViewBot = viewByTitle.bot();
// accesses to tab Label
- SWTBotSiriusHelper.selectPropertyTabItem(LABEL);
- changeShowIcon();
- changeAndTestPropertyTabLabel(8, 12, "feature:name", "aql:'Test' + self.name", 0, 1);
+ SWTBotSiriusHelper.selectPropertyTabItem(LABEL, propertiesViewBot);
+ changeShowIcon(propertiesViewBot);
+ changeAndTestPropertyTabLabel(8, 12, "feature:name", "aql:'Test' + self.name", 0, 1, propertiesViewBot);
SWTBotUtils.waitAllUiEvents();
// Save odesign
saveViewpointSpecificationModel(VSM);
SWTBotUtils.waitAllUiEvents();
// accesses to tab Color
- SWTBotSiriusHelper.selectPropertyTabItem(COLOR);
- changeAndTestPropertyTabColor(17, 1, 13, 2);
+ SWTBotSiriusHelper.selectPropertyTabItem(COLOR, propertiesViewBot);
+ changeAndTestPropertyTabColor(17, 1, 13, 2, propertiesViewBot);
// Save odesign
saveViewpointSpecificationModel(VSM);
@@ -506,13 +506,15 @@
/**
* Retrieve, test, change and test all fields in General tab.
+ *
+ * @param swtBot
*/
- private void changeShowIcon() {
+ private void changeShowIcon(SWTBot swtBot) {
// Retrieve show icon check
- assertFalse(bot.viewByTitle(PROPERTIES).bot().checkBox(4).isChecked());
+ assertFalse(swtBot.checkBox(4).isChecked());
// Check show icon
- bot.viewByTitle(PROPERTIES).bot().checkBox(4).click();
- assertTrue(bot.viewByTitle(PROPERTIES).bot().checkBox(4).isChecked());
+ swtBot.checkBox(4).click();
+ assertTrue(swtBot.checkBox(4).isChecked());
}
/**
@@ -534,28 +536,30 @@
* the index of radio button for label format
* @param newValueLabelFormat
* the index of radio button for new label format
+ * @param swtBot
*/
- private void changeAndTestPropertyTabLabel(int valueLabelSize, int newValueLabelSize, String valueLabelExpression, String newValueLabelExpression, int valueLabelFormat, int newValueLabelFormat) {
+ private void changeAndTestPropertyTabLabel(int valueLabelSize, int newValueLabelSize, String valueLabelExpression, String newValueLabelExpression, int valueLabelFormat, int newValueLabelFormat,
+ SWTBot swtBot) {
// Retrieve label format
- assertTrue(bot.viewByTitle(PROPERTIES).bot().checkBox(valueLabelFormat).isChecked());
+ assertTrue(swtBot.checkBox(valueLabelFormat).isChecked());
// Change label format
- bot.viewByTitle(PROPERTIES).bot().checkBox(newValueLabelFormat).click();
- assertTrue(bot.viewByTitle(PROPERTIES).bot().checkBox(newValueLabelFormat).isChecked());
+ swtBot.checkBox(newValueLabelFormat).click();
+ assertTrue(swtBot.checkBox(newValueLabelFormat).isChecked());
// Retrieve label expression
- assertThat(bot.viewByTitle(PROPERTIES).bot().text(0).getText(), equalTo(valueLabelExpression));
+ assertThat(swtBot.text(0).getText(), equalTo(valueLabelExpression));
// Retrieve label size
- assertThat(bot.viewByTitle(PROPERTIES).bot().spinner(0).getSelection(), equalTo(valueLabelSize));
+ assertThat(swtBot.spinner(0).getSelection(), equalTo(valueLabelSize));
// Change label size
- bot.viewByTitle(PROPERTIES).bot().spinner(0).setFocus();
- bot.viewByTitle(PROPERTIES).bot().spinner(0).setSelection(newValueLabelSize);
- assertThat(bot.viewByTitle(PROPERTIES).bot().spinner(0).getSelection(), equalTo(newValueLabelSize));
- SWTBotUtils.pressEnterKey(bot.viewByTitle(PROPERTIES).bot().spinner(0).widget);
+ swtBot.spinner(0).setFocus();
+ swtBot.spinner(0).setSelection(newValueLabelSize);
+ assertThat(swtBot.spinner(0).getSelection(), equalTo(newValueLabelSize));
+ SWTBotUtils.pressEnterKey(swtBot.spinner(0).widget);
// Change label expression
- bot.viewByTitle(PROPERTIES).bot().text(0).setFocus();
- bot.viewByTitle(PROPERTIES).bot().text(0).setText(newValueLabelExpression);
- assertThat(bot.viewByTitle(PROPERTIES).bot().text(0).getText(), equalTo(newValueLabelExpression));
- SWTBotUtils.pressEnterKey(bot.viewByTitle(PROPERTIES).bot().spinner(0).widget);
+ swtBot.text(0).setFocus();
+ swtBot.text(0).setText(newValueLabelExpression);
+ assertThat(swtBot.text(0).getText(), equalTo(newValueLabelExpression));
+ SWTBotUtils.pressEnterKey(swtBot.spinner(0).widget);
}
/**
@@ -570,20 +574,20 @@
* @param newLabelColorValue
* index for the new label color value
*/
- private void changeAndTestPropertyTabColor(int backgroundValue, int newBackgroundValue, int labelColorValue, int newLabelColorValue) {
+ private void changeAndTestPropertyTabColor(int backgroundValue, int newBackgroundValue, int labelColorValue, int newLabelColorValue, SWTBot swtBot) {
// Retrieve color for Background Color and verify equal to light_yellow
- String backgroundColor = bot.viewByTitle(PROPERTIES).bot().ccomboBox(1).selection();
+ String backgroundColor = swtBot.ccomboBox(1).selection();
assertThat(backgroundColor, equalTo(MAPCOLORVALUE.get(backgroundValue)));
// Choose black color for Background Color
- bot.viewByTitle(PROPERTIES).bot().ccomboBox(1).setSelection(newBackgroundValue);
- String newBackgroundColor = bot.viewByTitle(PROPERTIES).bot().ccomboBox(1).selection();
+ swtBot.ccomboBox(1).setSelection(newBackgroundValue);
+ String newBackgroundColor = swtBot.ccomboBox(1).selection();
assertThat(newBackgroundColor, equalTo(MAPCOLORVALUE.get(newBackgroundValue)));
// Retrieve color for Label Color
- String labelColor = bot.viewByTitle(PROPERTIES).bot().ccomboBox(0).selection();
+ String labelColor = swtBot.ccomboBox(0).selection();
assertThat(labelColor, equalTo(MAPCOLORVALUE.get(labelColorValue)));
// Choose blue color for Label Color
- bot.viewByTitle(PROPERTIES).bot().ccomboBox(0).setSelection(newLabelColorValue);
- String newLabelColor = bot.viewByTitle(PROPERTIES).bot().ccomboBox(0).selection();
+ swtBot.ccomboBox(0).setSelection(newLabelColorValue);
+ String newLabelColor = swtBot.ccomboBox(0).selection();
assertThat(newLabelColor, equalTo(MAPCOLORVALUE.get(newLabelColorValue)));
}
}