gmail_test 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +16 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +33 -0
- data/VERSION +1 -0
- data/gmail_test.gemspec +63 -0
- data/lib/gmail_test/assertions/.DS_Store +0 -0
- data/lib/gmail_test/assertions/.assertions.rb.swn +0 -0
- data/lib/gmail_test/assertions/.assertions.rb.swo +0 -0
- data/lib/gmail_test/assertions/.assertions.rb.swp +0 -0
- data/lib/gmail_test/assertions/base.rb +9 -0
- data/lib/gmail_test/assertions/gmail.rb +41 -0
- data/lib/gmail_test/assertions.rb +2 -0
- data/lib/gmail_test.rb +13 -0
- data/test/helper.rb +18 -0
- data/test/test_gmail_test.rb +7 -0
- metadata +101 -0
data/.document
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
source "http://rubygems.org"
|
|
2
|
+
# Add dependencies required to use your gem here.
|
|
3
|
+
# Example:
|
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
|
5
|
+
|
|
6
|
+
# Add dependencies to develop your gem here.
|
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
|
8
|
+
group :development do
|
|
9
|
+
gem "bundler", "~> 1.0.0"
|
|
10
|
+
gem "jeweler", "~> 1.6.4"
|
|
11
|
+
end
|
data/Gemfile.lock
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2011 Daniel
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
= gmail_test
|
|
2
|
+
|
|
3
|
+
Description goes here.
|
|
4
|
+
|
|
5
|
+
== Contributing to gmail_test
|
|
6
|
+
|
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
|
9
|
+
* Fork the project
|
|
10
|
+
* Start a feature/bugfix branch
|
|
11
|
+
* Commit and push until you are happy with your contribution
|
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
|
14
|
+
|
|
15
|
+
== Copyright
|
|
16
|
+
|
|
17
|
+
Copyright (c) 2011 Daniel. See LICENSE.txt for
|
|
18
|
+
further details.
|
|
19
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'rubygems'
|
|
4
|
+
require 'bundler'
|
|
5
|
+
begin
|
|
6
|
+
Bundler.setup(:default, :development)
|
|
7
|
+
rescue Bundler::BundlerError => e
|
|
8
|
+
$stderr.puts e.message
|
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
|
10
|
+
exit e.status_code
|
|
11
|
+
end
|
|
12
|
+
require 'rake'
|
|
13
|
+
|
|
14
|
+
require 'jeweler'
|
|
15
|
+
Jeweler::Tasks.new do |gem|
|
|
16
|
+
gem.name = "gmail_test"
|
|
17
|
+
gem.homepage = "http://github.com/dsokolowski/gmail_test"
|
|
18
|
+
gem.license = "MIT"
|
|
19
|
+
gem.summary = %Q{summary}
|
|
20
|
+
gem.description = %Q{description}
|
|
21
|
+
gem.email = "daniel@oxos.pl"
|
|
22
|
+
gem.authors = ["Daniel"]
|
|
23
|
+
# dependencies defined in Gemfile
|
|
24
|
+
gem.add_dependency "capybara", ">= 1.1.1"
|
|
25
|
+
end
|
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
|
27
|
+
|
|
28
|
+
require 'rake/testtask'
|
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
|
30
|
+
test.libs << 'lib' << 'test'
|
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
|
32
|
+
test.verbose = true
|
|
33
|
+
end
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.4
|
data/gmail_test.gemspec
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = "gmail_test"
|
|
8
|
+
s.version = "0.0.4"
|
|
9
|
+
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
+
s.authors = ["Daniel"]
|
|
12
|
+
s.date = "2011-11-08"
|
|
13
|
+
s.description = "description"
|
|
14
|
+
s.email = "daniel@oxos.pl"
|
|
15
|
+
s.extra_rdoc_files = [
|
|
16
|
+
"LICENSE.txt",
|
|
17
|
+
"README.rdoc"
|
|
18
|
+
]
|
|
19
|
+
s.files = [
|
|
20
|
+
".document",
|
|
21
|
+
"Gemfile",
|
|
22
|
+
"Gemfile.lock",
|
|
23
|
+
"LICENSE.txt",
|
|
24
|
+
"README.rdoc",
|
|
25
|
+
"Rakefile",
|
|
26
|
+
"VERSION",
|
|
27
|
+
"gmail_test.gemspec",
|
|
28
|
+
"lib/gmail_test.rb",
|
|
29
|
+
"lib/gmail_test/assertions.rb",
|
|
30
|
+
"lib/gmail_test/assertions/.DS_Store",
|
|
31
|
+
"lib/gmail_test/assertions/.assertions.rb.swn",
|
|
32
|
+
"lib/gmail_test/assertions/.assertions.rb.swo",
|
|
33
|
+
"lib/gmail_test/assertions/.assertions.rb.swp",
|
|
34
|
+
"lib/gmail_test/assertions/base.rb",
|
|
35
|
+
"lib/gmail_test/assertions/gmail.rb",
|
|
36
|
+
"test/helper.rb",
|
|
37
|
+
"test/test_gmail_test.rb"
|
|
38
|
+
]
|
|
39
|
+
s.homepage = "http://github.com/dsokolowski/gmail_test"
|
|
40
|
+
s.licenses = ["MIT"]
|
|
41
|
+
s.require_paths = ["lib"]
|
|
42
|
+
s.rubygems_version = "1.8.10"
|
|
43
|
+
s.summary = "summary"
|
|
44
|
+
|
|
45
|
+
if s.respond_to? :specification_version then
|
|
46
|
+
s.specification_version = 3
|
|
47
|
+
|
|
48
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
49
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
50
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
51
|
+
s.add_runtime_dependency(%q<capybara>, [">= 1.1.1"])
|
|
52
|
+
else
|
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
55
|
+
s.add_dependency(%q<capybara>, [">= 1.1.1"])
|
|
56
|
+
end
|
|
57
|
+
else
|
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
60
|
+
s.add_dependency(%q<capybara>, [">= 1.1.1"])
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Assertions
|
|
2
|
+
module Gmail
|
|
3
|
+
|
|
4
|
+
def assert_logged_in(email,password)
|
|
5
|
+
visit "http://gmail/com"
|
|
6
|
+
fill_in "Email", :with => email
|
|
7
|
+
fill_in "Passwd", :with => password
|
|
8
|
+
assert_appears("#loading") do
|
|
9
|
+
click_button "Sign in"
|
|
10
|
+
end
|
|
11
|
+
wait_until { has_no_css?("#loading") }
|
|
12
|
+
within_frame "canvas_frame" do
|
|
13
|
+
wait_until { has_css?("#gbi4m1", :text => email) }
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def assert_logged_out
|
|
18
|
+
within_frame "canvas_frame" do
|
|
19
|
+
find("#gbi4m1").click
|
|
20
|
+
click_link "Sign out"
|
|
21
|
+
end
|
|
22
|
+
switch_to_main_window
|
|
23
|
+
wait_until { assert has_css?(".signin-box #gaia_loginform") }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def assert_email_sent(subject,body,to)
|
|
27
|
+
switch_to_main_window/
|
|
28
|
+
find("div", :text => "Compose mail").click
|
|
29
|
+
within_frame "canvas_frame" do
|
|
30
|
+
wait_until { assert has_css?("textarea[name='to']") }
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
protected
|
|
35
|
+
|
|
36
|
+
def switch_to_main_window
|
|
37
|
+
page.driver.browser.switch_to.window page.driver.browser.window_handles.first
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
data/lib/gmail_test.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'minitest/autorun'
|
|
2
|
+
require 'minitest/spec'
|
|
3
|
+
|
|
4
|
+
require 'capybara'
|
|
5
|
+
require 'capybara/dsl'
|
|
6
|
+
require "rack"
|
|
7
|
+
require "ruby-debug"
|
|
8
|
+
|
|
9
|
+
Capybara.current_driver = :selenium
|
|
10
|
+
|
|
11
|
+
require File.expand_path(File.dirname(__FILE__)) + "/gmail_test/assertions.rb"
|
|
12
|
+
MiniTest::Assertion.send(:include,Assertions::Base)
|
|
13
|
+
MiniTest::Unit::TestCase.send(:include,Capybara::DSL)
|
data/test/helper.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'bundler'
|
|
3
|
+
begin
|
|
4
|
+
Bundler.setup(:default, :development)
|
|
5
|
+
rescue Bundler::BundlerError => e
|
|
6
|
+
$stderr.puts e.message
|
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
|
8
|
+
exit e.status_code
|
|
9
|
+
end
|
|
10
|
+
require 'test/unit'
|
|
11
|
+
require 'shoulda'
|
|
12
|
+
|
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
15
|
+
require 'gmail_test'
|
|
16
|
+
|
|
17
|
+
class Test::Unit::TestCase
|
|
18
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gmail_test
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.4
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Daniel
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2011-11-08 00:00:00.000000000Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: bundler
|
|
16
|
+
requirement: &2165870060 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.0.0
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *2165870060
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: jeweler
|
|
27
|
+
requirement: &2165869120 !ruby/object:Gem::Requirement
|
|
28
|
+
none: false
|
|
29
|
+
requirements:
|
|
30
|
+
- - ~>
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 1.6.4
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: *2165869120
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: capybara
|
|
38
|
+
requirement: &2165868340 !ruby/object:Gem::Requirement
|
|
39
|
+
none: false
|
|
40
|
+
requirements:
|
|
41
|
+
- - ! '>='
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: 1.1.1
|
|
44
|
+
type: :runtime
|
|
45
|
+
prerelease: false
|
|
46
|
+
version_requirements: *2165868340
|
|
47
|
+
description: description
|
|
48
|
+
email: daniel@oxos.pl
|
|
49
|
+
executables: []
|
|
50
|
+
extensions: []
|
|
51
|
+
extra_rdoc_files:
|
|
52
|
+
- LICENSE.txt
|
|
53
|
+
- README.rdoc
|
|
54
|
+
files:
|
|
55
|
+
- .document
|
|
56
|
+
- Gemfile
|
|
57
|
+
- Gemfile.lock
|
|
58
|
+
- LICENSE.txt
|
|
59
|
+
- README.rdoc
|
|
60
|
+
- Rakefile
|
|
61
|
+
- VERSION
|
|
62
|
+
- gmail_test.gemspec
|
|
63
|
+
- lib/gmail_test.rb
|
|
64
|
+
- lib/gmail_test/assertions.rb
|
|
65
|
+
- lib/gmail_test/assertions/.DS_Store
|
|
66
|
+
- lib/gmail_test/assertions/.assertions.rb.swn
|
|
67
|
+
- lib/gmail_test/assertions/.assertions.rb.swo
|
|
68
|
+
- lib/gmail_test/assertions/.assertions.rb.swp
|
|
69
|
+
- lib/gmail_test/assertions/base.rb
|
|
70
|
+
- lib/gmail_test/assertions/gmail.rb
|
|
71
|
+
- test/helper.rb
|
|
72
|
+
- test/test_gmail_test.rb
|
|
73
|
+
homepage: http://github.com/dsokolowski/gmail_test
|
|
74
|
+
licenses:
|
|
75
|
+
- MIT
|
|
76
|
+
post_install_message:
|
|
77
|
+
rdoc_options: []
|
|
78
|
+
require_paths:
|
|
79
|
+
- lib
|
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ! '>='
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: '0'
|
|
86
|
+
segments:
|
|
87
|
+
- 0
|
|
88
|
+
hash: 1237463540786506376
|
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
|
+
none: false
|
|
91
|
+
requirements:
|
|
92
|
+
- - ! '>='
|
|
93
|
+
- !ruby/object:Gem::Version
|
|
94
|
+
version: '0'
|
|
95
|
+
requirements: []
|
|
96
|
+
rubyforge_project:
|
|
97
|
+
rubygems_version: 1.8.10
|
|
98
|
+
signing_key:
|
|
99
|
+
specification_version: 3
|
|
100
|
+
summary: summary
|
|
101
|
+
test_files: []
|