12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- # encoding: utf-8
- require 'browser_test_helper'
- class AuthTest < TestCase
- def test_authentication
- @browser = browser_instance
- location(url: browser_url)
- match(
- css: '#login',
- value: 'username',
- )
- click(css: '#login button')
- sleep 4
- match(
- css: '#login',
- value: 'username',
- )
- # login with username/password
- login(
- username: 'nicole.braun@zammad.org',
- password: 'test',
- )
- tasks_close_all()
- # reload page
- reload()
- # check if cookie is temporarily
- watch_for(
- css: 'body',
- value: 'Overviews',
- )
- # verify session cookie
- cookie(
- name: '^_zammad.+?',
- value: '.+?',
- expires: '',
- )
- end
- def test_authentication_new_browser_without_permanent_cookie_no_session_should_be
- @browser = browser_instance
- location(url: browser_url)
- match(
- css: '#login',
- value: 'username',
- )
- end
- def test_new_browser_with_permanent_cookie_login
- @browser = browser_instance
- location(url: browser_url)
- # login with username/password
- login(
- username: 'nicole.braun@zammad.org',
- password: 'test',
- remember_me: true,
- )
- # check if cookie is temporarily
- watch_for(
- css: 'body',
- value: 'Overviews',
- )
- # verify session cookie
- cookie(
- name: '^_zammad.+?',
- value: '.+?',
- expires: '\d{4}-\d{1,2}-\d{1,2}.+?',
- )
- logout()
- # verify session cookie
- sleep 2
- cookie(
- name: '^_zammad.+?',
- value: '.+?',
- expires: '',
- )
- end
- end
|