Skip to content

Commit f73b081

Browse files
committed
rb - implement w3c page source
1 parent bce737e commit f73b081

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

rb/lib/selenium/webdriver/remote/w3c_bridge.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ def getTitle
208208
end
209209

210210
def getPageSource
211-
execute :getPageSource
211+
executeScript("var source = document.documentElement.outerHTML;" +
212+
"if (!source) { source = new XMLSerializer().serializeToString(document); }" +
213+
"return source;")
212214
end
213215

214216
def getVisible

rb/spec/integration/selenium/webdriver/driver_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@
2525
expect(driver.title).to eq("XHTML Test Page")
2626
end
2727

28-
# Marionette BUG - AutomatedTester: "I need to add pagesource back and add it to the spec"
29-
not_compliant_on :browser => :marionette do
30-
it "should get the page source" do
31-
driver.navigate.to url_for("xhtmlTest.html")
32-
expect(driver.page_source).to match(%r[<title>XHTML Test Page</title>]i)
33-
end
28+
it "should get the page source" do
29+
driver.navigate.to url_for("xhtmlTest.html")
30+
expect(driver.page_source).to match(%r[<title>XHTML Test Page</title>]i)
3431
end
3532

3633
not_compliant_on :browser => :safari do

0 commit comments

Comments
 (0)