#{selenium 'Just test the simple scenario'} open('/re/toto') assertTextPresent('OK: toto') open('/re/1234') assertTextPresent('Not found') open('/re/12345') assertTextPresent('OK: 12345') open('/re/T') assertTextPresent('Not found') open('/re/TITI') assertTextPresent('OK: TITI') open('/re/TITITOTO') assertTextPresent('Not found') open('re/version%2F01%2F25/rev') assertTextPresent('OK[revRoute]: version/01/25') open('re/version%2F01%2F25/rev2') assertTextNotPresent('OK[revRoute]') assertTextPresent('OK[ressourceWithoutSpecialCharacters]: appId=version/01/25 verId=rev2') open('re/version/01/25/rev') assertTextPresent('OK[revRoute]: version/01/25') open('re/version/01/25/rev2') assertTextNotPresent('OK[revRoute]') assertTextPresent('OK[ressourceWithSpecialCharacters]: appId=version/01 verId=25/rev2') open('/re/api01/01') assertTextPresent('OK[ressourceWithoutSpecialCharacters]: appId=api01 verId=01') assertTextPresent('URL: /re/api01/01') open('/re/api01/02/01/01') assertTextPresent('OK[ressourceWithSpecialCharacters]: appId=api01/02 verId=01/01') assertTextPresent('URL: /re/api01%2F02/01%2F01') open('/re/api01%2F02/01%2F01') assertTextPresent('OK[ressourceWithoutSpecialCharacters]: appId=api01/02 verId=01/01') assertTextPresent('URL: /re/api01%2F02/01%2F01') open('/re/urlWithArgumentInRoutesNoSpace') assertTextPresent('OK[ressourceWithoutSpecialCharacters]: appId=param1 verId=param2') assertTextPresent('URL: /re/urlWithArgumentInRoutesNoSpace') open('/re/urlWithArgumentInRoutesWithSpace') assertTextPresent('OK[ressourceWithoutSpecialCharacters]: appId=param1 verId=param2') assertTextPresent('URL: /re/urlWithArgumentInRoutesNoSpace') // [#1685] - show (reverse routing of param with '/' in it) open('/re/1%2F2/rev') assertTextPresent('OK[revRoute]: 1/2') open('/') // Packages assertAttribute('wp1@href', '/sample/photo/index') assertAttribute('wp2@href', '/admin.test/index') assertAttribute('wp3@href', 'http://localhost:9003/admin.test/index') // Missing name clickAndWait('sayHello') assertTextPresent('Hello !') // A name clickAndWait('back') type('name', 'Guillaume') clickAndWait('sayHello') assertTextPresent('Hello Guillaume !') // test utf-8 clickAndWait('back') type('name', '日本語') clickAndWait('sayHello') assertTextPresent('Hello 日本語 !') // test escape clickAndWait('back') type('name', '<i>Italic &nbsp; Yop</i>') clickAndWait('sayHello') assertTextPresent('<i>Italic &nbsp; Yop</i>') // Check URL assertAttribute('back@href', '/') clickAndWait('back') assertAttribute('form@action', '/sayHello?x-http-method-override=PUT') assertAttribute('form@method', 'regexpi:post') // The yop form assertElementPresent('css=form[action="/application/yop"]') assertAttribute('css=form[action="/application/yop"]@method', 'regexpi:post') clickAndWait('yop') assertTextPresent('Yop') clickAndWait('back') assertTextPresent('It works !') // A GET form assertElementPresent('css=form[action="/aGetForm"]') assertAttribute('css=form[action="/aGetForm"]@method', 'regexpi:get') clickAndWait('yopGet') assertTextPresent('Hello !') clickAndWait('back') // ... with a name type('getName', 'Toto') clickAndWait('yopGet') assertTextPresent('Hello Toto !') assertEval('window.document.location', '*/aGetForm?name=Toto') // Direct URL with a trailing slash open('/aGetForm/') assertTextPresent('Hello 2null !') open('/aGetForm') assertTextPresent('Hello !') // Optional slash open('/optionalSlash/') assertTextPresent('OK') open('/optionalSlash') assertTextPresent('OK') open('/optionalSlash//') assertTextPresent('Not found') // Catch all route open('/application/optional') assertTextPresent('OK') open('/Application/optional') assertTextPresent('OK') open('/Application/Optional') assertTextPresent('OK') // Alternative URL open('/index') assertTextPresent('It works !') // Reverse open('@{Application.reverserouting()}') assertText('a', '/') assertText('b', '/sayHello') assertText('c', '/sayHello?name=Guillaume') assertText('d', '/application/yop') assertText('e', '/aGetForm') assertText('f', '/aGetForm/') assertText('g', '/aGetForm?name=Yop') assertText('h', '/aGetForm/?name=Yop') assertText('i', '/optionalSlash') assertText('j', '/withQueryParam') assertText('k', '/withQueryParam?lucky=duck') // Reverse open('@{Application.reverserouting2()}') assertTextPresent('/jpabinding/save?project.name=colcoz') // Reverse open('@{Application.reverserouting3()}') assertTextPresent('/jpabinding/save?project.name=COLCOZ') // Host open('/') assertTextPresent('1: http://static.foo.com:9003/assets/hello.html') assertTextPresent('2: /assets/hello.html') assertTextPresent('3: http://static2.foo.com:9003/x/hello.html') assertTextPresent('4: /x/hello.html') assertTextPresent('5: http://localhost:9003/public/image.gif') assertTextPresent('6: /public/image.gif') assertTextPresent('7: /hello') assertTextPresent('8: http://www.zenexity.com:9003/hello') assertTextPresent('9: /') assertTextPresent('10: http://localhost:9003/') assertTextPresent('11: /home') assertTextPresent('12: http://bob.myApp.com:9003/home') assertTextPresent('13: http://localhost:9003/strike/doIt') assertTextPresent('14: http://localhost:9003/re/titi') assertTextPresent('15: http://localhost:9003/application/ok?re=123') assertTextPresent('16: http://localhost:9003/re/12345') assertTextPresent('17: http://localhost:9003/application/ok?re=A') assertTextPresent('18: http://localhost:9003/re/TITI') assertTextPresent('19: http://assets.localhost:9003/images') assertTextPresent('20: http://localhost:9003/st%C3%A9phane') assertTextPresent('21: http://localhost:9003/hello%20world') assertTextPresent('22: http://localhost:9003/st%C3%A9phane?name=nicola%C3%AFs') assertTextPresent('23: http://localhost:9003/hello%20world?name=nicola%C3%AFs') open('/client') assertTextPresent('localhost') // jsRoute tag open('@{Application.jsRoute()}') assertText('a-url', '/') assertText('a-method', 'GET') assertText('b-url', '/sayHello') assertText('b-method', 'PUT') assertText('c', '/ressource/foo') open('@{Application.jsRouteError()}') assertTextPresent('Wrong parameter type') #{/selenium}