[Yanel-commits] rev 51022 - public/yanel/trunk/src/contributions/resources/yanel-user/src/test/htmlunit/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Tue Jul 6 22:22:10 CEST 2010


Author: michi
Date: 2010-07-06 22:22:09 +0200 (Tue, 06 Jul 2010)
New Revision: 51022

Modified:
   public/yanel/trunk/src/contributions/resources/yanel-user/src/test/htmlunit/org/wyona/yanel/impl/resources/YanelUserResourceWebTest.java
Log:
reset username and email such that later tests do not have to depend on this

Modified: public/yanel/trunk/src/contributions/resources/yanel-user/src/test/htmlunit/org/wyona/yanel/impl/resources/YanelUserResourceWebTest.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/yanel-user/src/test/htmlunit/org/wyona/yanel/impl/resources/YanelUserResourceWebTest.java	2010-07-06 19:49:16 UTC (rev 51021)
+++ public/yanel/trunk/src/contributions/resources/yanel-user/src/test/htmlunit/org/wyona/yanel/impl/resources/YanelUserResourceWebTest.java	2010-07-06 20:22:09 UTC (rev 51022)
@@ -86,8 +86,9 @@
     /**
      * Test unsuccessful password update - Incorrect current password
      */
-/* TODO ...
+/*
     public void testAuthenticationInPasswordUpdate() throws Exception {
+        // TODO ...
         loadHtmlPage("test/use-cases/alice"); 
                 
         final HtmlForm form1 = this.currentPage.getFormByName("user-password-form");
@@ -138,20 +139,25 @@
      */
     public void testSuccessfulProfileUpdate() throws Exception {
         loadHtmlPage("test/use-cases/alice"); 
-                
-        final HtmlForm form = this.currentPage.getFormByName("user-profile-form");
-        
-        final HtmlSubmitInput button = (HtmlSubmitInput)form.getInputByName("submitProfile");
-        
-        final HtmlTextInput userNameField = (HtmlTextInput)form.getInputByName("userName");        
-        userNameField.setValueAttribute("Michael Wechner");
-        
-        final HtmlTextInput newEmailField = (HtmlTextInput)form.getInputByName("email");        
-        newEmailField.setValueAttribute("michi at wyona.org");     
-        
-        click(button);  
-        
+        final HtmlForm form1 = this.currentPage.getFormByName("user-profile-form");
+        final HtmlSubmitInput button1 = (HtmlSubmitInput)form1.getInputByName("submitProfile");
+        final HtmlTextInput userNameField1 = (HtmlTextInput)form1.getInputByName("userName");        
+        userNameField1.setValueAttribute("Michael Wechner");
+        final HtmlTextInput newEmailField1 = (HtmlTextInput)form1.getInputByName("email");        
+        newEmailField1.setValueAttribute("michi at wyona.org");     
+        click(button1);  
         assertPageContainsText("Profile updated successfully");  
+
+        // INFO: Reset user profile
+        loadHtmlPage("test/use-cases/alice"); 
+        final HtmlForm form2 = this.currentPage.getFormByName("user-profile-form");
+        final HtmlSubmitInput button2 = (HtmlSubmitInput)form2.getInputByName("submitProfile");
+        final HtmlTextInput userNameField2 = (HtmlTextInput)form2.getInputByName("userName");        
+        userNameField2.setValueAttribute("Alice");
+        final HtmlTextInput newEmailField2 = (HtmlTextInput)form2.getInputByName("email");        
+        newEmailField2.setValueAttribute("alice at foo.bar");     
+        click(button2);  
+        assertPageContainsText("Profile updated successfully");  
     }
     
     /**



More information about the Yanel-commits mailing list