#{fixture delete:'all', load:'data-test.yml' /} #{selenium} // Open the home page, and check that no error occured open('/') assertNotTitle('Application error') clickAndWait('xpath=//a[text()="new event"]') clickAndWait('css=button[type="submit"]') assertTextPresent('Oops! Errors detected') assertTextPresent('You have to complete the event\'s name.') assertTextPresent('You have to select the type of the event.') assertTextPresent('You have to complete the event\'s place') assertTextPresent('You have to complete the event\'s date.') type('event.name', 'new event') select( 'event.type.id', 'label=workshop') type('event.place', 'event\'s place') # test date format type('event.date', '25-10-2011 18:30') clickAndWait('css=button[type="submit"]') assertTextPresent('Oops! Errors detected') assertTextNotPresent('You have to complete the event\'s name.') assertTextNotPresent('You have to select the type of the event.') assertTextNotPresent('You have to complete the event\'s place') assertTextNotPresent('You have to complete the event\'s date.') assertTextPresent('Incorrect value') # test date format type('event.date', '10-25-2011 18:30') clickAndWait('css=button[type="submit"]') assertTextPresent('event successfully saved!') assertTextPresent('new event') # edito el evento recién creado clickAndWait('xpath=//a[text()="new event"]') type('event.name', 'new event modified') clickAndWait('css=button[type="submit"]') assertTextPresent('event successfully saved!') assertTextPresent('new event modified') # elimino el evento recién creado click('xpath=//a[text()="new event modified"]/../..//a/img/..') pause(500) open('/') // waitForTextNotPresent('new event modified') assertTextNotPresent('new event modified') #{/selenium}