<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost/" />
<title>CreateAccount</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Create Account</td></tr>
</thead>
<tbody>
<tr>
	<td>setTimeout</td>
	<td>45000</td>
	<td></td>
</tr>
<!--Go to accounts list-->
<tr>
	<td>open</td>
	<td>index.php/accounts/default?clearingSearch=1</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Create</td>
	<td></td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Update</td>
	<td></td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Export</td>
	<td></td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Delete</td>
	<td></td>
</tr>
<!--select account created in functional test-->
<tr>
	<td>type</td>
	<td>id=AccountsSearchForm_anyMixedAttributes</td>
	<td>Test Account ${randomSuffix}</td>
</tr>
<tr>
	<td>keyUp</td>
	<td>id=AccountsSearchForm_anyMixedAttributes</td>
	<td>\10</td>
</tr>
<tr>
	<td>waitForText</td>
	<td>//div[@id='list-view']/table/tbody/tr[1]/td[3]/a</td>
	<td>Test Account ${randomSuffix}</td>
</tr>
<tr>
	<td>verifyTextPresent</td>
	<td>Test Account ${randomSuffix}</td>
	<td></td>
</tr>
<tr>
	<td>verifyValue</td>
	<td>AccountsSearchForm_anyMixedAttributes</td>
	<td>Test Account ${randomSuffix}</td>
</tr>
<!--go in detail view of account-->
<tr>
	<td>click</td>
	<td>//div[@id='list-view']/table/tbody/tr[1]/td[3]/a</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Test Account ${randomSuffix}</td>
	<td></td>
</tr>
<tr>
	<td>setSpeed</td>
	<td>2000</td>
	<td></td>
</tr>
<!--create 1st contact link with account-->
<tr>
	<td>clickAndWait</td>
	<td>//div[@class='juiportlet-columns']/ul[2]/li[3]/div[1]/div/div/a[@class='icon-create']</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_firstName</td>
	<td>Test</td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_lastName</td>
	<td>Contact ${randomSuffix}</td>
</tr>
<tr>
	<td>select</td>
	<td>id=Contact_state_id</td>
	<td>label=Customer</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>name=save</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Test Contact ${randomSuffix}</td>
	<td></td>
</tr>
<!--create 2nd contact link with account-->
<tr>
	<td>clickAndWait</td>
	<td>//div[@class='juiportlet-columns']/ul[2]/li[3]/div[1]/div/div/a[@class='icon-create']</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_firstName</td>
	<td>Test</td>
</tr>
<tr>
	<td>click</td>
	<td>name=save</td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>waitForTextPresent</td>
	<td>Last Name cannot be blank.</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_lastName</td>
	<td>Zurmo ${randomSuffix}</td>
</tr>
<tr>
	<td>click</td>
	<td>name=save</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>waitForTextPresent</td>
	<td>Test Zurmo ${randomSuffix}</td>
	<td></td>
</tr>
<tr>
	<td>setSpeed</td>
	<td>2000</td>
	<td></td>
</tr>
<!--to check if we cancel unlink, then it wont unlink contact-->
<tr>
	<td>click</td>
	<td>link=Unlink</td>
	<td></td>
</tr>
<tr>
	<td>waitForConfirmation</td>
	<td>Are you sure you want to unlink this contact?</td>
	<td></td>
</tr>
<tr>
	<td>chooseCancelOnNextConfirmation</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>waitForTextPresent</td>
	<td>Test Zurmo ${randomSuffix}</td>
	<td></td>
</tr>
<!--unlick contact from account-->
<tr>
	<td>click</td>
	<td>link=Unlink</td>
	<td></td>
</tr>
<tr>
	<td>waitForConfirmation</td>
	<td>Are you sure you want to unlink this contact?</td>
	<td></td>
</tr>
<tr>
	<td>chooseOkOnNextConfirmation</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>assertText</td>
	<td>//div[@id='AccountDetailsAndRelationsView']/div[2]/div/ul[2]/li[3]/div[2]/div/div/table/tbody/tr[1]/td[1]/div/a</td>
	<td>Test Zurmo ${randomSuffix}</td>
</tr>
<tr>
	<td>waitForElementNotPresent</td>
	<td>//div[@id='AccountDetailsAndRelationsView']/div[2]/div/ul[2]/li[3]/div[2]/div/div/table/tbody/tr[2]</td>
	<td></td>
</tr>
<!-- Creating contact for testing delete-->
<tr>
	<td>clickAndWait</td>
	<td>//div[@class='juiportlet-columns']/ul[2]/li[3]/div[1]/div/div/a[@class='icon-create']</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>setSpeed</td>
	<td>1</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_firstName</td>
	<td>Test </td>
</tr>
<tr>
	<td>type</td>
	<td>id=Contact_lastName</td>
	<td>Contact ${randomSuffix}</td>
</tr>
<tr>
	<td>select</td>
	<td>id=Contact_state_id</td>
	<td>label=Customer</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>name=save</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>waitForCondition</td>
	<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
	<td>30000</td>
</tr>
<tr>
	<td>waitForTextPresent</td>
	<td>Test Contact ${randomSuffix}</td>
	<td></td>
</tr>