Support new ui selectors.

This commit is contained in:
Martin Edenhofer 2014-12-02 08:22:26 +01:00
parent 26c9115875
commit 865f70ecda
8 changed files with 26 additions and 112 deletions

View file

@ -15,6 +15,14 @@
<input id="password" name="password" type="password" class="form-control"/> <input id="password" name="password" type="password" class="form-control"/>
</div> </div>
<div class="form-group">
<!--
<label for="remember_me"><%- @Ti( 'Remember me' ) %></label>
<input id="remember_me" name="remember_me" value="1" type="checkbox"/>
-->
<label><input name="remember_me" value="1" type="checkbox"/> <%- @T( 'Remember me' ) %></label>
</div>
<div class="form-controls"> <div class="form-controls">
<button class="btn btn--primary" type="submit"><%- @T( 'Sign in' ) %></button> <button class="btn btn--primary" type="submit"><%- @T( 'Sign in' ) %></button>

View file

@ -29,7 +29,7 @@ rake db:seed
cat config/environments/production.rb | sed -e 's/config.serve_static_assets = false/config.serve_static_assets = true/' > /tmp/production.rb && cp /tmp/production.rb config/environments/production.rb cat config/environments/production.rb | sed -e 's/config.serve_static_assets = false/config.serve_static_assets = true/' > /tmp/production.rb && cp /tmp/production.rb config/environments/production.rb
# mofidy auth backend # mofidy auth backend
cat lib/auth/test.rb | sed 's/test/production/' > /tmp/test.rb && cp /tmp/test.rb lib/auth/test.rb cat lib/auth/test.rb | sed "s/\] == 'test'/] == 'production'/" > /tmp/test.rb && cp /tmp/test.rb lib/auth/test.rb
pumactl --pidfile tmp/pids/puma.pid stop pumactl --pidfile tmp/pids/puma.pid stop
script/websocket-server.rb stop script/websocket-server.rb stop

View file

@ -38,47 +38,21 @@ class AuthCustomerTest < TestCase
:name => 'login', :name => 'login',
:action => [ :action => [
{ {
:execute => 'check', :execute => 'login',
:css => '#login', :username => 'nicole.braun@zammad.org',
:result => true, :password => 'test',
},
{
:execute => 'set',
:css => 'input[name="username"]',
:value => 'nicole.braun@zammad.org',
},
{
:execute => 'set',
:css => 'input[name="password"]',
:value => 'test'
},
{
:execute => 'click',
:css => '#login button',
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 5, :value => 5,
}, },
# check action
{
:execute => 'check',
:css => '#login',
:result => false,
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'nicole.braun@zammad.org',
},
{ {
:execute => 'reload', :execute => 'reload',
}, },
{ {
:execute => 'watch_for', :execute => 'watch_for',
:area => 'body', :area => 'body',
:value => 'nicole.braun@zammad.org', :value => 'Overviews',
}, },
{ {
:execute => 'match', :execute => 'match',
@ -122,43 +96,10 @@ class AuthCustomerTest < TestCase
:url => browser_url, :url => browser_url,
:action => [ :action => [
{ {
:execute => 'check', :execute => 'login',
:css => '#login', :username => 'nicole.braun@zammad.org',
:result => true, :password => 'test',
}, :remember_me => true,
{
:execute => 'set',
:css => 'input[name="username"]',
:value => 'nicole.braun@zammad.org',
},
{
:execute => 'set',
:css => 'input[name="password"]',
:value => 'test'
},
{
:execute => 'click',
:css => '#login [name="remember_me"]',
},
{
:execute => 'click',
:css => '#login button',
},
{
:execute => 'wait',
:value => 6,
},
# check action
{
:execute => 'check',
:css => '#login',
:result => false,
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'nicole.braun@zammad.org',
}, },
{ {
:execute => 'match', :execute => 'match',

View file

@ -38,39 +38,9 @@ class AuthMasterTest < TestCase
:name => 'login', :name => 'login',
:action => [ :action => [
{ {
:execute => 'check', :execute => 'login',
:css => '#login', :username => 'master@example.com',
:result => true, :password => 'test1234äöüß',
},
{
:execute => 'set',
:css => 'input[name="username"]',
:value => 'master@example.com',
},
{
:execute => 'set',
:css => 'input[name="password"]',
:value => 'test1234äöüß'
},
{
:execute => 'click',
:css => '#login button',
},
{
:execute => 'wait',
:value => 5,
},
# check action
{
:execute => 'check',
:css => '#login',
:result => false,
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'master@example',
}, },
], ],
}, },

View file

@ -45,7 +45,7 @@ class CustomerTicketCreateTest < TestCase
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 3, :value => 4,
}, },
{ {
:execute => 'check', :execute => 'check',

View file

@ -164,10 +164,6 @@ class ManageTest < TestCase
:value => 'some sla update ' + random, :value => 'some sla update ' + random,
:match_result => false, :match_result => false,
}, },
{
:execute => 'click',
:css => 'a[href="#/"]',
},
{ {
:execute => 'click', :execute => 'click',
:css => 'a[href="#manage"]', :css => 'a[href="#manage"]',
@ -193,10 +189,6 @@ class ManageTest < TestCase
:execute => 'wait', :execute => 'wait',
:value => 2, :value => 2,
}, },
{
:execute => 'click',
:css => 'a[href="#/"]',
},
{ {
:execute => 'click', :execute => 'click',
:css => 'a[href="#manage"]', :css => 'a[href="#manage"]',

View file

@ -16,7 +16,7 @@ class TaskbarSessionTest < TestCase
:action => [ :action => [
{ {
:execute => 'wait', :execute => 'wait',
:value => 12, :value => 8,
}, },
{ {
:where => :instance1, :where => :instance1,
@ -52,7 +52,7 @@ class TaskbarSessionTest < TestCase
:action => [ :action => [
{ {
:execute => 'wait', :execute => 'wait',
:value => 12, :value => 8,
}, },
{ {
:where => :instance1, :where => :instance1,

View file

@ -227,6 +227,9 @@ class TestCase < Test::Unit::TestCase
element = instance.find_element( { :css => '#login input[name="password"]' } ) element = instance.find_element( { :css => '#login input[name="password"]' } )
element.clear element.clear
element.send_keys( action[:password] ) element.send_keys( action[:password] )
if action[:remember_me]
instance.find_element( { :css => '#login [name="remember_me"]' } ).click
end
instance.find_element( { :css => '#login button' } ).click instance.find_element( { :css => '#login button' } ).click
sleep 4 sleep 4
login = instance.find_element( { :css => '.user-menu .user a' } ).attribute('title') login = instance.find_element( { :css => '.user-menu .user a' } ).attribute('title')