#{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) // Modified on server open('/Test/touchServerNote?name=note 1') assertTextPresent('Touched note') // Then on client open('/') waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000) clickAndWait('link=note 1') waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000) type('name', 'note 1 new') type('contents', 'note 1 new contents') clickAndWait('save') // Restore connectivity, home page triggers a sync open('/Test/enableAjax') open('/') waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000) // Client version should be on the client clickAndWait('link=note 1 new') waitForCondition('var w = selenium.browserbot.getCurrentWindow(); w.jQuery && w.jQuery.active == 0', 2000) assertValue('name', 'note 1 new') assertValue('contents', 'note 1 new contents') // And on the server open('/Test/showServerNote?name=note 1 new') assertTextPresent('name=note 1 new') assertTextPresent('contents=note 1 new contents') #{/selenium}