CreateEditOpportunity
setTimeout 45000
storeGlobal javascript{Math.floor(Math.random()*11000)} randomSuffix
open index.php/accounts/default/create
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForTextPresent Create Account
type Account_name my account ${randomSuffix}
clickAndWait save
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForText //div[@id='AccountDetailsPortletView']/div/div/div/table/tbody/tr[1]/td my account ${randomSuffix}
open index.php/opportunities/default/create
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForTextPresent Create Opportunity
type Opportunity_name Test Opportunity ${randomSuffix}
type Opportunity_amount_value 500.34
click Opportunity_account_SelectLink
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForElementPresent AccountsSearchForm_anyMixedAttributes
type AccountsSearchForm_anyMixedAttributes my account ${randomSuffix}
keyUp AccountsSearchForm_anyMixedAttributes \10
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForText //div[@id='list-viewmodal']/table/tbody/tr[1]/td/a my account ${randomSuffix}
click //div[@id='list-viewmodal']/table/tbody/tr[1]/td/a
waitForValue Opportunity_account_name my account ${randomSuffix}
assertNotValue Opportunity_account_id
click id=Opportunity_closeDate
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
click //div[@id='ui-datepicker-div']/table/tbody/tr/td[3]/a
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
select Opportunity_stage_value label=Negotiating
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
select Opportunity_source_value label=Tradeshow
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
click Opportunity_owner_SelectLink
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForElementPresent UsersSearchForm_anyMixedAttributes
type UsersSearchForm_anyMixedAttributes Sam Smith
keyUp UsersSearchForm_anyMixedAttributes \10
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForText //div[@id='UsersModalListView']/div/table/tbody/tr/td/a Sam Smith
click link=Sam Smith
waitForValue Opportunity_owner_name Sam Smith
assertNotValue Opportunity_owner_id
clickAndWait save
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForText //div[@id='OpportunityDetailsPortletView']/div/div/div/table/tbody/tr[1]/td Test Opportunity ${randomSuffix}
verifyTextPresent Test Opportunity ${randomSuffix}
verifyTextPresent 500.34
verifyTextPresent Tradeshow
verifyTextPresent Negotiating
assertText link=my account ${randomSuffix} my account ${randomSuffix}
setSpeed 3000
clickAndWait //div[@id='OpportunityDetailsAndRelationsView']/div[1]/div/a
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
clickAndWait link=Edit
setSpeed 1
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
select Opportunity_stage_value label=Closed Won
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
clickAndWait save
waitForPageToLoad
waitForCondition selenium.browserbot.getCurrentWindow().jQuery.active == 0 30000
waitForText //div[@id='OpportunityDetailsPortletView']/div/div/div/table/tbody/tr[1]/td Test Opportunity ${randomSuffix}
verifyTextPresent Closed Won