Changeset 4780 for devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/MailPreferencesTestCase.java
- Timestamp:
- 07/18/11 10:56:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/MailPreferencesTestCase.java
r4675 r4780 1 1 package org.expressolivre.cte.email; 2 2 3 import java.io.IOException; 3 4 import java.lang.reflect.InvocationTargetException; 4 5 import java.lang.reflect.Method; … … 7 8 import org.expressolivre.cte.common.BaseTestCase; 8 9 import org.expressolivre.cte.common.Config; 10 import org.expressolivre.cte.common.IOUtil; 9 11 import org.expressolivre.cte.pages.email.MailPreferencesPage; 10 12 import org.testng.annotations.Parameters; … … 26 28 * @throws IllegalAccessException 27 29 * @throws InvocationTargetException 30 * @throws IOException 28 31 */ 29 32 @Test 30 33 public void setAllPreferences() throws IllegalArgumentException, 31 IllegalAccessException, InvocationTargetException {34 IllegalAccessException, InvocationTargetException, IOException { 32 35 openPreferencesPage(); 33 36 MailPreferencesPage prefs = openEmailPreferencesPage(); 37 38 // Clean up the preferences file. 39 IOUtil.writeFile("temppref.txt", "", false); 34 40 35 41 // Percorre todos os metodos "setters" da classe … … 52 58 .getEmailPreference(name).split(","); 53 59 System.out.println(name + " " + values[0]); 54 method.invoke(prefs, values[0]); 60 61 // Grava apenas as preferencias que o usuario tem disponivel 62 // e foram setadas em um arquivo para posterior uso em casos 63 // de teste. 64 Object response = method.invoke(prefs, values[0]); 65 if (response != null) { 66 if ((Boolean) response) { 67 IOUtil.writeFile( 68 "temppref.txt", 69 name + System.getProperty("line.separator"), 70 true); 71 } 72 } 55 73 } 56 74 } … … 77 95 } 78 96 97 @Test 98 @Parameters({ "returnRecipientDefault" }) 99 public void setReturnRecipientDefault(String returnRecipientDefault) { 100 openPreferencesPage(); 101 MailPreferencesPage prefs = openEmailPreferencesPage(); 102 prefs.setReturnRecipientDefault(returnRecipientDefault); 103 prefs.savePreferences(); 104 } 105 79 106 }
Note: See TracChangeset
for help on using the changeset viewer.