This repository has been archived by the owner on Jun 6, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix file_download_link and add test case
- Loading branch information
Hugh McGowan
committed
May 17, 2011
1 parent
3a664c8
commit 20747ef
Showing
4 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# feature tests for file Fields | ||
|
||
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED | ||
require 'unittests/setup' | ||
|
||
class TC_FileDownloadLink < Test::Unit::TestCase | ||
tags :must_be_visible, :creates_windows | ||
include Watir | ||
|
||
def setup | ||
goto_page "filedownload.html" | ||
@file = File.expand_path(File.dirname(__FILE__) + '/test_file_download.bin') | ||
@file.gsub!('/', '\\') | ||
end | ||
|
||
def teardown | ||
Watir::Wait.until {File.exists?(@file)} | ||
File.delete @file | ||
end | ||
|
||
def test_file_field_Exists | ||
# test for existance of 4 file area | ||
assert(browser.file_download_link(:text,"file").exists?) | ||
assert(browser.file_download_link(:url,/download_me\.bin/).exists?) | ||
|
||
# test for missing | ||
assert_false(browser.file_download_link(:text, "missing").exists?) | ||
|
||
# pop one open and put something in it. | ||
browser.file_download_link(:text, "file").set @file | ||
|
||
end | ||
|
||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
|
||
<a href="file://C:\ws\github\bret\watir\watir\unittests\html\download_me.bin">file</a> | ||
</body> | ||
</html> |