2
셀렌 테스트를 작성하여 응용 프로그램에 로그인 한 다음 브라우저를 다시 열면 저장된 쿠키를 사용하여 자동으로 로그인되는지 확인합니다.쿠키를 테스트하는 셀레늄 테스트
두 개의 # {selenium} 블록 사이에서 clearSession()을 호출하는 것이 가능할 수 있다고 생각했지만 이는 쿠키도 지우는 것으로 보입니다. 이 기능이 수동으로 작동하는지 테스트했습니다.
어떻게 테스트 할 수있는 아이디어.
참고로 다음 내용을 시도해 보았습니다.
#{fixture delete:'all', load:'../conf/User.yml' /}
#{selenium}
deleteAllVisibleCookies()
// Open the home page, and check that no error occurred
open('/')
waitForPageToLoad(1000)
assertNotTitle('Application error')
open('/login')
type('usernameOrEmail', 'marchaos')
type('password', 'password')
clickAndWait('css=input[type=submit]')
assertTextPresent('Welcome marchaos')
clearSession()
#{/selenium}
#{selenium}
// Open the home page, and check that no error occurred
open('/')
waitForPageToLoad(1000)
assertTextPresent('Welcome marchaos')
#{/selenium}
는 마지막 assertTextPresent()
비슷한 주제는 여기 http://stackoverflow.com/questions/8874241/selenium-phpunit-end-a-session-when-re-using-browser- 세션/8877165 # 8877165 – faramka