changeset 7:ab97460a343c

7902157: Resolving various test issues when building/testing with maven Reviewed-by: shurailine Contributed-by: erik.greijus@oracle.com
author shurailine
date Thu, 19 Apr 2018 14:42:24 -0700
parents 7cde94b782c9
children 2b6fc4f103a4
files SWT/JemmySWT/test/org/jemmy/swt/Items.java SWT/JemmySWT/test/org/jemmy/swt/ItemsTest.java SWT/JemmySWT/test/org/jemmy/swt/PushButtonTest.java SWT/JemmySWT/test/org/jemmy/swt/SelectableTest.java
diffstat 4 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/SWT/JemmySWT/test/org/jemmy/swt/Items.java	Thu Apr 19 14:40:38 2018 -0700
+++ b/SWT/JemmySWT/test/org/jemmy/swt/Items.java	Thu Apr 19 14:42:24 2018 -0700
@@ -172,7 +172,7 @@
         btn.addSelectionListener(new SelectionListener() {
 
             public void widgetSelected(SelectionEvent arg0) {
-                lbl.setText("Now type some new text");
+                lbl.setText("Now type some new text, please");
             }
 
             public void widgetDefaultSelected(SelectionEvent arg0) {
--- a/SWT/JemmySWT/test/org/jemmy/swt/ItemsTest.java	Thu Apr 19 14:40:38 2018 -0700
+++ b/SWT/JemmySWT/test/org/jemmy/swt/ItemsTest.java	Thu Apr 19 14:42:24 2018 -0700
@@ -36,6 +36,8 @@
 import org.jemmy.control.Wrap;
 import org.jemmy.interfaces.Keyboard.KeyboardButtons;
 import org.jemmy.interfaces.Parent;
+import org.jemmy.swt.lookup.ByTextItem;
+import org.jemmy.swt.lookup.ByItemLookup;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
--- a/SWT/JemmySWT/test/org/jemmy/swt/PushButtonTest.java	Thu Apr 19 14:40:38 2018 -0700
+++ b/SWT/JemmySWT/test/org/jemmy/swt/PushButtonTest.java	Thu Apr 19 14:42:24 2018 -0700
@@ -33,6 +33,9 @@
 import org.jemmy.input.SelectionText;
 import org.jemmy.interfaces.Parent;
 import org.jemmy.interfaces.Selectable;
+import org.jemmy.swt.lookup.ByName;
+import org.jemmy.swt.lookup.CoordinateLookup;
+import org.jemmy.swt.lookup.ByTextTextLookup;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
@@ -84,25 +87,25 @@
     @Test
     public void push() throws InterruptedException {
         Wrap<? extends Text> field = buttonsParent.
-                lookup(Text.class, new ByTextTextLookup<Text>("button")).
+                lookup(Text.class, new ByTextTextLookup<Text>("please")).
                 wrap();
         buttonsParent.lookup().
                 lookup(Button.class).
                 wrap().mouse().click();
         field.getEnvironment().setTimeout(Wrap.WAIT_STATE_TIMEOUT, 20000);
-        field.waitProperty(Wrap.TEXT_PROP_NAME, "Now type some new text");
+        field.waitProperty(Wrap.TEXT_PROP_NAME, "Now type some new text, please");
     }
 
     @Test
     public void type() throws InterruptedException {
         Wrap<? extends Text> field = buttonsParent.
-                lookup(Text.class, new ByTextTextLookup<Text>("click the button")).
+                lookup(Text.class, new ByTextTextLookup<Text>("please")).
                 wrap();
         SelectionText text = field.as(SelectionText.class);
         text.clear();
         text.type("Now press the field");
         text.select("field");
-        text.type("button again");
+        text.type("button again, please");
         assertTrue(field.as(org.jemmy.interfaces.Text.class).text().
                 contains("again"));
     }
@@ -129,7 +132,7 @@
     public void coordinatesLookup() throws InterruptedException {
         Wrap<? extends Button> btt = buttonsParent.lookup(Button.class).wrap();
         //find text field to the left
-        buttonsParent.lookup(Text.class, new CoordinateLookup<Text>(btt, false, -1, 0)).wait(1);
+        buttonsParent.lookup(Text.class, new CoordinateLookup<Text>(btt, true, -1, 0)).wait(1);
         //find combo to the right
         buttonsParent.lookup(Combo.class, new CoordinateLookup<Combo>(btt, false , 1, 0)).wait(1);
         //find list
--- a/SWT/JemmySWT/test/org/jemmy/swt/SelectableTest.java	Thu Apr 19 14:40:38 2018 -0700
+++ b/SWT/JemmySWT/test/org/jemmy/swt/SelectableTest.java	Thu Apr 19 14:42:24 2018 -0700
@@ -29,6 +29,7 @@
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.Control;
 import org.jemmy.interfaces.Parent;
+import org.jemmy.control.Wrap;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;