12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- # encoding: utf-8
- require 'browser_test_helper'
- class SignupTest < TestCase
- def test_signup
- signup_user_email = 'signup-test-' + rand(999999).to_s + '@example.com'
- tests = [
- {
- :name => 'start',
- :instance => browser_instance,
- :url => browser_url,
- :action => [
- {
- :execute => 'click',
- :css => 'a[href="#signup"]',
- },
- {
- :execute => 'check',
- :css => '.signup',
- :result => true,
- },
- ],
- },
- {
- :name => 'signup',
- :action => [
- {
- :execute => 'set',
- :css => 'input[name="firstname"]',
- :value => 'Signup Firstname',
- },
- {
- :execute => 'set',
- :css => 'input[name="lastname"]',
- :value => 'Signup Lastname',
- },
- {
- :execute => 'set',
- :css => 'input[name="email"]',
- :value => signup_user_email,
- },
- {
- :execute => 'set',
- :css => 'input[name="password"]',
- :value => 'some-pass',
- },
- {
- :execute => 'set',
- :css => 'input[name="password_confirm"]',
- :value => 'some-pass',
- },
- {
- :execute => 'click',
- :css => 'button.submit',
- },
- {
- :execute => 'wait',
- :value => 5,
- },
- # check action
- {
- :execute => 'check',
- :css => '.signup',
- :result => false,
- },
- {
- :execute => 'match',
- :css => '.user-menu .user a',
- :attribute => 'title',
- :value => signup_user_email,
- :match_result => true,
- },
- ],
- },
- ]
- browser_single_test(tests)
- end
- end
|