watirsplash 1.4.3 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.gitignore +7 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +16 -0
  4. data/Gemfile.lock +88 -0
  5. data/README.rdoc +87 -63
  6. data/Rakefile +3 -41
  7. data/lib/watirsplash.rb +2 -2
  8. data/lib/watirsplash/browser.rb +3 -1
  9. data/lib/watirsplash/cli.rb +22 -26
  10. data/lib/watirsplash/frameworks/firewatir.rb +1 -1
  11. data/lib/watirsplash/frameworks/helper.rb +2 -16
  12. data/lib/watirsplash/frameworks/watir-webdriver.rb +1 -1
  13. data/lib/watirsplash/frameworks/watir-webdriver/chrome.rb +3 -1
  14. data/lib/watirsplash/frameworks/watir-webdriver/firefox.rb +3 -1
  15. data/lib/watirsplash/frameworks/watir-webdriver/ie.rb +3 -1
  16. data/lib/watirsplash/frameworks/watir.rb +1 -3
  17. data/lib/watirsplash/generators/helper.rb +15 -0
  18. data/lib/watirsplash/generators/new_project.rb +14 -13
  19. data/lib/watirsplash/generators/page.rb +64 -0
  20. data/lib/watirsplash/generators/templates/new_project/.rspec +1 -1
  21. data/lib/watirsplash/generators/templates/new_project/config.rb.tt +3 -30
  22. data/lib/watirsplash/generators/templates/new_project/environment.rb.tt +12 -10
  23. data/lib/watirsplash/generators/templates/page/lib/%formatted_namespace%/page/%formatted_page_name%.rb.tt +8 -0
  24. data/lib/watirsplash/generators/templates/page/spec/%formatted_namespace%/page/%formatted_page_name%_spec.rb.tt +5 -0
  25. data/lib/watirsplash/html_formatter.rb +1 -1
  26. data/lib/watirsplash/page/base.rb +41 -0
  27. data/lib/watirsplash/rspec_patches.rb +5 -7
  28. data/lib/watirsplash/spec_helper.rb +5 -12
  29. data/lib/watirsplash/util.rb +3 -35
  30. data/lib/watirsplash/version.rb +10 -0
  31. data/spec/environment.rb +14 -0
  32. data/spec/spec_helper_spec.rb +3 -4
  33. data/spec/spec_match_array_spec.rb +2 -2
  34. data/watirsplash.gemspec +32 -0
  35. metadata +60 -45
  36. data/VERSION +0 -1
  37. data/environment.rb +0 -2
  38. data/lib/watirsplash/generators/migrate_project.rb +0 -25
  39. data/lib/watirsplash/generators/new_common_project.rb +0 -19
  40. data/lib/watirsplash/generators/templates/new_common_project/config.rb.tt +0 -34
  41. data/lib/watirsplash/generators/templates/new_common_project/environment.rb +0 -15
  42. data/lib/watirsplash/generators/templates/new_common_project/lib/common_application_helper.rb +0 -14
  43. data/lib/watirsplash/generators/templates/new_project/spec/%formatted_name%_helper.rb.tt +0 -18
  44. data/lib/watirsplash/generators/templates/new_project/spec/dummy_spec.rb.tt +0 -41
  45. data/spec/util_spec.rb +0 -48
@@ -1,41 +0,0 @@
1
- # This is a fully working spec file which you can run to see if
2
- # your configuration is correct and everything is working as expected
3
-
4
- describe WatirSplash do
5
-
6
- it "has the browser window opened" do
7
- url.should == Config::<%= name %>::URL
8
- end
9
-
10
- it "has easy access to <%= name %>Helper methods" do
11
- # <%= name %>Helper#helper_method_one will be executed
12
- helper_method_one.should == "one"
13
- # <%= name %>Helper#has_second_method? will be executed
14
- should have_second_method
15
- # <%= name %>Helper#correct? method will be executed
16
- should_not be_correct
17
- end
18
-
19
- it "fails the example and makes a screenshot of the browser" do
20
- false.should be_true
21
- end
22
-
23
- it "is in pending status" do
24
- goto "http://google.com/ncr"
25
- title.should == "Google"
26
- expect {
27
- text_field(:name => "q").set "Bing"
28
- }.to make {text.include?("Bing")}.within(15)
29
- pending "this is a known 'bug'" do
30
- title.should == "Bing"
31
- end
32
- end
33
-
34
- it "has access to global methods after \"new_common\" command has been used" do
35
- pending "it fails as long as 'watirsplash new_common' command hasn't been executed
36
- and ui-test-common is not loaded by this project" do
37
- new_global_method.should == "it just works"
38
- end
39
- end
40
-
41
- end
@@ -1,48 +0,0 @@
1
- describe WatirSplash::Util do
2
-
3
- it "loads ui-test-common" do
4
- ui_test_common_dir = "../ui-test-common"
5
- raise "ui-test-common directory should not exist due to testing!" if File.exists?(ui_test_common_dir)
6
- begin
7
- FileUtils.mkdir(ui_test_common_dir)
8
- File.open(File.join(ui_test_common_dir, "environment.rb"), "w") do |f|
9
- f.puts "
10
- module GlobalApplication
11
- LOADED = true
12
- end"
13
- end
14
-
15
- lambda {GlobalApplication::LOADED}.should raise_exception
16
- lambda {WatirSplash::Util.load_common}.should_not raise_exception
17
- GlobalApplication::LOADED.should be_true
18
- ensure
19
- FileUtils.rm_rf(ui_test_common_dir)
20
- end
21
- end
22
-
23
- it "raises exception if ui-test-common is not found" do
24
- lambda {WatirSplash::Util.load_common}.
25
- should raise_exception(RuntimeError,
26
- "ui-test-common directory was not found! It has to exist somewhere higher in directory tree than your project's directory and it has to have environment.rb file in it!")
27
- end
28
-
29
- it "loads project's environment.rb automatically" do
30
- env_file = "../environment.rb"
31
- raise "environment.rb file should not exist due to testing!" if File.exists?(env_file)
32
- begin
33
- File.open(env_file, "w") do |file|
34
- file.puts "
35
- module GlobalApplication
36
- ENVIRONMENT_LOADED = true
37
- end"
38
- end
39
-
40
- lambda {GlobalApplication::ENVIRONMENT_LOADED}.should raise_exception
41
- lambda {WatirSplash::Util.load_environment}.should_not raise_exception
42
- GlobalApplication::ENVIRONMENT_LOADED.should be_true
43
- ensure
44
- FileUtils.rm_rf(env_file)
45
- end
46
- end
47
-
48
- end