https://wiki.zimbra.com/api.php?action=feedcontributions&user=Rhoades&feedformat=atom
Zimbra :: Tech Center - User contributions [en]
2024-03-29T14:49:32Z
User contributions
MediaWiki 1.39.0
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotPopups1.jpeg&diff=36495
File:ZimbraSeleniumScreenshotPopups1.jpeg
2011-08-23T17:32:08Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36494
Testing: Selenium: ZimbraSelenium RefImages
2011-08-23T17:31:45Z
<p>Rhoades: /* Ajax Application Images */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.JPG|thumb|center|600px|Addresspicker]]<br />
<br />
Recover Deleted Items (http://bugzilla.zimbra.com/show_bug.cgi?id=45284):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail7.JPG|thumb|center|600px|Recover]]<br />
<br />
Redirect Items (http://bugzilla.zimbra.com/show_bug.cgi?id=62171):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail8.JPG|thumb|center|600px|Redirect]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
===Popups===<br />
<br />
[[Image:ZimbraSeleniumScreenshotPopups1.jpeg|thumb|center|600px|Zimlets Disabled]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Interview&diff=36425
Testing: Selenium: ZimbraSelenium Interview
2011-08-10T20:58:14Z
<p>Rhoades: /* Setup */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions.<br />
<br />
The main purpose of the test is gauge candidates knowledge of relevant test methodologies and relevant test technologies, such as Java, TestNG, Selenium.<br />
<br />
==Questions==<br />
<br />
Candidates must address these problems and questions<br />
<br />
# There are various compilation issues in the project. Fix them.<br />
# The existing test cases should report: "Total tests run: 4, Failures: 0, Skips: 0". Fix the existing test cases.<br />
# Implement Login03: "Verify the invalid password error message contains the text: 'The username or password is incorrect.'"<br />
# Implement Login04: "Verify the copyright message contains the text: 'Copyright © 2005-2011'"<br />
# What test cases would be required to test the login screen?<br />
## Create a list of test case "objectives", which clearly state the intent of the tests<br />
# There are various email messages in the mailbox. Create a test case to click on the message with subject = "interview"<br />
<br />
==Source Code==<br />
<br />
Source code is delivered to candidates by mail.<br />
<br />
===Setup===<br />
<br />
The source code has been tested using:<br />
<br />
* Operating System: Windows XP<br />
* Java: 1.6.0_24<br />
* Eclipse: Eclipse Version 3.2<br />
* Browsers: firefox, iexplore<br />
<br />
Use these steps to load the test code into eclipse:<br />
<br />
# Unpack the software into a folder<br />
# Open ecplipse and set the workspace to the folder<br />
# Add the java project<br />
## Choose File -> New -> Java Project<br />
## In the dialog, set Project Name: "ZSelenium"<br />
## Click Finish<br />
<br />
[[Image:ZimbraSeleniumIntProjectStructure.jpeg]] <br />
<br />
Use these steps to execute tests:<br />
<br />
# Open build.xml<br />
# In the Outline view:<br />
## Right click on "Execute Tests"<br />
## Choose Run As -> Ant Build<br />
<br />
[[Image:ZimbraSeleniumIntProjectExecute.jpeg]]<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZSelenium java project. <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* jars: contains third party external jar files<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* com.zimbra.qa.selenium.interview.main: utility classes<br />
* com.zimbra.qa.selenium.interview.tests: test classes<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumIntProjectStructure.jpeg&diff=36424
File:ZimbraSeleniumIntProjectStructure.jpeg
2011-08-10T20:57:54Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Interview&diff=36423
Testing: Selenium: ZimbraSelenium Interview
2011-08-10T20:55:19Z
<p>Rhoades: /* Setup */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions.<br />
<br />
The main purpose of the test is gauge candidates knowledge of relevant test methodologies and relevant test technologies, such as Java, TestNG, Selenium.<br />
<br />
==Questions==<br />
<br />
Candidates must address these problems and questions<br />
<br />
# There are various compilation issues in the project. Fix them.<br />
# The existing test cases should report: "Total tests run: 4, Failures: 0, Skips: 0". Fix the existing test cases.<br />
# Implement Login03: "Verify the invalid password error message contains the text: 'The username or password is incorrect.'"<br />
# Implement Login04: "Verify the copyright message contains the text: 'Copyright © 2005-2011'"<br />
# What test cases would be required to test the login screen?<br />
## Create a list of test case "objectives", which clearly state the intent of the tests<br />
# There are various email messages in the mailbox. Create a test case to click on the message with subject = "interview"<br />
<br />
==Source Code==<br />
<br />
Source code is delivered to candidates by mail.<br />
<br />
===Setup===<br />
<br />
The source code has been tested using:<br />
<br />
* Operating System: Windows XP<br />
* Java: 1.6.0_24<br />
* Eclipse: Eclipse Version 3.2<br />
* Browsers: firefox, iexplore<br />
<br />
Use these steps to load the test code into eclipse:<br />
<br />
# Unpack the software into a folder<br />
# Open ecplipse and set the workspace to the folder<br />
# Add the java project<br />
## Choose File -> New -> Java Project<br />
## In the dialog, set Project Name: "ZSelenium"<br />
## Click Finish<br />
<br />
[[Image:ZimbraSeleniumIntProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
Use these steps to execute tests:<br />
<br />
# Open build.xml<br />
# In the Outline view:<br />
## Right click on "Execute Tests"<br />
## Choose Run As -> Ant Build<br />
<br />
[[Image:ZimbraSeleniumIntProjectExecute.jpeg]]<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZSelenium java project. <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* jars: contains third party external jar files<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* com.zimbra.qa.selenium.interview.main: utility classes<br />
* com.zimbra.qa.selenium.interview.tests: test classes<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumIntProjectExecute.jpeg&diff=36422
File:ZimbraSeleniumIntProjectExecute.jpeg
2011-08-10T20:54:45Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Interview&diff=36421
Testing: Selenium: ZimbraSelenium Interview
2011-08-10T20:53:26Z
<p>Rhoades: /* Setup */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions.<br />
<br />
The main purpose of the test is gauge candidates knowledge of relevant test methodologies and relevant test technologies, such as Java, TestNG, Selenium.<br />
<br />
==Questions==<br />
<br />
Candidates must address these problems and questions<br />
<br />
# There are various compilation issues in the project. Fix them.<br />
# The existing test cases should report: "Total tests run: 4, Failures: 0, Skips: 0". Fix the existing test cases.<br />
# Implement Login03: "Verify the invalid password error message contains the text: 'The username or password is incorrect.'"<br />
# Implement Login04: "Verify the copyright message contains the text: 'Copyright © 2005-2011'"<br />
# What test cases would be required to test the login screen?<br />
## Create a list of test case "objectives", which clearly state the intent of the tests<br />
# There are various email messages in the mailbox. Create a test case to click on the message with subject = "interview"<br />
<br />
==Source Code==<br />
<br />
Source code is delivered to candidates by mail.<br />
<br />
===Setup===<br />
<br />
The source code has been tested using:<br />
<br />
* Operating System: Windows XP<br />
* Java: 1.6.0_24<br />
* Eclipse: Eclipse Version 3.2<br />
* Browsers: firefox, iexplore<br />
<br />
Use these steps to load the test code into eclipse:<br />
<br />
# Unpack the software into a folder<br />
# Open ecplipse and set the workspace to the folder<br />
# Add the java project<br />
## Choose File -> New -> Java Project<br />
## In the dialog, set Project Name: "ZSelenium"<br />
## Click Finish<br />
<br />
[[Image:ZimbraSeleniumIntProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
Use these steps to execute tests:<br />
<br />
# Open build.xml<br />
# In the Outline view:<br />
## Right click on "Execute Tests"<br />
## Choose Run As -> Ant Build<br />
<br />
[[Image:ZimbraSeleniumIntProjectExecute.jpeg|thumb|left|600px|Run tests]]<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZSelenium java project. <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* jars: contains third party external jar files<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* com.zimbra.qa.selenium.interview.main: utility classes<br />
* com.zimbra.qa.selenium.interview.tests: test classes<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Interview&diff=36420
Testing: Selenium: ZimbraSelenium Interview
2011-08-10T20:14:23Z
<p>Rhoades: /* Questions */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions.<br />
<br />
The main purpose of the test is gauge candidates knowledge of relevant test methodologies and relevant test technologies, such as Java, TestNG, Selenium.<br />
<br />
==Questions==<br />
<br />
Candidates must address these problems and questions<br />
<br />
# There are various compilation issues in the project. Fix them.<br />
# The existing test cases should report: "Total tests run: 4, Failures: 0, Skips: 0". Fix the existing test cases.<br />
# Implement Login03: "Verify the invalid password error message contains the text: 'The username or password is incorrect.'"<br />
# Implement Login04: "Verify the copyright message contains the text: 'Copyright © 2005-2011'"<br />
# What test cases would be required to test the login screen?<br />
## Create a list of test case "objectives", which clearly state the intent of the tests<br />
# There are various email messages in the mailbox. Create a test case to click on the message with subject = "interview"<br />
<br />
==Source Code==<br />
<br />
Source code is delivered to candidates by mail.<br />
<br />
===Setup===<br />
<br />
The source code has been tested using:<br />
<br />
* Operating System: Windows XP<br />
* Java: 1.6.0_24<br />
* Eclipse: Eclipse Version 3.2<br />
* Browsers: firefox, iexplore<br />
<br />
Use these steps to load the test code into eclipse:<br />
<br />
# Unpack the software into a folder<br />
# Open ecplipse and set the workspace to the folder<br />
# Add the java project<br />
## Choose File -> New -> Java Project<br />
## In the dialog, set Project Name: "ZSelenium"<br />
## Click Finish<br />
<br />
[[Image:ZimbraSeleniumIntProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
Use these steps to execute tests:<br />
<br />
# Open build.xml<br />
# In the Outline view:<br />
## Right click on "Execute Tests"<br />
## Choose Run As -> Ant Build<br />
<br />
[[Image:ZimbraSeleniumIntProjectExecute.jpeg|thumb|right|200px|Run tests]] <br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZSelenium java project. <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* jars: contains third party external jar files<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* com.zimbra.qa.selenium.interview.main: utility classes<br />
* com.zimbra.qa.selenium.interview.tests: test classes<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Interview&diff=36419
Testing: Selenium: ZimbraSelenium Interview
2011-08-10T19:32:01Z
<p>Rhoades: Created page with "==General Information== The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions. The main purpose of the test is gaug..."</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Interview''' is an interview test given to prospective candidates for QA Engineer positions.<br />
<br />
The main purpose of the test is gauge candidates knowledge of relevant test methodologies and relevant test technologies, such as Java, TestNG, Selenium.<br />
<br />
==Questions==<br />
<br />
Candidates must address these problems and questions<br />
<br />
# There are various compilation issues in the project. Fix them.<br />
# The existing test cases should report: "Total tests run: 4, Failures: 0, Skips: 0". Fix the existing test cases.<br />
# Implement Login03: "Verify the invalid password error message contains the text: 'The username or password is incorrect.'"<br />
# Implement Login04: "Verify the copyright message contains the text: 'Copyright © 2005-2011'"<br />
# What test cases would be required to test the login screen?<br />
## Create a list of test case "objectives", which clearly state the intent of the tests<br />
<br />
==Source Code==<br />
<br />
Source code is delivered to candidates by mail.<br />
<br />
===Setup===<br />
<br />
The source code has been tested using:<br />
<br />
* Operating System: Windows XP<br />
* Java: 1.6.0_24<br />
* Eclipse: Eclipse Version 3.2<br />
* Browsers: firefox, iexplore<br />
<br />
Use these steps to load the test code into eclipse:<br />
<br />
# Unpack the software into a folder<br />
# Open ecplipse and set the workspace to the folder<br />
# Add the java project<br />
## Choose File -> New -> Java Project<br />
## In the dialog, set Project Name: "ZSelenium"<br />
## Click Finish<br />
<br />
[[Image:ZimbraSeleniumIntProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
Use these steps to execute tests:<br />
<br />
# Open build.xml<br />
# In the Outline view:<br />
## Right click on "Execute Tests"<br />
## Choose Run As -> Ant Build<br />
<br />
[[Image:ZimbraSeleniumIntProjectExecute.jpeg|thumb|right|200px|Run tests]] <br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZSelenium java project. <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* jars: contains third party external jar files<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* com.zimbra.qa.selenium.interview.main: utility classes<br />
* com.zimbra.qa.selenium.interview.tests: test classes<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36070
Testing: Selenium: ZimbraSelenium RefImages
2011-07-19T20:03:24Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.JPG|thumb|center|600px|Addresspicker]]<br />
<br />
Recover Deleted Items (http://bugzilla.zimbra.com/show_bug.cgi?id=45284):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail7.JPG|thumb|center|600px|Recover]]<br />
<br />
Redirect Items (http://bugzilla.zimbra.com/show_bug.cgi?id=62171):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail8.JPG|thumb|center|600px|Redirect]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail8.JPG&diff=36069
File:ZimbraSeleniumScreenshotAjaxMail8.JPG
2011-07-19T19:23:39Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36068
Testing: Selenium: ZimbraSelenium RefImages
2011-07-19T19:23:24Z
<p>Rhoades: /* Ajax Application Images */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.JPG|thumb|center|600px|Addresspicker]]<br />
<br />
Recover Deleted Items (http://bugzilla.zimbra.com/show_bug.cgi?id=45284):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail7.JPG|thumb|center|600px|Recover]]<br />
<br />
Redirect Items (http://bugzilla.zimbra.com/show_bug.cgi?id=45284):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail8.JPG|thumb|center|600px|Redirect]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36055
Testing: Selenium: ZimbraSelenium RefImages
2011-07-14T20:47:45Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.JPG|thumb|center|600px|Addresspicker]]<br />
<br />
Recover Deleted Items (http://bugzilla.zimbra.com/show_bug.cgi?id=45284):<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail7.JPG|thumb|center|600px|Recover]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail7.JPG&diff=36054
File:ZimbraSeleniumScreenshotAjaxMail7.JPG
2011-07-14T20:47:34Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36052
Testing: Selenium: ZimbraSelenium RefImages
2011-07-14T18:21:17Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.JPG|thumb|center|600px|Addresspicker]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=36051
Testing: Selenium: ZimbraSelenium RefImages
2011-07-14T18:17:08Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
Address picker:<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail6.jpeg|thumb|center|600px|Addresspicker]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail6.JPG&diff=36050
File:ZimbraSeleniumScreenshotAjaxMail6.JPG
2011-07-14T18:16:24Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_SampleTestCase&diff=23926
Testing: Selenium: ZimbraSelenium SampleTestCase
2011-01-24T20:22:03Z
<p>Rhoades: /* Sample Test Case */</p>
<hr />
<div>==General Information==<br />
<br />
Below is a sample test case with descriptions.<br />
<br />
==Harness Overview==<br />
<br />
See [[Testing:_Selenium:_ZimbraSelenium_Overview|Zimbra Selenium Overview]]<br />
<br />
==Sample Test Case==<br />
<br />
===Objective===<br />
<br />
The sample test case has the objective: "Send a mail using text editor"<br />
<br />
===Walk Through===<br />
<br />
See the code below with comments that walk through the test steps.<br />
<br />
<br />
package com.zimbra.qa.selenium.projects.ajax.tests.mail.compose;<br />
<br />
import java.util.HashMap;<br />
<br />
import org.testng.annotations.Test;<br />
<br />
import com.zimbra.qa.selenium.framework.items.*;<br />
import com.zimbra.qa.selenium.framework.ui.*;<br />
import com.zimbra.qa.selenium.framework.util.*;<br />
import com.zimbra.qa.selenium.projects.ajax.core.AjaxCommonTest;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew.Field;<br />
<br />
<br />
// Test case classes extend from a basic AjaxCommonTest class, which<br />
// includes functionality that is common to all test cases<br />
//<br />
public class CreateMailText extends AjaxCommonTest {<br />
<br />
public CreateMailText() {<br />
<br />
// The AjaxCommonTest class defines a log4j Logger object<br />
// named "logger". This "logger" can be used to output <br />
// INFO level logging to the test results output folder<br />
//<br />
logger.info("New "+ CreateMailText.class.getCanonicalName());<br />
<br />
// Define a starting page, which will be active before<br />
// each test method. For example, calendar test cases<br />
// will start in the calendar app automatically<br />
//<br />
super.startingPage = app.zPageMail;<br />
<br />
// The harness authenticates to the app automatically, using<br />
// the account defined by ZimbraAccount.AccountZWC (for ajax),<br />
// ZimbraAccount.AccountZMC (for mobile), ZimbraAccount.AccountZHC<br />
// (for HTML-lite), etc.<br />
//<br />
// Define any user preferences required for the test methods in<br />
// this class. The test account will have these preferences<br />
// set automatically.<br />
//<br />
//<br />
Map<String, String> prefs = new HashMap<String, String>();<br />
prefs.put("zimbraPrefComposeFormat", "text");<br />
super.startingAccountPreferences = prefs;<br />
<br />
}<br />
<br />
// TestNG methods must be decorated with the @Test attribute to be<br />
// included in test execution<br />
@Test( <br />
<br />
// Use the description to specify the test case objective<br />
description = "Send a mail using Text editor",<br />
<br />
// Zimbra uses sanity, smoke, functional groups. See<br />
// the wiki for more information, definitions<br />
groups = { "sanity" }<br />
)<br />
public void CreateMailText_01() throws HarnessException {<br />
<br />
<br />
// Create a unique string to be used for the subject,<br />
// which minimizes the search results later in the test<br />
//<br />
String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();<br />
String body = "text" + ZimbraSeleniumProperties.getUniqueString();<br />
<br />
<br />
// Use the ajax "app" object, which is defined in the base AjaxCommonTest object<br />
//<br />
// The "app" object contains a "zPageMail" object, which interfaces with<br />
// the "mail" tab.<br />
//<br />
// The zPageMail object has methods that can be used to click on the "NEW" button<br />
//<br />
// Certain button actions return other objects. In this case, a 'new mail compose'<br />
// screen opens, which is a "FormMailNew" object in the harness.<br />
//<br />
FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_NEW);<br />
<br />
// The ZAssert class extends the base java Assert class. Basically,<br />
// the ZAssert class has additional custom logging and result counters.<br />
//<br />
ZAssert.assertNotNull(mailform, "Verify the new form opened");<br />
<br />
// Use the FormMailNew object to fill out the fields<br />
//<br />
// For convenience, the ZimbraAccount class has two static accounts, AccountA<br />
// and AccountB, that can be used for sender or recipients of sample emails <br />
// from the test account.<br />
//<br />
mailform.zFillField(Field.To, ZimbraAccount.AccountA().EmailAddress);<br />
mailform.zFillField(Field.Subject, subject);<br />
mailform.zFillField(Field.Body, body);<br />
<br />
// Send the message<br />
mailform.zSubmit();<br />
<br />
<br />
// The framework.items.* classes have helper methods to import data<br />
// using SOAP into plain old java objects. For instance, the<br />
// MailItem.importFromSOAP() will use Zimbra's SOAP API requests SearchRequest<br />
// followed by GetMsgRequest to import the message into the "received" object<br />
//<br />
MailItem received = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:("+ subject +")");<br />
<br />
<br />
// Verify the receipient message contains the correct data<br />
//<br />
ZAssert.assertEquals(received.dFromRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the from field is correct");<br />
ZAssert.assertEquals(received.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the to field is correct"); <br />
ZAssert.assertEquals(received.dSubject, subject, "Verify the subject field is correct");<br />
ZAssert.assertStringContains(received.dBodyText, body, "Verify the body field is correct");<br />
<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_SampleTestCase&diff=23925
Testing: Selenium: ZimbraSelenium SampleTestCase
2011-01-24T20:19:36Z
<p>Rhoades: /* Code */</p>
<hr />
<div>==General Information==<br />
<br />
Below is a sample test case with descriptions.<br />
<br />
==Harness Overview==<br />
<br />
See [[Testing:_Selenium:_ZimbraSelenium_Overview|Zimbra Selenium Overview]]<br />
<br />
==Sample Test Case==<br />
<br />
===Objective===<br />
<br />
The sample test case has the objective: "Send a mail using text editor"<br />
<br />
===Code===<br />
<br />
<br />
package com.zimbra.qa.selenium.projects.ajax.tests.mail.compose;<br />
<br />
import java.util.HashMap;<br />
<br />
import org.testng.annotations.Test;<br />
<br />
import com.zimbra.qa.selenium.framework.items.*;<br />
import com.zimbra.qa.selenium.framework.ui.*;<br />
import com.zimbra.qa.selenium.framework.util.*;<br />
import com.zimbra.qa.selenium.projects.ajax.core.AjaxCommonTest;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew.Field;<br />
<br />
<br />
// Test case classes extend from a basic AjaxCommonTest class, which<br />
// includes functionality that is common to all test cases<br />
//<br />
public class CreateMailText extends AjaxCommonTest {<br />
<br />
public CreateMailText() {<br />
<br />
// The AjaxCommonTest class defines a log4j Logger object<br />
// named "logger". This "logger" can be used to output <br />
// INFO level logging to the test results output folder<br />
//<br />
logger.info("New "+ CreateMailText.class.getCanonicalName());<br />
<br />
// Define a starting page, which will be active before<br />
// each test method. For example, calendar test cases<br />
// will start in the calendar app automatically<br />
//<br />
super.startingPage = app.zPageMail;<br />
<br />
// The harness authenticates to the app automatically, using<br />
// the account defined by ZimbraAccount.AccountZWC (for ajax),<br />
// ZimbraAccount.AccountZMC (for mobile), ZimbraAccount.AccountZHC<br />
// (for HTML-lite), etc.<br />
//<br />
// Define any user preferences required for the test methods in<br />
// this class. The test account will have these preferences<br />
// set automatically.<br />
//<br />
//<br />
Map<String, String> prefs = new HashMap<String, String>();<br />
prefs.put("zimbraPrefComposeFormat", "text");<br />
super.startingAccountPreferences = prefs;<br />
<br />
}<br />
<br />
// TestNG methods must be decorated with the @Test attribute to be<br />
// included in test execution<br />
@Test( <br />
<br />
// Use the description to specify the test case objective<br />
description = "Send a mail using Text editor",<br />
<br />
// Zimbra uses sanity, smoke, functional groups. See<br />
// the wiki for more information, definitions<br />
groups = { "sanity" }<br />
)<br />
public void CreateMailText_01() throws HarnessException {<br />
<br />
<br />
// Create a unique string to be used for the subject,<br />
// which minimizes the search results later in the test<br />
//<br />
String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();<br />
String body = "text" + ZimbraSeleniumProperties.getUniqueString();<br />
<br />
<br />
// Use the ajax "app" object, which is defined in the base AjaxCommonTest object<br />
//<br />
// The "app" object contains a "zPageMail" object, which interfaces with<br />
// the "mail" tab.<br />
//<br />
// The zPageMail object has methods that can be used to click on the "NEW" button<br />
//<br />
// Certain button actions return other objects. In this case, a 'new mail compose'<br />
// screen opens, which is a "FormMailNew" object in the harness.<br />
//<br />
FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_NEW);<br />
<br />
// The ZAssert class extends the base java Assert class. Basically,<br />
// the ZAssert class has additional custom logging and result counters.<br />
//<br />
ZAssert.assertNotNull(mailform, "Verify the new form opened");<br />
<br />
// Use the FormMailNew object to fill out the fields<br />
//<br />
// For convenience, the ZimbraAccount class has two static accounts, AccountA<br />
// and AccountB, that can be used for sender or recipients of sample emails <br />
// from the test account.<br />
//<br />
mailform.zFillField(Field.To, ZimbraAccount.AccountA().EmailAddress);<br />
mailform.zFillField(Field.Subject, subject);<br />
mailform.zFillField(Field.Body, body);<br />
<br />
// Send the message<br />
mailform.zSubmit();<br />
<br />
<br />
// The framework.items.* classes have helper methods to import data<br />
// using SOAP into plain old java objects. For instance, the<br />
// MailItem.importFromSOAP() will use Zimbra's SOAP API requests SearchRequest<br />
// followed by GetMsgRequest to import the message into the "received" object<br />
//<br />
MailItem received = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:("+ subject +")");<br />
<br />
<br />
// Verify the receipient message contains the correct data<br />
//<br />
ZAssert.assertEquals(received.dFromRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the from field is correct");<br />
ZAssert.assertEquals(received.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the to field is correct"); <br />
ZAssert.assertEquals(received.dSubject, subject, "Verify the subject field is correct");<br />
ZAssert.assertStringContains(received.dBodyText, body, "Verify the body field is correct");<br />
<br />
}<br />
<br />
}<br />
<br />
===Walk Through===<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_SampleTestCase&diff=23924
Testing: Selenium: ZimbraSelenium SampleTestCase
2011-01-24T20:18:08Z
<p>Rhoades: /* Code */</p>
<hr />
<div>==General Information==<br />
<br />
Below is a sample test case with descriptions.<br />
<br />
==Harness Overview==<br />
<br />
See [[Testing:_Selenium:_ZimbraSelenium_Overview|Zimbra Selenium Overview]]<br />
<br />
==Sample Test Case==<br />
<br />
===Objective===<br />
<br />
The sample test case has the objective: "Send a mail using text editor"<br />
<br />
===Code===<br />
<br />
<br />
package com.zimbra.qa.selenium.projects.ajax.tests.mail.compose;<br />
<br />
import java.util.HashMap;<br />
<br />
import org.testng.annotations.Test;<br />
<br />
import com.zimbra.qa.selenium.framework.items.*;<br />
import com.zimbra.qa.selenium.framework.ui.*;<br />
import com.zimbra.qa.selenium.framework.util.*;<br />
import com.zimbra.qa.selenium.projects.ajax.core.AjaxCommonTest;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew.Field;<br />
<br />
<br />
// Test case classes extend from a basic AjaxCommonTest class, which<br />
// includes functionality that is common to all test cases<br />
//<br />
public class CreateMailText extends AjaxCommonTest {<br />
<br />
public CreateMailText() {<br />
<br />
// The AjaxCommonTest class defines a log4j Logger object<br />
// named "logger". This "logger" can be used to output <br />
// INFO level logging to the test results output folder<br />
//<br />
logger.info("New "+ CreateMailText.class.getCanonicalName());<br />
<br />
// Define a starting page, which will be active before<br />
// each test method. For example, calendar test cases<br />
// will start in the calendar app automatically<br />
//<br />
super.startingPage = app.zPageMail;<br />
<br />
// The harness authenticates to the app automatically, using<br />
// the account defined by ZimbraAccount.AccountZWC (for ajax),<br />
// ZimbraAccount.AccountZMC (for mobile), ZimbraAccount.AccountZHC<br />
// (for HTML-lite), etc.<br />
//<br />
// Define any user preferences required for the test methods in<br />
// this class. The test account will have these preferences<br />
// set automatically.<br />
//<br />
//<br />
super.startingAccountPreferences = new HashMap<String , String>() {{<br />
put("zimbraPrefComposeFormat", "text");<br />
}};<br />
<br />
}<br />
<br />
// TestNG methods must be decorated with the @Test attribute to be<br />
// included in test execution<br />
@Test( <br />
<br />
// Use the description to specify the test case objective<br />
description = "Send a mail using Text editor",<br />
<br />
// Zimbra uses sanity, smoke, functional groups. See<br />
// the wiki for more information, definitions<br />
groups = { "sanity" }<br />
)<br />
public void CreateMailText_01() throws HarnessException {<br />
<br />
<br />
// Create a unique string to be used for the subject,<br />
// which minimizes the search results later in the test<br />
//<br />
String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();<br />
String body = "text" + ZimbraSeleniumProperties.getUniqueString();<br />
<br />
<br />
// Use the ajax "app" object, which is defined in the base AjaxCommonTest object<br />
//<br />
// The "app" object contains a "zPageMail" object, which interfaces with<br />
// the "mail" tab.<br />
//<br />
// The zPageMail object has methods that can be used to click on the "NEW" button<br />
//<br />
// Certain button actions return other objects. In this case, a 'new mail compose'<br />
// screen opens, which is a "FormMailNew" object in the harness.<br />
//<br />
FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_NEW);<br />
<br />
// The ZAssert class extends the base java Assert class. Basically,<br />
// the ZAssert class has additional custom logging and result counters.<br />
//<br />
ZAssert.assertNotNull(mailform, "Verify the new form opened");<br />
<br />
// Use the FormMailNew object to fill out the fields<br />
//<br />
// For convenience, the ZimbraAccount class has two static accounts, AccountA<br />
// and AccountB, that can be used for sender or recipients of sample emails <br />
// from the test account.<br />
//<br />
mailform.zFillField(Field.To, ZimbraAccount.AccountA().EmailAddress);<br />
mailform.zFillField(Field.Subject, subject);<br />
mailform.zFillField(Field.Body, body);<br />
<br />
// Send the message<br />
mailform.zSubmit();<br />
<br />
<br />
// The framework.items.* classes have helper methods to import data<br />
// using SOAP into plain old java objects. For instance, the<br />
// MailItem.importFromSOAP() will use Zimbra's SOAP API requests SearchRequest<br />
// followed by GetMsgRequest to import the message into the "received" object<br />
//<br />
MailItem received = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:("+ subject +")");<br />
<br />
<br />
// Verify the receipient message contains the correct data<br />
//<br />
ZAssert.assertEquals(received.dFromRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the from field is correct");<br />
ZAssert.assertEquals(received.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the to field is correct"); <br />
ZAssert.assertEquals(received.dSubject, subject, "Verify the subject field is correct");<br />
ZAssert.assertStringContains(received.dBodyText, body, "Verify the body field is correct");<br />
<br />
}<br />
<br />
}<br />
<br />
===Walk Through===<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_SampleTestCase&diff=23922
Testing: Selenium: ZimbraSelenium SampleTestCase
2011-01-24T18:52:19Z
<p>Rhoades: Created page with '==General Information== Below is a sample test case with descriptions. ==Harness Overview== See Zimbra Selenium Overview ==Samp…'</p>
<hr />
<div>==General Information==<br />
<br />
Below is a sample test case with descriptions.<br />
<br />
==Harness Overview==<br />
<br />
See [[Testing:_Selenium:_ZimbraSelenium_Overview|Zimbra Selenium Overview]]<br />
<br />
==Sample Test Case==<br />
<br />
===Objective===<br />
<br />
The sample test case has the objective: "Send a mail using text editor"<br />
<br />
===Code===<br />
<br />
<br />
package com.zimbra.qa.selenium.projects.ajax.tests.mail.compose;<br />
<br />
import java.util.HashMap;<br />
<br />
import org.testng.annotations.Test;<br />
<br />
import com.zimbra.qa.selenium.framework.items.*;<br />
import com.zimbra.qa.selenium.framework.ui.*;<br />
import com.zimbra.qa.selenium.framework.util.*;<br />
import com.zimbra.qa.selenium.projects.ajax.core.AjaxCommonTest;<br />
import com.zimbra.qa.selenium.projects.ajax.ui.mail.FormMailNew;<br />
<br />
<br />
public class CreateMailText extends AjaxCommonTest {<br />
<br />
@SuppressWarnings("serial")<br />
public CreateMailText() {<br />
logger.info("New "+ CreateMailText.class.getCanonicalName());<br />
<br />
// All tests start at the login page<br />
super.startingPage = app.zPageMail;<br />
super.startingAccountPreferences = new HashMap<String , String>() {{<br />
put("zimbraPrefComposeFormat", "text");<br />
}};<br />
<br />
}<br />
<br />
@Test( description = "Send a mail using Text editor",<br />
groups = { "sanity" })<br />
public void CreateMailText_01() throws HarnessException {<br />
<br />
<br />
// Create the message data to be sent<br />
MailItem mail = new MailItem();<br />
mail.dToRecipients.add(new RecipientItem(ZimbraAccount.AccountA()));<br />
mail.dSubject = "subject" + ZimbraSeleniumProperties.getUniqueString();<br />
mail.dBodyText = "body" + ZimbraSeleniumProperties.getUniqueString();<br />
<br />
<br />
// Open the new mail form<br />
FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_NEW);<br />
ZAssert.assertNotNull(mailform, "Verify the new form opened");<br />
<br />
// Fill out the form with the data<br />
mailform.zFill(mail);<br />
<br />
// Send the message<br />
mailform.zSubmit();<br />
<br />
<br />
MailItem received = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:("+ mail.dSubject +")");<br />
<br />
<br />
// TODO: add checks for TO, Subject, Body<br />
ZAssert.assertEquals(received.dFromRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the from field is correct");<br />
ZAssert.assertEquals(received.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the to field is correct"); <br />
ZAssert.assertEquals(received.dSubject, mail.dSubject, "Verify the subject field is correct");<br />
ZAssert.assertStringContains(received.dBodyText, mail.dBodyText, "Verify the body field is correct");<br />
<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
===Walk Through===<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=23880
Testing: Selenium: ZimbraSelenium Overview
2011-01-11T22:30:00Z
<p>Rhoades: /* Smoke */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged<br />
* "d" - applies to general "Data" for the item. This data could come be a general property or come from SOAP. For example, MailItem.dIsFlagged<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
===Groups===<br />
<br />
Test cases are separated into the following [http://testng.org/doc/documentation-main.html#test-groups groups]: always, sanity, smoke, functional, deprecated, unstable<br />
<br />
====Always====<br />
<br />
The '''always''' group is used to specify test methods that always execute. Mainly, this group is used for @Before* and @After* [http://testng.org/doc/documentation-main.html#annotations annotated] methods.<br />
<br />
====Sanity====<br />
<br />
The '''sanity''' group is used to annotate a select group of test methods that can be used as a sanity suite. The sanity suite should complete quickly (in a few minutes) and provide a broad verification of basic functionality.<br />
<br />
Currently, only test cases that create basic objects in the GUI are marked as sanity. For example:<br />
<br />
* Create a message<br />
* Create a folder<br />
* Create a contact<br />
* Create an addressbook<br />
* Create an appointment<br />
* Create a calendar<br />
* Create a task<br />
* Create a task list<br />
* Create a briefcase document<br />
* Upload a briefcase file<br />
* Create a briefcase folder<br />
* Create a tag<br />
* Create a saved search<br />
<br />
====Smoke====<br />
<br />
The '''smoke''' group is used to annotate a select group of test methods that can be used as a smoke suite. The smoke suite should complete relatively quickly (in a few hours) and provide a detailed verification of basic functionality.<br />
<br />
Currently, test cases that apply all basic actions to all basic objects in the GUI are marked as smoke. For example:<br />
<br />
* Basic objects<br />
** Messages<br />
** Contacts<br />
** Appointments/Meeting Requests<br />
** Tasks<br />
** Briefcase Files/Documents<br />
** Folders, Addressbooks, Calendars, Task List, Briefcase folders, Mountpoints<br />
** Tags<br />
** Saved Searches<br />
* Basic actions<br />
** Create<br />
** Edit<br />
** Delete<br />
** Move/Drag and Drop<br />
** Undo<br />
** Share<br />
** Flag/Unflag<br />
** Tag/Untag<br />
** Mark read/unread<br />
<br />
A cross matrix of objects and actions defines the smoke suite. For instance, the test case that verifies a message (basic object) can be flagged (basic action) is in the smoke suite.<br />
<br />
====Functional====<br />
<br />
The '''functional''' group is used to annotate a group of test methods that can be used as a full regression suite. The functional suite includes all remaining active test cases.<br />
<br />
====Deprecated====<br />
<br />
The '''deprecated''' group is used to mark individual test cases that are no longer active, due to removed or changed functionality.<br />
<br />
====Unstable====<br />
<br />
The '''unstable''' group is used to mark individual test cases that are unstable. Some test cases may block the harness from executing, and these test methods must be removed from the active test suites to reduce false negative results.<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=23879
Testing: Selenium: ZimbraSelenium Overview
2011-01-11T22:27:38Z
<p>Rhoades: /* Groups */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged<br />
* "d" - applies to general "Data" for the item. This data could come be a general property or come from SOAP. For example, MailItem.dIsFlagged<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
===Groups===<br />
<br />
Test cases are separated into the following [http://testng.org/doc/documentation-main.html#test-groups groups]: always, sanity, smoke, functional, deprecated, unstable<br />
<br />
====Always====<br />
<br />
The '''always''' group is used to specify test methods that always execute. Mainly, this group is used for @Before* and @After* [http://testng.org/doc/documentation-main.html#annotations annotated] methods.<br />
<br />
====Sanity====<br />
<br />
The '''sanity''' group is used to annotate a select group of test methods that can be used as a sanity suite. The sanity suite should complete quickly (in a few minutes) and provide a broad verification of basic functionality.<br />
<br />
Currently, only test cases that create basic objects in the GUI are marked as sanity. For example:<br />
<br />
* Create a message<br />
* Create a folder<br />
* Create a contact<br />
* Create an addressbook<br />
* Create an appointment<br />
* Create a calendar<br />
* Create a task<br />
* Create a task list<br />
* Create a briefcase document<br />
* Upload a briefcase file<br />
* Create a briefcase folder<br />
* Create a tag<br />
* Create a saved search<br />
<br />
====Smoke====<br />
<br />
The '''smoke''' group is used to annotate a select group of test methods that can be used as a smoke suite. The smoke suite should complete relatively quickly (in a few hours) and provide a detailed verification of basic functionality.<br />
<br />
Currently, test cases that apply all basic actions to all basic objects in the GUI are marked as smoke. For example:<br />
<br />
* Basic objects<br />
* Basic actions<br />
<br />
A cross matrix of objects and actions defines the smoke suite. For instance, the test case that verifies a message (basic object) can be flagged (basic action) is in the smoke suite.<br />
<br />
====Functional====<br />
<br />
The '''functional''' group is used to annotate a group of test methods that can be used as a full regression suite. The functional suite includes all remaining active test cases.<br />
<br />
====Deprecated====<br />
<br />
The '''deprecated''' group is used to mark individual test cases that are no longer active, due to removed or changed functionality.<br />
<br />
====Unstable====<br />
<br />
The '''unstable''' group is used to mark individual test cases that are unstable. Some test cases may block the harness from executing, and these test methods must be removed from the active test suites to reduce false negative results.<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=23878
Testing: Selenium: ZimbraSelenium Overview
2011-01-11T21:45:07Z
<p>Rhoades: /* Project Layout */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged<br />
* "d" - applies to general "Data" for the item. This data could come be a general property or come from SOAP. For example, MailItem.dIsFlagged<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
===Groups===<br />
<br />
Test cases are separated into the following [http://testng.org/doc/documentation-main.html#test-groups groups]: always, sanity, smoke, functional, deprecated, unstable<br />
<br />
====Always====<br />
<br />
The '''always''' group is used to specify test methods that always execute. Mainly, this group is used for @Before* and @After* [http://testng.org/doc/documentation-main.html#annotations annotated] methods.<br />
<br />
====Sanity====<br />
<br />
The '''sanity''' group is used to annotate a select group of test methods that can be used as a sanity suite. The sanity suite should complete quickly (in a few minutes) and provide a broad verification of basic functionality.<br />
<br />
Currently, only test cases that create basic objects in the GUI are marked as sanity. For example:<br />
<br />
* Create a message<br />
* Create a folder<br />
* Create a contact<br />
* Create an addressbook<br />
* Create an appointment<br />
* Create a calendar<br />
* Create a task<br />
* Create a task list<br />
* Create a briefcase document<br />
* Upload a briefcase file<br />
* Create a briefcase folder<br />
* Create a tag<br />
* Create a saved search<br />
<br />
====Smoke====<br />
<br />
The '''smoke''' group is used to annotate a select group of test methods that can be used as a smoke suite. The smoke suite should complete relatively quickly (in a few hours) and provide a detailed verification of basic functionality.<br />
<br />
Currently, test cases that apply all basic actions to all basic objects in the GUI are marked as smoke. For example:<br />
<br />
* Basic objects<br />
* Basic actions<br />
<br />
A cross matrix of objects and actions defines the smoke suite. For instance, the test case that verifies a message (basic object) can be flagged (basic action) is in the smoke suite.<br />
<br />
====Functional====<br />
<br />
====Deprecated====<br />
<br />
====Unstable====<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_Running_ZimbraSelenium&diff=23842
Testing: Selenium: Running ZimbraSelenium
2011-01-08T00:32:20Z
<p>Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
ZimbraSelenium is the automation test harness for verifying the browser based Zimbra clients.<br />
<br />
==Prerequisites==<br />
<br />
===Downloading and Building ZimbraSelenium===<br />
<br />
Please follow the steps in [[Testing:_Selenium:_Building_ZimbraSelenium]].<br />
<br />
Once the project built and no dependency errors were found, you are almost ready to run your tests. Just configure the tests to work properly in your environment as explained in the next section and you'll be ready to test.<br />
<br />
===Software===<br />
<br />
==== STAF ====<br />
The Zimbra Selenium harness depends on [http://staf.sourceforge.net/ STAF] being installed on both the test client and zimbra server. See the design overview for more details.<br />
<br />
Install STAF on both the client and server. And configure security level 5 for communication from the client to the server. For example, if the client IP address is 192.168.1.1 and the server IP address is 192.168.1.2, run this command to set security level 5:<br />
<br />
<pre><br />
<br />
root@192.168.1.1:~# ssh root@192.168.1.2<br />
root@192.168.1.2's password: *****<br />
root@192.168.1.2:~# staf local trust set machine 192.168.1.1 level 5<br />
Response<br />
--------<br />
<br />
root@192.168.1.2:~#<br />
<br />
</pre><br />
<br />
<br />
<br />
=== Tests Configuration===<br />
<br />
The file located in ZimbraSelenium/conf/conf.properties is the master configuration file. Every parameter change required to run the tests properly is configurable using this properties file. <br />
Configure the test harness with the basic parameters required to run properly against your desired version of Zimbra by changing the following variables in the file:<br />
<br />
* server: This is the URL in which the Zimbra install to be tested is running. Please notice that the same must be reachable from the location in which the Selenium RC server is running (localhost, [http://saucelabs.com Sauce OnDemand], a remote machine).<br />
* serverMachineName: The machine in which the Selenium RC server will be running (localhost, sauceondemand or a reachable ip/domain).<br />
* browser: The browser in which the tests should run. This is the standard Selenium browser string.<br />
* locale: The locale in which the installed version of Zimbra is running (en_US, ch, es_Es, etc).<br />
<br />
=== Screen Resolution ===<br />
<br />
Be sure to set client resolution to 1024 X 768 or higher, otherwise the zimbra client will default to the HTML client (See also https://bugzilla.zimbra.com/show_bug.cgi?id=27521).<br />
<br />
==Running ZimbraSelenium==<br />
<br />
===Running from Eclipse===<br />
The ZimbraSelenium source tree includes a build.xml file that has targets to execute the test suite.<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "Run-ExecuteHarnessMain" target<br />
# Set the jarfile, pattern, and groups desired to be executed<br />
# Right-click on "Run-ExecuteHarnessMain" in the Outline, and select "Run"<br />
<br />
Here is an example build.xml "Run-ExecuteHarnessMain" configuration, which runs the "sanity" and "smoke" address book test cases for the Zimbra Mobile Client suite.<br />
<br />
<pre><br />
<target name="Run-ExecuteHarnessMain" depends="jar" description="Run all tests per specified arguments"><br />
<property name="jarfile" value="${dist.lib.dir}/zimbraselenium.jar"/><br />
<property name="pattern" value="projects.mobile.tests.addressbook"/><br />
<property name="groups" value="always,sanity,smoke"/><br />
<echo>Executing ...</echo><br />
<java classname="framework.core.ExecuteHarnessMain" classpathref="class.path" fork="true" failonerror="true"><br />
<arg line="-j '${jarfile}' -p ${pattern} -g ${groups} -l conf/log4j.properties"/> <br />
</java><br />
</target><br />
</pre><br />
<br />
Notes:<br />
<br />
* "always" must be included in the "groups" property<br />
* "zimbraselenium.jar" must be specified in as the "jarfile" property<br />
<br />
===Running from Eclipse (Dev Environment)===<br />
<br />
The ZimbraSelenium source tree is designed to run in the '''Zimbra Development Environment'''. The Dev Environment is used to develop and build the Zimbra product. When developing web clients or zimlets, the Zimbra Selenium test suite can be used to [http://en.wikipedia.org/wiki/Sanity_testing#Software_development Sanity Test] code changes.<br />
<br />
To set up the Dev Environment, use the instructions found in the Zimbra source depot under ZimbraServer/docs/INSTALL-*.txt, for example ZimbraServer/docs/INSTALL-win.txt. Once you have the environment up and running, follow the steps in this section to run the Zimbra Selenium suite.<br />
<br />
Some test suite setup needs to be completed to execute the suite.<br />
<br />
# Open ZimbraSelenium/conf/config.properties<br />
# Modify the server settings for the client URL (i.e. <nowiki>http://localhost:7070</nowiki>)<br />
## Set server.scheme to http or https (by default, the dev env uses http)<br />
## Set server.host to localhost (by default, the dev env uses localhost)<br />
## Set server.port to the web server port number (by default, the dev env uses 7070)<br />
# Modify the admin name to use the PC name<br />
## Set adminName to the admin email address (by default, the dev env uses admin@hostname, where hostname is the computer name. You can check this value by logging into the admin console, usually <nowiki>https://localhost:7071</nowiki> with username/password of admin/test123, then searching for the admin account, which will show the email address as something like "admin@mypcname")<br />
# Open ZimbraSelenium/build.xml<br />
# Locate the "Run-ExecuteHarnessMain (dev)" target<br />
## This target is pre-configured to run the sanity suite<br />
# Right-click on "Run-ExecuteHarnessMain (dev)" in the Outline, and select "Run"<br />
<br><br />
<br />
Here is an example of the config.properties changes:<br />
<pre><br />
...<br />
<br />
# Define the Zimbra server<br />
server.scheme=http<br />
server.host=localhost<br />
server.port=7070<br />
<br />
<br />
ZimbraLogRoot=test-output<br />
adminName=admin@mypcname<br />
adminPwd=test123<br />
isAppliance=false<br />
<br />
...<br />
</pre><br />
<br><br />
<br />
After selecting "Run", the results will be displayed in the Eclipse console output. Here is an example:<br />
<pre><br />
...<br />
[java] 100500 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.servlet.ServletHandler@10ffb38<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped HttpContext[/wd,/wd]<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.Server@1e328e0<br />
[java] 101500 [main] WARN framework.core.SeleniumService - Selenium server is stopped<br />
[java] 101500 [main] INFO framework.core.ExecuteHarnessMain - Total Tests: 7<br />
[java] Total Passed: 35<br />
[java] Total Failed: 0<br />
[java] Total Skipped: 0<br />
[java] Duration: 215 seconds<br />
BUILD SUCCESSFUL<br />
Total time: 4 minutes 14 seconds<br />
<br />
</pre><br />
<br />
<br />
===Running from STAF===<br />
The ZimbraSelenium test suite can be configured using [http://staf.sourceforge.net/ STAF].<br />
<br />
====Build the ZimbraSelenium STAF jar====<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "staf-jar" target<br />
# Right-click on "staf-jar" in the Outline, and select "Run"<br />
# The jar file should be built (ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar)<br />
<br />
<pre><br />
...<br />
jar:<br />
jar-staf-selenium:<br />
[copy] Copying 697 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copied 171 empty directories to 1 empty directory under C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copying 23 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\jars<br />
[jar] Building jar: C:\P4\main\ZimbraSelenium\build\dist\zimbra-6.0.0\lib\zimbraselngstaf.jar<br />
jar-staf:<br />
BUILD SUCCESSFUL<br />
Total time: 33 seconds<br />
</pre><br />
<br />
<br />
==== Configure the STAF jar ====<br />
<br />
Configure zimbraselngstaf.jar with STAF<br />
<br />
# Open C:\STAF\bin\STAF.cfg using a text editor<br />
# Configure the service by adding "service seleniumm library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar"<br />
# Stop STAF<br />
## C:\STAF> staf local shutdown shutdown<br />
# Start STAF<br />
## C:\STAF> stafproc <br />
<br />
Staf.cfg example:<br />
<br />
<pre><br />
# Turn on tracing of internal errors and deprecated options<br />
trace enable tracepoints "error deprecated"<br />
<br />
# Enable TCP/IP connections<br />
interface ssl library STAFTCP option Secure=Yes option Port=6550<br />
<br />
<br />
# Set default local trust<br />
trust level 2 default<br />
trust machine local://local level 5<br />
<br />
# Add default service loader<br />
serviceloader library STAFDSLS<br />
<br />
<br />
service selenium library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar<br />
<br />
</pre><br />
<br />
==== Execute the tests ====<br />
<br />
Use STAF commands to run tests.<br />
<br />
# Get the service help<br />
## C:\STAF> STAF local SELENIUM HELP<br />
# Run a suite<br />
## C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE /p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN projects.mobile.tests.addressbook GROUP always GROUP sanity LOG /tmp<br />
<br />
Example help:<br />
<br />
<pre><br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF>STAF local SELENIUM HELP<br />
<br />
Response<br />
--------<br />
StafTest Service Help<br />
<br />
EXECUTE SERVER <servername|IP address> ROOT <ZimbraSelenium path> JARFILE <path> <br />
PATTERN <projects.zcs.tests> [ GROUP <always|sanity|smoke|full> ]* <br />
[ LOG <folder> ] [ LOG4J <properties file> ]<br />
<br />
QUERY -- TBD: should return statistics on active jobs<br />
<br />
HALT <TBD> -- TBD: should stop any executing tests<br />
<br />
HELP<br />
<br />
<br />
<br />
C:\STAF><br />
</pre><br />
<br />
<br />
Example execute:<br />
<br />
<pre > <br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE <br />
/p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN <br />
projects.mobile.tests.addressbook GROPU always GROUP sanity LOG /tmp<br />
Response<br />
---------------<br />
Total Tests: 2<br />
Total Passed: 2<br />
Total Failed: 0<br />
Total Skipped: 0<br />
<br />
<br />
<br />
C:\Documents and Settings\zimbra><br />
<br />
C:\STAF><br />
</pre><br />
<br />
===Running from the command line===<br />
<br />
==== Running with ant commands ====<br />
<br />
===== Installing Ant =====<br />
You need Ant 1.7+ to be installed on your system. <br />
<br />
'''Notice''': If you are running '''Mac OS X 10.5''' or newer you can safely skip this step — the system comes with Ant 1.7.0 pre-installed. <br />
<br />
If you are running an older version on Mac OS X you still need to install Ant 1.7: the pre-installed Ant version is too much behind. Follow the instructions described in the "Other Systems" section. <br />
<br />
<u>Ubuntu</u><br />
<br />
If you are running Ubuntu 8.04 "Hardy Heron", the easier way to install Ant 1.7 is to run: <br />
<br />
sudo apt-get install ant ant-optional<br />
<br />
<u>Other Systems</u><br />
<br />
Install [http://ant.apache.org/bindownload.cgi Ant 1.7.x] and make sure it is in your PATH: <br />
<br />
Download the binary distribution.<br/><br />
Unpack the [http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.1-bin.zip binary distribution] in the directory of your choice.<br/><br />
Add <where you unpacked the zip file>/apache-ant-1.7.0/bin to your PATH environment variable. <br/><br />
Check that your Ant installation is OK: <br/><br />
ant -version<br />
Apache Ant version 1.7.0 compiled on December 13 2006<br />
<br />
===== Running the tests =====<br />
<br />
# cd to ZimbraSelenium dir<br />
# run ant targets: <br />
<br />
ant "Run tests" <br />
Runs both ajax and html suite<br />
<br />
ant "Run ajax tests" <br />
Copies i18n and test data, compiles the code, creates the jar file and runs ajax suite<br />
<br />
ant "Run html tests"<br />
Copies i18n and test data, compiles the code, creates the jar file and runs html suite<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_Running_ZimbraSelenium&diff=23826
Testing: Selenium: Running ZimbraSelenium
2011-01-04T00:10:15Z
<p>Rhoades: /* Tests Configuration */</p>
<hr />
<div>==General Information==<br />
<br />
ZimbraSelenium is the automation test harness for verifying the browser based Zimbra clients.<br />
<br />
==Downloading and Building ZimbraSelenium==<br />
<br />
Please follow the steps in [[Testing:_Selenium:_Building_ZimbraSelenium]].<br />
<br />
Once the project built and no dependency errors were found, you are almost ready to run your tests. Just configure the tests to work properly in your environment as explained in the next section and you'll be ready to test.<br />
<br />
== Tests Configuration==<br />
The file located in ZimbraSelenium/conf/conf.properties is the master configuration file. Every parameter change required to run the tests properly is configurable using this properties file. <br />
Configure the test harness with the basic parameters required to run properly against your desired version of Zimbra by changing the following variables in the file:<br />
<br />
* server: This is the URL in which the Zimbra install to be tested is running. Please notice that the same must be reachable from the location in which the Selenium RC server is running (localhost, [http://saucelabs.com Sauce OnDemand], a remote machine).<br />
* serverMachineName: The machine in which the Selenium RC server will be running (localhost, sauceondemand or a reachable ip/domain).<br />
* browser: The browser in which the tests should run. This is the standard Selenium browser string.<br />
* locale: The locale in which the installed version of Zimbra is running (en_US, ch, es_Es, etc).<br />
<br />
=== Notes ===<br />
<br />
* Be sure to set client resolution to 1024 X 768 or higher, otherwise the client will default to the HTML client (See also https://bugzilla.zimbra.com/show_bug.cgi?id=27521).<br />
<br />
==Running ZimbraSelenium==<br />
<br />
===Running from Eclipse===<br />
The ZimbraSelenium source tree includes a build.xml file that has targets to execute the test suite.<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "Run-ExecuteHarnessMain" target<br />
# Set the jarfile, pattern, and groups desired to be executed<br />
# Right-click on "Run-ExecuteHarnessMain" in the Outline, and select "Run"<br />
<br />
Here is an example build.xml "Run-ExecuteHarnessMain" configuration, which runs the "sanity" and "smoke" address book test cases for the Zimbra Mobile Client suite.<br />
<br />
<pre><br />
<target name="Run-ExecuteHarnessMain" depends="jar" description="Run all tests per specified arguments"><br />
<property name="jarfile" value="${dist.lib.dir}/zimbraselenium.jar"/><br />
<property name="pattern" value="projects.mobile.tests.addressbook"/><br />
<property name="groups" value="always,sanity,smoke"/><br />
<echo>Executing ...</echo><br />
<java classname="framework.core.ExecuteHarnessMain" classpathref="class.path" fork="true" failonerror="true"><br />
<arg line="-j '${jarfile}' -p ${pattern} -g ${groups} -l conf/log4j.properties"/> <br />
</java><br />
</target><br />
</pre><br />
<br />
Notes:<br />
<br />
* "always" must be included in the "groups" property<br />
* "zimbraselenium.jar" must be specified in as the "jarfile" property<br />
<br />
===Running from Eclipse (Dev Environment)===<br />
<br />
The ZimbraSelenium source tree is designed to run in the '''Zimbra Development Environment'''. The Dev Environment is used to develop and build the Zimbra product. When developing web clients or zimlets, the Zimbra Selenium test suite can be used to [http://en.wikipedia.org/wiki/Sanity_testing#Software_development Sanity Test] code changes.<br />
<br />
To set up the Dev Environment, use the instructions found in the Zimbra source depot under ZimbraServer/docs/INSTALL-*.txt, for example ZimbraServer/docs/INSTALL-win.txt. Once you have the environment up and running, follow the steps in this section to run the Zimbra Selenium suite.<br />
<br />
Some test suite setup needs to be completed to execute the suite.<br />
<br />
# Open ZimbraSelenium/conf/config.properties<br />
# Modify the server settings for the client URL (i.e. <nowiki>http://localhost:7070</nowiki>)<br />
## Set server.scheme to http or https (by default, the dev env uses http)<br />
## Set server.host to localhost (by default, the dev env uses localhost)<br />
## Set server.port to the web server port number (by default, the dev env uses 7070)<br />
# Modify the admin name to use the PC name<br />
## Set adminName to the admin email address (by default, the dev env uses admin@hostname, where hostname is the computer name. You can check this value by logging into the admin console, usually <nowiki>https://localhost:7071</nowiki> with username/password of admin/test123, then searching for the admin account, which will show the email address as something like "admin@mypcname")<br />
# Open ZimbraSelenium/build.xml<br />
# Locate the "Run-ExecuteHarnessMain (dev)" target<br />
## This target is pre-configured to run the sanity suite<br />
# Right-click on "Run-ExecuteHarnessMain (dev)" in the Outline, and select "Run"<br />
<br><br />
<br />
Here is an example of the config.properties changes:<br />
<pre><br />
...<br />
<br />
# Define the Zimbra server<br />
server.scheme=http<br />
server.host=localhost<br />
server.port=7070<br />
<br />
<br />
ZimbraLogRoot=test-output<br />
adminName=admin@mypcname<br />
adminPwd=test123<br />
isAppliance=false<br />
<br />
...<br />
</pre><br />
<br><br />
<br />
After selecting "Run", the results will be displayed in the Eclipse console output. Here is an example:<br />
<pre><br />
...<br />
[java] 100500 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.servlet.ServletHandler@10ffb38<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped HttpContext[/wd,/wd]<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.Server@1e328e0<br />
[java] 101500 [main] WARN framework.core.SeleniumService - Selenium server is stopped<br />
[java] 101500 [main] INFO framework.core.ExecuteHarnessMain - Total Tests: 7<br />
[java] Total Passed: 35<br />
[java] Total Failed: 0<br />
[java] Total Skipped: 0<br />
[java] Duration: 215 seconds<br />
BUILD SUCCESSFUL<br />
Total time: 4 minutes 14 seconds<br />
<br />
</pre><br />
<br />
<br />
===Running from STAF===<br />
The ZimbraSelenium test suite can be configured using [http://staf.sourceforge.net/ STAF].<br />
<br />
====Build the ZimbraSelenium STAF jar====<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "staf-jar" target<br />
# Right-click on "staf-jar" in the Outline, and select "Run"<br />
# The jar file should be built (ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar)<br />
<br />
<pre><br />
...<br />
jar:<br />
jar-staf-selenium:<br />
[copy] Copying 697 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copied 171 empty directories to 1 empty directory under C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copying 23 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\jars<br />
[jar] Building jar: C:\P4\main\ZimbraSelenium\build\dist\zimbra-6.0.0\lib\zimbraselngstaf.jar<br />
jar-staf:<br />
BUILD SUCCESSFUL<br />
Total time: 33 seconds<br />
</pre><br />
<br />
<br />
==== Configure the STAF jar ====<br />
<br />
Configure zimbraselngstaf.jar with STAF<br />
<br />
# Open C:\STAF\bin\STAF.cfg using a text editor<br />
# Configure the service by adding "service seleniumm library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar"<br />
# Stop STAF<br />
## C:\STAF> staf local shutdown shutdown<br />
# Start STAF<br />
## C:\STAF> stafproc <br />
<br />
Staf.cfg example:<br />
<br />
<pre><br />
# Turn on tracing of internal errors and deprecated options<br />
trace enable tracepoints "error deprecated"<br />
<br />
# Enable TCP/IP connections<br />
interface ssl library STAFTCP option Secure=Yes option Port=6550<br />
<br />
<br />
# Set default local trust<br />
trust level 2 default<br />
trust machine local://local level 5<br />
<br />
# Add default service loader<br />
serviceloader library STAFDSLS<br />
<br />
<br />
service selenium library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar<br />
<br />
</pre><br />
<br />
==== Execute the tests ====<br />
<br />
Use STAF commands to run tests.<br />
<br />
# Get the service help<br />
## C:\STAF> STAF local SELENIUM HELP<br />
# Run a suite<br />
## C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE /p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN projects.mobile.tests.addressbook GROUP always GROUP sanity LOG /tmp<br />
<br />
Example help:<br />
<br />
<pre><br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF>STAF local SELENIUM HELP<br />
<br />
Response<br />
--------<br />
StafTest Service Help<br />
<br />
EXECUTE SERVER <servername|IP address> ROOT <ZimbraSelenium path> JARFILE <path> <br />
PATTERN <projects.zcs.tests> [ GROUP <always|sanity|smoke|full> ]* <br />
[ LOG <folder> ] [ LOG4J <properties file> ]<br />
<br />
QUERY -- TBD: should return statistics on active jobs<br />
<br />
HALT <TBD> -- TBD: should stop any executing tests<br />
<br />
HELP<br />
<br />
<br />
<br />
C:\STAF><br />
</pre><br />
<br />
<br />
Example execute:<br />
<br />
<pre > <br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE <br />
/p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN <br />
projects.mobile.tests.addressbook GROPU always GROUP sanity LOG /tmp<br />
Response<br />
---------------<br />
Total Tests: 2<br />
Total Passed: 2<br />
Total Failed: 0<br />
Total Skipped: 0<br />
<br />
<br />
<br />
C:\Documents and Settings\zimbra><br />
<br />
C:\STAF><br />
</pre><br />
<br />
===Running from the command line===<br />
<br />
==== Running with ant commands ====<br />
<br />
===== Installing Ant =====<br />
You need Ant 1.7+ to be installed on your system. <br />
<br />
'''Notice''': If you are running '''Mac OS X 10.5''' or newer you can safely skip this step — the system comes with Ant 1.7.0 pre-installed. <br />
<br />
If you are running an older version on Mac OS X you still need to install Ant 1.7: the pre-installed Ant version is too much behind. Follow the instructions described in the "Other Systems" section. <br />
<br />
<u>Ubuntu</u><br />
<br />
If you are running Ubuntu 8.04 "Hardy Heron", the easier way to install Ant 1.7 is to run: <br />
<br />
sudo apt-get install ant ant-optional<br />
<br />
<u>Other Systems</u><br />
<br />
Install [http://ant.apache.org/bindownload.cgi Ant 1.7.x] and make sure it is in your PATH: <br />
<br />
Download the binary distribution.<br/><br />
Unpack the [http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.1-bin.zip binary distribution] in the directory of your choice.<br/><br />
Add <where you unpacked the zip file>/apache-ant-1.7.0/bin to your PATH environment variable. <br/><br />
Check that your Ant installation is OK: <br/><br />
ant -version<br />
Apache Ant version 1.7.0 compiled on December 13 2006<br />
<br />
===== Running the tests =====<br />
<br />
# cd to ZimbraSelenium dir<br />
# run ant targets: <br />
<br />
ant "Run tests" <br />
Runs both ajax and html suite<br />
<br />
ant "Run ajax tests" <br />
Copies i18n and test data, compiles the code, creates the jar file and runs ajax suite<br />
<br />
ant "Run html tests"<br />
Copies i18n and test data, compiles the code, creates the jar file and runs html suite<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21779
Testing: Selenium: ZimbraSelenium Overview
2010-12-02T21:24:05Z
<p>Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged<br />
* "d" - applies to general "Data" for the item. This data could come be a general property or come from SOAP. For example, MailItem.dIsFlagged<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_RefImages&diff=21778
Testing: Selenium: ZimbraSelenium RefImages
2010-12-02T21:23:35Z
<p>Rhoades: Created page with '==General Information== The '''Zimbra Selenium Harness''' uses the following images to describe the harness design. ==Ajax Application Images== For reference, these screen ca…'</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' uses the following images to describe the harness design.<br />
<br />
<br />
==Ajax Application Images==<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
===Login Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
===General Ajax Page===<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
===Mail Page===<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
===Addressbook Page===<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
===Calendar Page===<br />
<br />
TBD<br />
<br />
===Tasks Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
===Briefcase Page===<br />
<br />
===Preferences Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
===Zimlets Page - Social===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
===Search Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
===Folder Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
===Minical Page===<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21769
Testing: Selenium: ZimbraSelenium Overview
2010-12-01T21:04:13Z
<p>Rhoades: /* Coding Conventions */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged<br />
* "d" - applies to general "Data" for the item. This data could come be a general property or come from SOAP. For example, MailItem.dIsFlagged<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_Running_ZimbraSelenium&diff=21766
Testing: Selenium: Running ZimbraSelenium
2010-12-01T00:24:12Z
<p>Rhoades: /* Running ZimbraSelenium */</p>
<hr />
<div>==General Information==<br />
<br />
ZimbraSelenium is the automation test harness for verifying the browser based Zimbra clients.<br />
<br />
==Downloading and Building ZimbraSelenium==<br />
<br />
Please follow the steps in [[Testing:_Selenium:_Building_ZimbraSelenium]].<br />
<br />
Once the project built and no dependency errors were found, you are almost ready to run your tests. Just configure the tests to work properly in your environment as explained in the next section and you'll be ready to test.<br />
<br />
== Tests Configuration==<br />
The file located in ZimbraSelenium/conf/conf.properties is the master configuration file. Every parameter change required to run the tests properly is configurable using this properties file. <br />
Configure the test harness with the basic parameters required to run properly against your desired version of Zimbra by changing the following variables in the file:<br />
<br />
* server: This is the URL in which the Zimbra install to be tested is running. Please notice that the same must be reachable from the location in which the Selenium RC server is running (localhost, [http://saucelabs.com Sauce OnDemand], a remote machine).<br />
* serverMachineName: The machine in which the Selenium RC server will be running (localhost, sauceondemand or a reachable ip/domain).<br />
* browser: The browser in which the tests should run. This is the standard Selenium browser string.<br />
* locale: The locale in which the installed version of Zimbra is running (en_US, ch, es_Es, etc).<br />
<br />
==Running ZimbraSelenium==<br />
<br />
===Running from Eclipse===<br />
The ZimbraSelenium source tree includes a build.xml file that has targets to execute the test suite.<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "Run-ExecuteHarnessMain" target<br />
# Set the jarfile, pattern, and groups desired to be executed<br />
# Right-click on "Run-ExecuteHarnessMain" in the Outline, and select "Run"<br />
<br />
Here is an example build.xml "Run-ExecuteHarnessMain" configuration, which runs the "sanity" and "smoke" address book test cases for the Zimbra Mobile Client suite.<br />
<br />
<pre><br />
<target name="Run-ExecuteHarnessMain" depends="jar" description="Run all tests per specified arguments"><br />
<property name="jarfile" value="${dist.lib.dir}/zimbraselenium.jar"/><br />
<property name="pattern" value="projects.mobile.tests.addressbook"/><br />
<property name="groups" value="always,sanity,smoke"/><br />
<echo>Executing ...</echo><br />
<java classname="framework.core.ExecuteHarnessMain" classpathref="class.path" fork="true" failonerror="true"><br />
<arg line="-j '${jarfile}' -p ${pattern} -g ${groups} -l conf/log4j.properties"/> <br />
</java><br />
</target><br />
</pre><br />
<br />
Notes:<br />
<br />
* "always" must be included in the "groups" property<br />
* "zimbraselenium.jar" must be specified in as the "jarfile" property<br />
<br />
===Running from Eclipse (Dev Environment)===<br />
<br />
The ZimbraSelenium source tree is designed to run in the '''Zimbra Development Environment'''. The Dev Environment is used to develop and build the Zimbra product. When developing web clients or zimlets, the Zimbra Selenium test suite can be used to [http://en.wikipedia.org/wiki/Sanity_testing#Software_development Sanity Test] code changes.<br />
<br />
To set up the Dev Environment, use the instructions found in the Zimbra source depot under ZimbraServer/docs/INSTALL-*.txt, for example ZimbraServer/docs/INSTALL-win.txt. Once you have the environment up and running, follow the steps in this section to run the Zimbra Selenium suite.<br />
<br />
Some test suite setup needs to be completed to execute the suite.<br />
<br />
# Open ZimbraSelenium/conf/config.properties<br />
# Modify the server settings for the client URL (i.e. <nowiki>http://localhost:7070</nowiki>)<br />
## Set server.scheme to http or https (by default, the dev env uses http)<br />
## Set server.host to localhost (by default, the dev env uses localhost)<br />
## Set server.port to the web server port number (by default, the dev env uses 7070)<br />
# Modify the admin name to use the PC name<br />
## Set adminName to the admin email address (by default, the dev env uses admin@hostname, where hostname is the computer name. You can check this value by logging into the admin console, usually <nowiki>https://localhost:7071</nowiki> with username/password of admin/test123, then searching for the admin account, which will show the email address as something like "admin@mypcname")<br />
# Open ZimbraSelenium/build.xml<br />
# Locate the "Run-ExecuteHarnessMain (dev)" target<br />
## This target is pre-configured to run the sanity suite<br />
# Right-click on "Run-ExecuteHarnessMain (dev)" in the Outline, and select "Run"<br />
<br><br />
<br />
Here is an example of the config.properties changes:<br />
<pre><br />
...<br />
<br />
# Define the Zimbra server<br />
server.scheme=http<br />
server.host=localhost<br />
server.port=7070<br />
<br />
<br />
ZimbraLogRoot=test-output<br />
adminName=admin@mypcname<br />
adminPwd=test123<br />
isAppliance=false<br />
<br />
...<br />
</pre><br />
<br><br />
<br />
After selecting "Run", the results will be displayed in the Eclipse console output. Here is an example:<br />
<pre><br />
...<br />
[java] 100500 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.servlet.ServletHandler@10ffb38<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped HttpContext[/wd,/wd]<br />
[java] 100547 [main] INFO org.openqa.jetty.util.Container - Stopped org.openqa.jetty.jetty.Server@1e328e0<br />
[java] 101500 [main] WARN framework.core.SeleniumService - Selenium server is stopped<br />
[java] 101500 [main] INFO framework.core.ExecuteHarnessMain - Total Tests: 7<br />
[java] Total Passed: 35<br />
[java] Total Failed: 0<br />
[java] Total Skipped: 0<br />
[java] Duration: 215 seconds<br />
BUILD SUCCESSFUL<br />
Total time: 4 minutes 14 seconds<br />
<br />
</pre><br />
<br />
<br />
===Running from STAF===<br />
The ZimbraSelenium test suite can be configured using [http://staf.sourceforge.net/ STAF].<br />
<br />
====Build the ZimbraSelenium STAF jar====<br />
<br />
# Open ZimbraSelenium/build.xml<br />
# Open the "outline view", if not already open<br />
## Window -> Show View -> Outline<br />
# Locate the "staf-jar" target<br />
# Right-click on "staf-jar" in the Outline, and select "Run"<br />
# The jar file should be built (ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar)<br />
<br />
<pre><br />
...<br />
jar:<br />
jar-staf-selenium:<br />
[copy] Copying 697 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copied 171 empty directories to 1 empty directory under C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\classes<br />
[copy] Copying 23 files to C:\P4\main\ZimbraSelenium\build\staf\selenium\STAF-INF\jars<br />
[jar] Building jar: C:\P4\main\ZimbraSelenium\build\dist\zimbra-6.0.0\lib\zimbraselngstaf.jar<br />
jar-staf:<br />
BUILD SUCCESSFUL<br />
Total time: 33 seconds<br />
</pre><br />
<br />
<br />
==== Configure the STAF jar ====<br />
<br />
Configure zimbraselngstaf.jar with STAF<br />
<br />
# Open C:\STAF\bin\STAF.cfg using a text editor<br />
# Configure the service by adding "service seleniumm library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar"<br />
# Stop STAF<br />
## C:\STAF> staf local shutdown shutdown<br />
# Start STAF<br />
## C:\STAF> stafproc <br />
<br />
Staf.cfg example:<br />
<br />
<pre><br />
# Turn on tracing of internal errors and deprecated options<br />
trace enable tracepoints "error deprecated"<br />
<br />
# Enable TCP/IP connections<br />
interface ssl library STAFTCP option Secure=Yes option Port=6550<br />
<br />
<br />
# Set default local trust<br />
trust level 2 default<br />
trust machine local://local level 5<br />
<br />
# Add default service loader<br />
serviceloader library STAFDSLS<br />
<br />
<br />
service selenium library JSTAF execute /P4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselngstaf.jar<br />
<br />
</pre><br />
<br />
==== Execute the tests ====<br />
<br />
Use STAF commands to run tests.<br />
<br />
# Get the service help<br />
## C:\STAF> STAF local SELENIUM HELP<br />
# Run a suite<br />
## C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE /p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN projects.mobile.tests.addressbook GROUP always GROUP sanity LOG /tmp<br />
<br />
Example help:<br />
<br />
<pre><br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF>STAF local SELENIUM HELP<br />
<br />
Response<br />
--------<br />
StafTest Service Help<br />
<br />
EXECUTE SERVER <servername|IP address> ROOT <ZimbraSelenium path> JARFILE <path> <br />
PATTERN <projects.zcs.tests> [ GROUP <always|sanity|smoke|full> ]* <br />
[ LOG <folder> ] [ LOG4J <properties file> ]<br />
<br />
QUERY -- TBD: should return statistics on active jobs<br />
<br />
HALT <TBD> -- TBD: should stop any executing tests<br />
<br />
HELP<br />
<br />
<br />
<br />
C:\STAF><br />
</pre><br />
<br />
<br />
Example execute:<br />
<br />
<pre > <br />
<br />
C:\STAF><br />
C:\STAF><br />
C:\STAF> STAF local SELENIUM EXECUTE SERVER server.com ROOT /p4/main/ZimbraSelenium JARFILE <br />
/p4/main/ZimbraSelenium/build/dist/zimbra-6.0.0/lib/zimbraselenium.jar PATTERN <br />
projects.mobile.tests.addressbook GROPU always GROUP sanity LOG /tmp<br />
Response<br />
---------------<br />
Total Tests: 2<br />
Total Passed: 2<br />
Total Failed: 0<br />
Total Skipped: 0<br />
<br />
<br />
<br />
C:\Documents and Settings\zimbra><br />
<br />
C:\STAF><br />
</pre><br />
<br />
===Running from the command line===<br />
<br />
==== Running with ant commands ====<br />
<br />
===== Installing Ant =====<br />
You need Ant 1.7+ to be installed on your system. <br />
<br />
'''Notice''': If you are running '''Mac OS X 10.5''' or newer you can safely skip this step — the system comes with Ant 1.7.0 pre-installed. <br />
<br />
If you are running an older version on Mac OS X you still need to install Ant 1.7: the pre-installed Ant version is too much behind. Follow the instructions described in the "Other Systems" section. <br />
<br />
<u>Ubuntu</u><br />
<br />
If you are running Ubuntu 8.04 "Hardy Heron", the easier way to install Ant 1.7 is to run: <br />
<br />
sudo apt-get install ant ant-optional<br />
<br />
<u>Other Systems</u><br />
<br />
Install [http://ant.apache.org/bindownload.cgi Ant 1.7.x] and make sure it is in your PATH: <br />
<br />
Download the binary distribution.<br/><br />
Unpack the [http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.1-bin.zip binary distribution] in the directory of your choice.<br/><br />
Add <where you unpacked the zip file>/apache-ant-1.7.0/bin to your PATH environment variable. <br/><br />
Check that your Ant installation is OK: <br/><br />
ant -version<br />
Apache Ant version 1.7.0 compiled on December 13 2006<br />
<br />
===== Running the tests =====<br />
<br />
# cd to ZimbraSelenium dir<br />
# run ant targets: <br />
<br />
ant "Run tests" <br />
Runs both ajax and html suite<br />
<br />
ant "Run ajax tests" <br />
Copies i18n and test data, compiles the code, creates the jar file and runs ajax suite<br />
<br />
ant "Run html tests"<br />
Copies i18n and test data, compiles the code, creates the jar file and runs html suite<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21723
Testing: Selenium: ZimbraSelenium Overview
2010-11-23T05:23:54Z
<p>Rhoades: /* Project Layout */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
===Coding Conventions===<br />
<br />
To aid in understanding the purpose for classes, methods, and variables, the following coding conventions are used.<br />
<br />
Variables start with a lower case letter as follows:<br />
<br />
* "s" - re-use of "Selenium" methods. For example, AbsSeleniumObject.sIsElementPresent() simply points to DefaultSelenium.isElementPresent()<br />
* "z" - applies to Zimbra specific use-case or functionality. For example, PageMail.zToolbarPressButton()<br />
* "g" - applies to a "GUI" specific data. For example, MailItem.gIsFlagged (Proposed)<br />
* "a" - applies to a "SOAP API" specific data. For example, MailItem.aIsFlagged (Proposed)<br />
<br />
Class names for UI objects should start with the abstract class type. For example, PageMail begins with "Page" because is extends from AbsPage.<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21717
Testing: Selenium: ZimbraSelenium Overview
2010-11-21T19:27:03Z
<p>Rhoades: /* GUI Presentation Tests */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21716
Testing: Selenium: ZimbraSelenium Overview
2010-11-21T19:26:46Z
<p>Rhoades: /* Test Method Structure */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Most GUI test cases fall into 2 categories:<br />
<br />
# GUI presentation tests<br />
# GUI action tests<br />
<br />
==== GUI Presentation Tests ====<br />
<br />
GUI presentation tests use the GUI to verify how Zimbra mailbox data is presented to the end user. Test methods normally use 2 steps:<br />
<br />
# Data setup<br />
# GUI verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI verification'', the displayed data in the GUI is measured and verified. The Zimbra Selenium Harness has methods to get displayed information as objects and simple strings.<br />
<br />
For example, a test case objective may be to "Verify the initial search string is used":<br />
<br />
//// ** Data setup<br />
<br />
// Change account setting<br />
String initialSearchPref = "is:unread";<br />
account.modifyPref("zimbraPrefMailInitialSearch", initialSearchPref);<br />
<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
app.refresh();<br />
String displayedSearch = app.SearchPage.getSearchString();<br />
ZAssert.assertEquals(initialSearchPref, displayedSearech", "Verify the initial search string is used");<br />
<br />
<br />
==== GUI Action Tests ====<br />
<br />
GUI action tests use the GUI under test to modify Zimbra mailbox data. Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
''Data setup'', is the same as GUI presentation tests.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21715
Testing: Selenium: ZimbraSelenium Overview
2010-11-21T19:14:21Z
<p>Rhoades: /* Business Logic */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods methods]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests.<br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21714
Testing: Selenium: ZimbraSelenium Overview
2010-11-21T19:12:46Z
<p>Rhoades: /* General Information */</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg&diff=21649
File:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg
2010-11-17T22:09:18Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg&diff=21648
File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg
2010-11-17T22:07:50Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg&diff=21647
File:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg
2010-11-17T22:07:05Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21646
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T22:06:06Z
<p>Rhoades: /* Addressbook Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
The following diagram shows the general "AddressbookPage" view. The "AddressbookPage" includes elements within the red box and are further separated into:<br />
<br />
* Toolbars (green)<br />
* List (blue)<br />
* DisplayContact (orange)<br />
* TBD (yellow)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows the "ComposeContact" object (red)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.AddressbookPage.listClick(displayname, Button.RIGHT_CLICK, Button.NEW_MAIL);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg&diff=21642
File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg
2010-11-17T22:02:44Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21641
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T21:57:21Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows an example of clicking on item (green) and selecting from the context menu (red).<br />
<br />
// Example code to reply to a message using the context menu<br />
app.MailPage.listClick(subject, Button.RIGHT_CLICK, Button.Reply);<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail4.jpeg&diff=21640
File:ZimbraSeleniumScreenshotAjaxMail4.jpeg
2010-11-17T21:55:40Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxMail4.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21639
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T21:54:07Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object including the compose (red) and toolbar (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail3.jpeg&diff=21638
File:ZimbraSeleniumScreenshotAjaxMail3.jpeg
2010-11-17T21:53:21Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxMail3.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21637
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T21:52:16Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red) after selecting (LEFT_CLICK) on list item (green).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "ComposeMail" object (red).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail2.jpeg&diff=21636
File:ZimbraSeleniumScreenshotAjaxMail2.jpeg
2010-11-17T21:51:15Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxMail2.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21635
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T21:50:06Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
The following diagram shows the general "MailPage" view. The "MailPage" includes elements within the red box.<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the breakdown of the terms:<br />
<br />
* Toolbar (red)<br />
* Columns (green)<br />
* List (blue)<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
<br />
The following diagram shows the "DisplayMail" object (red).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail1.jpeg&diff=21634
File:ZimbraSeleniumScreenshotAjaxMail1.jpeg
2010-11-17T21:48:11Z
<p>Rhoades: uploaded a new version of "File:ZimbraSeleniumScreenshotAjaxMail1.jpeg"</p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumScreenshotAjaxMail1a.jpeg&diff=21632
File:ZimbraSeleniumScreenshotAjaxMail1a.jpeg
2010-11-17T21:43:25Z
<p>Rhoades: </p>
<hr />
<div></div>
Rhoades
https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Overview&diff=21631
Testing: Selenium: ZimbraSelenium Overview
2010-11-17T21:43:15Z
<p>Rhoades: /* Mail Page */</p>
<hr />
<div>==General Information==<br />
<br />
The Zimbra '''Selenium Harness''' is a [http://en.wikipedia.org/wiki/System_testing system testing] [http://en.wikipedia.org/wiki/Test_harness test harness] for the Zimbra Web Clients. The Selenium harness uses [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium], and [http://testng.org/doc/index.html TestNG] technologies to drive web client usage against the Zimbra server.<br />
<br />
These Zimbra clients are tested by the Selenium Harness:<br />
<br />
* Ajax Client<br />
* HTML Client<br />
* Mobile Client<br />
* Admin Console<br />
* Desktop<br />
<br />
==Source Code==<br />
<br />
See [[Testing:_Selenium:_Building_ZimbraSelenium|Building ZimbraSelenium]]<br />
<br />
==Javadoc==<br />
<br />
[http://en.wikipedia.org/wiki/Javadoc Javadoc] can be generated from the source code tree. After building the software, run the "javadocs" target from ZimbraSelenium/build.xml. A javadoc tree will be created in ZimbraSelenium/build/generated/javadocs. Open index.html to view the javadocs.<br />
<br />
==Project Layout==<br />
<br />
===Project Structure===<br />
<br />
The following folders are located in the ZimbraSelenium java project. [[Image:ZimbraSeleniumProjectStructure.jpeg|thumb|right|200px|Selenium Structure]] <br />
<br />
* conf: contains configuration files for how the harness executes<br />
* data: contains test data files, such as MIME files, ICS files.<br />
* jars: contains third party external jar files<br />
* src/bin: contains test scripts, such as perl scripts and shell scripts<br />
* src/java: contains java source code<br />
* build.xml: project ant build file<br />
<br />
===Java Structure===<br />
<br />
The following major packages are located in the ZimbraSelenium java project.<br />
<br />
* framework: basic java classes that apply to all testable clients<br />
* projects: java classes specific to the tested clients<br />
* staf: java classes that apply to integration with [[http://staf.sourceforge.net/ STAF]]<br />
<br />
====Framework====<br />
<br />
The framework package contains basic classes that apply to all testable clients. <br />
<br />
"framework.core" contains the main execution method and Zimbra selenium classes.<br />
<br />
"framework.items" contains classes that define basic Zimbra objects, such as Mail, Appointments, Contacts, Tasks, Tags, and Folders.<br />
<br />
"framework.ui" contains abstract classes that define basic GUI objects, such as an Client Application, Application Page, Displayed Object, Form Object, Folder Tree Object.<br />
<br />
"framework.util" contains utilities classes, such as injecting a MIME or creating a Zimbra Account.<br />
<br />
====Projects====<br />
<br />
Each web application is contained in a package in projects.<br />
<br />
* projects.admin: java classes specific to the Admin Console<br />
* projects.ajax: java classes specific to the Ajax client<br />
* projects.html: java classes specific to the HTML client<br />
* projects.mobile: java classes specific to the Mobile client<br />
* projects.desktop: java classes specific to the Desktop client<br />
<br />
Each project contains 3 sub-packages:<br />
<br />
* projects.name.tests: all TestNG test classes are placed in "tests". Classes are further separated by functional areas within the package.<br />
* projects.name.ui: all abstract classes from "framework.ui" are placed in "ui".<br />
* projects.name.core: all non-test classes and non-ui classes are placed in the core package<br />
<br />
==Harness Design==<br />
<br />
===Business Logic===<br />
<br />
The Selenium Harness is designed with a [http://en.wikipedia.org/wiki/Business_logic_layer Business Logic] layer that abstracts the GUI implementation from the Test Case [http://testng.org/doc/documentation-main.html#methods method]. With the abstraction layer, test case maintenance is reduced when the GUI implementation is changed. For example, to compose a new mail, the test method code may look like:<br />
<br />
<br />
//// This is an example of a test method to compose a new mail<br />
<br />
<br />
// Create the application object<br />
Application app = new ZimbraAjaxClientApplication();<br />
<br />
// Click the new button, get the compose page<br />
ComposePage compose = app.mailPage.toolbar(Button.NEW);<br />
<br />
// Fill out the compose page<br />
compose.to = "foo@example.com";<br />
compose.subject = "itinerary";<br />
compose.body = "Meet me at the Zimbra Offices at 10:00 AM";<br />
<br />
// Send the message<br />
compose.send();<br />
<br />
<br />
<br />
The test case methods use general end-user steps - the 'business logic' that does not change in an email application. The test case methods are not required to use any reference of the GUI implementation or selenium data (such as [http://release.seleniumhq.org/selenium-core/0.8.0/reference.html locators]). The Application, ZimbraAjaxClientApplication, and ComposePage classes are defined in the test harness, and those classes contain the logic to drive the specified user actions.<br />
<br />
For most basic test cases, it is suggested to use the test harness building blocks within the test methods. However, a test method may be verifying a feature that is not defined in the test harness, and in those cases, the test methods should invoke lower level Selenium requests. <br />
<br />
===Test Method Structure===<br />
<br />
Test methods normally use 3 steps:<br />
<br />
# Data setup<br />
# GUI action<br />
# GUI or Data verification<br />
<br />
In ''Data setup'', test case preconditions are set up. When a mailbox requires data to be created, it is preferred to use SOAP, REST, LMTP, etc. to set up such data which is much faster and more stable than using the GUI. Setup actions may include injecting a message into the mailbox (LMTP), sending a appointment invitation from a separate account (SOAP), posting a file to the briefcase (REST), setting the account preferences (SOAP), etc.<br />
<br />
In ''GUI action'', the test case actions are executed. Actions may include navigation to a separate app such as Contacts, refreshing the calendar by clicking on the Refresh button, sending a new message, etc.<br />
<br />
In ''GUI or Data verification'', the test verification points are measured. The Zimbra Selenium Harness uses a ZAssert class to verify. Where possible, it is preferred to use SOAP, REST, etc. to verify data (but, obviously these interfaces will not work when verifying a GUI requirement).<br />
<br />
For example, a test case objective may be to "Verify an incoming message is placed in the inbox list."<br />
<br />
//// ** Data setup<br />
<br />
// Inject the message using LMTP<br />
LMTPUtil.inject(testaccount, "C:\data\mimesample.txt");<br />
String subject = "mimesample";<br />
<br />
//// ** GUI action<br />
<br />
// Refresh the inbox list<br />
app.MailPage.toolbarClick(Button.GetMail);<br />
<br />
//// ** GUI or Data verification<br />
<br />
// Verify the message list in the GUI contains the new message<br />
List<Message> messages app.MailPage.getMessageList();<br />
ZAssert.assertContains(messages, new Message(subject), "Verify the new message appears in the inbox list");<br />
<br />
===Ajax Application Pages===<br />
<br />
For reference, these screen captures are listed in this wiki page. The harness javadoc pages reference these images.<br />
<br />
====Login Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxLogin.jpeg|thumb|center|400px|Login]]<br />
<br />
====General Ajax Page====<br />
<br />
The following diagram shows the general ajax page. Also included are outlines for:<br />
<br />
* "MainPage" (Red)<br />
* "MailFolderTree" (Orange)<br />
* "MiniCal" (Green)<br />
* "MailPage" (Blue).<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxGeneral.jpeg|thumb|center|600px|General]]<br />
<br />
====Mail Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail1a.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail2.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail3.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail4.jpeg|thumb|center|600px|Mail]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxMail5.jpeg|thumb|center|600px|Mail]]<br />
<br />
====Addressbook Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook1.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook2.jpeg|thumb|center|600px|Addressbook]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxAddressbook3.jpeg|thumb|center|600px|Addressbook]]<br />
<br />
====Calendar Page====<br />
<br />
TBD<br />
<br />
====Tasks Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks1.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks2.jpeg|thumb|center|600px|Tasks]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxTasks3.jpeg|thumb|center|600px|Tasks]]<br />
<br />
====Briefcase Page====<br />
<br />
====Preferences Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxPreferences1.jpeg|thumb|center|600px|Preferences]]<br />
<br />
====Zimlets Page - Social====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSocial1.jpeg|thumb|center|600px|Social]]<br />
<br />
====Search Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch1.jpeg|thumb|center|600px|Search]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxSearch2.jpeg|thumb|center|600px|Search]]<br />
<br />
====Folder Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder1.jpeg|thumb|center|600px|Folder]]<br />
[[Image:ZimbraSeleniumScreenshotAjaxFolder2.jpeg|thumb|center|600px|Folder]]<br />
<br />
====Minical Page====<br />
<br />
[[Image:ZimbraSeleniumScreenshotAjaxMinical1.jpeg|thumb|center|600px|Minical]]<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>
Rhoades