1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00

Fix within_frame not switching context back properly

Closes #242
This commit is contained in:
Jon Leighton 2013-01-26 13:59:34 +00:00
parent a94e40945d
commit c2660fd3f0
4 changed files with 15 additions and 4 deletions

View file

@ -301,6 +301,8 @@ Include as much information as possible. For example:
* Fix timing issue when using `within_frame` that could cause errors.
[Issue #183, #211] (@errm, @motemen)
* Fix bug with `within_frame` not properly switching the context back
after the block has executed. [Issue #242]
### 1.0.2 ###

View file

@ -202,8 +202,12 @@ Poltergeist.WebPage = (function() {
};
WebPage.prototype.pushFrame = function(name) {
this.frames.push(name);
return this["native"].switchToFrame(name);
if (this["native"].switchToFrame(name)) {
this.frames.push(name);
return true;
} else {
return false;
}
};
WebPage.prototype.popFrame = function() {

View file

@ -138,8 +138,11 @@ class Poltergeist.WebPage
@native.customHeaders = headers
pushFrame: (name) ->
@frames.push(name)
@native.switchToFrame(name)
if @native.switchToFrame(name)
@frames.push(name)
true
else
false
popFrame: ->
@frames.pop()

View file

@ -350,6 +350,8 @@ describe Capybara::Session do
@session.current_path.should == "/poltergeist/slow"
@session.html.should include('slow page')
end
@session.current_path.should == '/'
end
it 'waits for the cross-domain frame to load' do