#{fixture delete:'all' /} #{selenium 'Test the transparent JPA Binding'} open('@{JPABinding.index()}') type('name', 'Play 1.1') clickAndWait('go') assertValue('name', 'Play 1.1') storeValue('id', 'objectId') echo('Project id is ${'${objectId}'.escape()}') assertTextPresent('No company') type('name', 'Hop') clickAndWait('go') assertValue('name', 'Hop') echo('Project id is ${'${objectId}'.escape()}') assertValue('id', '${'${objectId}'.escape()}') assertTextPresent('No company') type('id', '89776') clickAndWait('go') assertTextPresent('detached entity passed to persist: models.Project') open('@{JPABinding.createCompany()}?company.name=zenexity') assertValue('name', 'zenexity') storeValue('id', 'companyId') echo('Company id is ${'${companyId}'.escape()}') open('@{JPABinding.show()}?id=${'${objectId}'.escape()}') type('company', '${'${companyId}'.escape()}') clickAndWait('go') assertValue('name', 'Hop') echo('Project id is ${'${objectId}'.escape()}') assertValue('id', '${'${objectId}'.escape()}') assertTextNotPresent('No company') assertTextPresent('zenexity') open('@{JPABinding.show()}?id=${'${objectId}'.escape()}') type('company', 'xxx') clickAndWait('go') assertValue('name', 'Hop') echo('Project id is ${'${objectId}'.escape()}') assertTextNotPresent('No company') assertValue('company', '${'${companyId}'.escape()}') assertTextPresent('Object not found for id') open('@{JPABinding.index()}') type('name', 'Zapps') type('company', '${'${companyId}'.escape()}') clickAndWait('go') assertValue('name', 'Zapps') assertNotValue('id', '${'${objectId}'.escape()}') assertTextNotPresent('No company') assertTextPresent('zenexity') open('@{JPABinding.withMap()}?companyId=${'${companyId}'.escape()}') storeValue('id', 'objectId') echo('Project id is ${'${objectId}'.escape()}') assertTextPresent('1 in map') open('@{JPABinding.show()}?id=${'${objectId}'.escape()}') assertTextPresent('1 in map') open('@{JPABinding.editMap()}?id=${'${objectId}'.escape()}') assertTextPresent('1 in map') assertTextPresent('{zenexity=zenexity}') open('@{JPABinding.editMapAndSave()}?id=${'${objectId}'.escape()}') assertTextPresent('1 in map') assertTextPresent('{Coucou=Coucou}') open('@{JPABinding.create()}?project.name=Sematic&project.company.name=CG77') assertValue('name', 'Sematic') assertTextPresent('CG77') open('@{Errors.index()}') type('tf', 'Youpi') clickAndWait('go') assertTextPresent('it works now: Youpi') open('@{JPABinding.echoEntityBinding}?a.b.name=Morten&a.b.id=') assertTextPresent('a.id=null, a.b.id=null, a.b.name=Morten') #{/selenium}