Skip to content

Commit 3c4e9a8

Browse files
committed
add source test
1 parent f8d8bff commit 3c4e9a8

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

test/functional/android/webdriver/device_test.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ def test_set_immediate_value
4343
end
4444

4545
def test_page_source
46-
assert @@driver.page_source
46+
require 'json'
47+
response = Net::HTTP.get(URI('http://localhost:8100/source'))
48+
source = JSON.parse(response)['value']
49+
50+
assert !source.include?('AppiumAUT')
51+
assert source.include?('XCUIElementTypeApplication type')
52+
53+
s_source = @@driver.page_source
54+
55+
assert s_source.include?('AppiumAUT')
56+
assert s_source.include?('XCUIElementTypeApplication type')
4757
end
4858

4959
def test_location

test/functional/ios/webdriver/device_test.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ def by_predicate(value)
4747
end
4848

4949
def test_page_source
50-
assert @@driver.page_source
50+
require 'json'
51+
response = Net::HTTP.get(URI('http://localhost:8100/source'))
52+
source = JSON.parse(response)['value']
53+
54+
assert !source.include?('AppiumAUT')
55+
assert source.include?('XCUIElementTypeApplication type')
56+
57+
s_source = @@driver.page_source
58+
59+
assert s_source.include?('AppiumAUT')
60+
assert s_source.include?('XCUIElementTypeApplication type')
5161
end
5262

5363
def test_location

0 commit comments

Comments
 (0)