mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix problem with broken pipes in Culerity?
WTF was causing this? I have no idea... Anyway this seems to fix it.
This commit is contained in:
parent
cdf8a3b46a
commit
3eed17dfeb
4 changed files with 28 additions and 46 deletions
|
@ -18,7 +18,7 @@ module Capybara
|
|||
end
|
||||
|
||||
def default_wait_timeout
|
||||
@default_wait_timeout ||= 10
|
||||
@default_wait_timeout ||= 1
|
||||
end
|
||||
|
||||
def log(message)
|
||||
|
|
26
spec/public/test.js
Normal file
26
spec/public/test.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
var activeRequests = 0;
|
||||
$(function() {
|
||||
$('#change').text('I changed it');
|
||||
$('#drag').draggable();
|
||||
$('#drop').droppable({
|
||||
drop: function(event, ui) {
|
||||
ui.draggable.remove();
|
||||
$(this).html('Dropped!');
|
||||
}
|
||||
});
|
||||
$('#clickable').click(function() {
|
||||
var link = $(this);
|
||||
setTimeout(function() {
|
||||
$(link).after('<a href="#">Has been clicked</a>');
|
||||
$(link).after('<input type="submit" value="New Here">');
|
||||
$(link).after('<input type="text" id="new_field">');
|
||||
}, 500);
|
||||
return false;
|
||||
});
|
||||
$('#waiter').change(function() {
|
||||
activeRequests = 1;
|
||||
setTimeout(function() {
|
||||
activeRequests = 0;
|
||||
}, 500);
|
||||
});
|
||||
});
|
|
@ -50,14 +50,6 @@ shared_examples_for "session with javascript support" do
|
|||
@session.wait_for_condition('activeRequests == 0').should be_true
|
||||
@session.evaluate_script('activeRequests == 0').should be_true
|
||||
end
|
||||
|
||||
it "should timeout" do
|
||||
@session.visit('/with_js')
|
||||
@session.select('Timeout', :from => 'timeout')
|
||||
@session.evaluate_script('activeRequests == 1').should be_true
|
||||
@session.wait_for_condition('activeRequests == 0').should be_false
|
||||
@session.evaluate_script('activeRequests == 0').should be_false
|
||||
end
|
||||
end
|
||||
|
||||
describe '#click' do
|
||||
|
|
|
@ -4,37 +4,7 @@
|
|||
<title>with_js</title>
|
||||
<script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
//<![CDATA[
|
||||
var activeRequests = 0;
|
||||
$(function() {
|
||||
$('#change').text('I changed it');
|
||||
$('#drag').draggable();
|
||||
$('#drop').droppable({
|
||||
drop: function(event, ui) {
|
||||
ui.draggable.remove();
|
||||
$(this).html('Dropped!');
|
||||
}
|
||||
});
|
||||
$('#clickable').click(function() {
|
||||
var link = $(this);
|
||||
setTimeout(function() {
|
||||
$(link).after('<a href="#">Has been clicked</a>');
|
||||
$(link).after('<input type="submit" value="New Here">');
|
||||
$(link).after('<input type="text" id="new_field">');
|
||||
}, 500);
|
||||
return false;
|
||||
});
|
||||
$('#waiter').change(function() {
|
||||
activeRequests = 1;
|
||||
setTimeout('activeRequests = 0', 5000);
|
||||
});
|
||||
$('#timeout').change(function() {
|
||||
activeRequests = 1;
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<script src="/test.js" type="text/javascript" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body id="with_js">
|
||||
|
@ -56,11 +26,5 @@
|
|||
<option>My Waiting Option</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<select id="timeout">
|
||||
<option>Foo</option>
|
||||
<option>Timeout</option>
|
||||
</select>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue