#{extends 'test/AbstractTest.html' /}
#{selenium}
open('/')
waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000)
// Simulate loss of connectivity
open('/Test/disableAjax')
open('/')
waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000)
clickAndWait('new')
waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000)
type('name', 'note 4')
type('contents', 'note 4 contents')
clickAndWait('save')
// Back to list
assertTextPresent('note 4')
click('css=input[value="Remove"]')
waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000)
assertTextNotPresent('note 4')
// Nothing on server
open('/Test/showServerNote?name=note 4')
assertTextPresent('not found')
open('/Test/enableAjax')
#{/selenium}