Skip to content

Commit 48d3a59

Browse files
authored
add file management tests (#129)
1 parent 0aa625f commit 48d3a59

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/functional/android/android/device_test.rb

+22
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,28 @@ def test_battery_info
401401
assert !result[:level].nil?
402402
end
403403

404+
def test_file_management
405+
test_file = 'test/functional/data/test_element_image.png'
406+
sdcard_path = '/sdcard/Pictures'
407+
sdcard_file_path = "#{sdcard_path}/test_element_image.png"
408+
409+
file = File.read test_file
410+
@@driver.push_file sdcard_file_path, file
411+
412+
read_file = @@driver.pull_file sdcard_file_path
413+
File.write 'test.png', read_file
414+
415+
assert_equal File.size(test_file), File.size('test.png')
416+
417+
folder = @@driver.pull_folder sdcard_path
418+
File.write 'pic_folder.zip', folder
419+
420+
assert File.exist?('pic_folder.zip')
421+
422+
File.delete 'test.png'
423+
File.delete 'pic_folder.zip'
424+
end
425+
404426
private
405427

406428
def scroll_to(text)

test/test_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def android
8787
someCapability: 'some_capability',
8888
unicodeKeyboard: true,
8989
resetKeyboard: true,
90+
disableWindowAnimation: true,
9091
newCommandTimeout: 300
9192
},
9293
appium_lib: {

0 commit comments

Comments
 (0)