directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject [directory-studio] branch master updated: Need to wait for selected entry because navigate is an async action
Date Sun, 20 May 2018 13:54:05 GMT
This is an automated email from the ASF dual-hosted git repository.

seelmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-studio.git


The following commit(s) were added to refs/heads/master by this push:
     new 64ebd18  Need to wait for selected entry because navigate is an async action
64ebd18 is described below

commit 64ebd18fd769749aad5aa4f6b40ea68e9f4ad955
Author: Stefan Seelmann <mail@stefan-seelmann.de>
AuthorDate: Sun May 20 15:53:57 2018 +0200

    Need to wait for selected entry because navigate is an async action
---
 .../studio/test/integration/ui/BrowserTest.java    |  8 ++++----
 .../test/integration/ui/bots/BrowserViewBot.java   |  6 ++++++
 .../test/integration/ui/bots/BrowserWidgetBot.java | 22 ++++++++++++++++++++++
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
index 716389e..ab8d9cb 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
@@ -611,13 +611,13 @@ public class BrowserTest extends AbstractLdapTestUnit
 
         // use navigation history to go back and forth, each step should set input only once
         studioBot.navigationHistoryBack();
-        assertEquals( "uid=user.2", browserViewBot.getSelectedEntry() );
+        browserViewBot.waitUntilEntryIsSelected("uid=user.2");
         studioBot.navigationHistoryBack();
-        assertEquals( "uid=user.1", browserViewBot.getSelectedEntry() );
+        browserViewBot.waitUntilEntryIsSelected("uid=user.1");
         studioBot.navigationHistoryForward();
-        assertEquals( "uid=user.2", browserViewBot.getSelectedEntry() );
+        browserViewBot.waitUntilEntryIsSelected("uid=user.2");
         studioBot.navigationHistoryForward();
-        assertEquals( "uid=user.3", browserViewBot.getSelectedEntry() );
+        browserViewBot.waitUntilEntryIsSelected("uid=user.3");
 
         // verify that input was only set 4 times.
         assertEquals( "Only 4 input changes expected.", 4, counter.get() );
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
index 62c258c..5b1746c 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
@@ -213,4 +213,10 @@ public class BrowserViewBot
         return bot.comboBox( 0 ).isEnabled();
     }
 
+
+    public void waitUntilEntryIsSelected( String label )
+    {
+        browserBot.waitUntilEntryIsSelected( label );
+    }
+
 }
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
index f85cf38..fe265c8 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
@@ -245,4 +245,26 @@ class BrowserWidgetBot
         return bot.tree();
     }
 
+
+    public void waitUntilEntryIsSelected( String label )
+    {
+        bot.waitUntil( new DefaultCondition()
+        {
+
+            @Override
+            public boolean test() throws Exception
+            {
+                String selectedEntry = getSelectedEntry();
+                return selectedEntry.equals( label );
+            }
+
+
+            @Override
+            public String getFailureMessage()
+            {
+                return "Entry " + label + " was not selected, but " + getSelectedEntry();
+            }
+        } );
+    }
+
 }

-- 
To stop receiving notification emails like this one, please contact
seelmann@apache.org.

Mime
View raw message