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"/>
</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">
<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
# 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
script/websocket-server.rb stop

View file

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

View file

@ -38,39 +38,9 @@ class AuthMasterTest < TestCase
:name => 'login',
:action => [
{
:execute => 'check',
:css => '#login',
:result => true,
},
{
: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',
:execute => 'login',
:username => 'master@example.com',
:password => 'test1234äöüß',
},
],
},

View file

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

View file

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

View file

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

View file

@ -227,6 +227,9 @@ class TestCase < Test::Unit::TestCase
element = instance.find_element( { :css => '#login input[name="password"]' } )
element.clear
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
sleep 4
login = instance.find_element( { :css => '.user-menu .user a' } ).attribute('title')