Skip to content

Commit

Permalink
basic gem structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cheezy committed Aug 22, 2011
0 parents commit 7e1fab7
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
*.gem
.bundle
Gemfile.lock
pkg/*
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in iemodal.gemspec
gemspec
1 change: 1 addition & 0 deletions Rakefile
@@ -0,0 +1 @@
require "bundler/gem_tasks"
5 changes: 5 additions & 0 deletions cucumber.yml
@@ -0,0 +1,5 @@
default: DRIVER=WATIR --no-source --color --format pretty
watir: DRIVER=WATIR --no-source --color --format pretty
selenium: DRIVER=SELENIUM --no-source --color --format pretty
autotest: DRIVER=WATIR --no-source --color --format pretty

15 changes: 15 additions & 0 deletions features/html/main.html
@@ -0,0 +1,15 @@
<html>
<head>
<title>iemodal</title>
</head>
<body>

<input id=launch_modal_button type=button
onclick='window.showModalDialog(
"modal_1.html",
self,
"status:no;resizable:Yes;help:no;maximize:no;minimize:no;scrollbars:no;"); return false;'
value="Launch a modal" />

</body>
</html>
35 changes: 35 additions & 0 deletions features/html/modal_1.html
@@ -0,0 +1,35 @@
<html>

<head>
<title>Modal</title>
<script>
function delay_action(other_function)
{
setTimeout(other_function, 3000);
}

function close_window()
{
self.close()
}
</script>
</head>

<body>

<h2>Modal 1</h2>

<h3>Close buttons</h3>
<input id=close_window type=button onclick="close_window()" value="Close window"/>
<input id=delayed_close type=button onclick="delay_action('close_window()')" value="Close window with delay" />

<h3>Nested modal</h3>
<input id=launch_modal_button type=button
onclick='window.showModalDialog(
"modal_2.html",
self,
"status:no;resizable:Yes;help:no;maximize:no;minimize:no;scrollbars:no;"); return false;'
value="Launch another modal"/>

</body>
</html>
27 changes: 27 additions & 0 deletions features/html/modal_2.html
@@ -0,0 +1,27 @@
<html>

<head>
<title>Modal 2</title>
<script>
function delay_action(other_function)
{
setTimeout(other_function, 3000);
}

function close_window()
{
self.close()
}
</script>
</head>

<body>

<h2>Modal 2</h2>

<h3>Close buttons</h3>
<input id=close_window type="button" onclick="close_window()" value="Close window"/>
<input id=delayed_close type=button onclick="delay_action('close_window()')" value="Close window with delay" />

</body>
</html>
10 changes: 10 additions & 0 deletions features/modals.feature
@@ -0,0 +1,10 @@
Feature: handing modal dialogs

Background:
Given I am on the static elements page


Scenario: Interacting with a modal
When I open a modal
Then I should be able click a button to close the modal

11 changes: 11 additions & 0 deletions features/step_definitions/modals_steps.rb
@@ -0,0 +1,11 @@
Given /^I am on the static elements page$/ do
pending # express the regexp above with the code you wish you had
end

When /^I open a modal$/ do
pending # express the regexp above with the code you wish you had
end

Then /^I should be able click a button to close the modal$/ do
pending # express the regexp above with the code you wish you had
end
5 changes: 5 additions & 0 deletions features/support/env.rb
@@ -0,0 +1,5 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))

require 'rspec/expectations'
require 'watir-webdriver'
require 'selenium-webdriver'
15 changes: 15 additions & 0 deletions features/support/url_helper.rb
@@ -0,0 +1,15 @@
module UrlHelper
class << self
def html
File.expand_path("#{File.dirname(__FILE__)}/../html")
end

def files
"file://#{html}"
end

def main
"#{files}/main.html"
end
end
end
27 changes: 27 additions & 0 deletions iemodal.gemspec
@@ -0,0 +1,27 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "iemodal/version"

Gem::Specification.new do |s|
s.name = "iemodal"
s.version = Iemodal::VERSION
s.authors = ["Jeffrey S. Morgan"]
s.email = ["jeff.morgan@leandog.com"]
s.homepage = ""
s.summary = %q{Makes it possible to interact with modal dialogs in Internet Explorer}
s.description = %q{Makes it possible to interact with modal dialogs in Internet Explorer}

s.rubyforge_project = "iemodal"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_dependency 'watir-webdriver', '>= 0.3.2'
s.add_dependency 'selenium-webdriver', '>= 2.4.0'
s.add_dependency 'page-object'

s.add_development_dependency 'rspec', '>= 2.6.0'
s.add_development_dependency 'cucumber', '>= 1.0.0'
end
5 changes: 5 additions & 0 deletions lib/iemodal.rb
@@ -0,0 +1,5 @@
require "iemodal/version"

module Iemodal
# Your code goes here...
end
3 changes: 3 additions & 0 deletions lib/iemodal/version.rb
@@ -0,0 +1,3 @@
module Iemodal
VERSION = "0.0.1"
end

0 comments on commit 7e1fab7

Please sign in to comment.