gwt_widgets 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/features/datepicker.feature +14 -0
- data/features/step_definitions/datebox_steps.rb +23 -0
- data/features/step_definitions/datepicker_steps.rb +14 -0
- data/features/support/pages/date_picker_page.rb +15 -0
- data/features/support/pages/dialog_box_page.rb +2 -2
- data/lib/gwt_widgets/date_box.rb +20 -0
- data/lib/gwt_widgets/date_picker.rb +16 -0
- data/lib/gwt_widgets/version.rb +1 -1
- data/lib/gwt_widgets.rb +5 -1
- metadata +14 -4
data/ChangeLog
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Using the gwt_dialog_box Dialog Box Widget
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I am on the showcase date picker page
|
5
|
+
|
6
|
+
Scenario: I choose a day from the date picker
|
7
|
+
Given I choose the 14th day from the date picker
|
8
|
+
Then I should see today's date highlighted on the date picker
|
9
|
+
And I should see the 14th day selected on the date picker
|
10
|
+
|
11
|
+
# Scenario: I choose a day from the date input box
|
12
|
+
# Given I click in the date box field
|
13
|
+
# When I choose the 16th day from the date box
|
14
|
+
# Then I should see the 16th day in the date box field
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
Given /^I am on the showcase date picker page$/ do
|
3
|
+
visit DatePickerPage
|
4
|
+
@current_page.wait_until do
|
5
|
+
@current_page.browser.text.include? 'Permanent DatePicker:'
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
Given /^I click in the date box field$/ do
|
10
|
+
require 'pry'; binding.pry;
|
11
|
+
@current_page.datebox.input.focus
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /^I choose the 16th day from the date box$/ do
|
15
|
+
@current_page.datebox.choose_day 16
|
16
|
+
end
|
17
|
+
|
18
|
+
Then /^I should see the 16th day in the date box$/ do
|
19
|
+
end
|
20
|
+
|
21
|
+
Then /^I should see the 16th day in the date box field$/ do
|
22
|
+
@current_page.datebox.input.text.should == '16'
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
Given /^I choose the 14th day from the date picker$/ do
|
3
|
+
@current_page.datepicker.choose_day 14
|
4
|
+
end
|
5
|
+
|
6
|
+
Then /^I should see today's date highlighted on the date picker$/ do
|
7
|
+
todays_day = Time.new.day
|
8
|
+
@current_page.datepicker.highlighted_day.should == todays_day.to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
And /^I should see the 14th day selected on the date picker$/ do
|
12
|
+
@current_page.datepicker.chosen_day.should == '14'
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class DatePickerPage
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
page_url "http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwDatePicker"
|
5
|
+
|
6
|
+
gwt_datepicker(:datepicker, :class => 'gwt-DatePicker')
|
7
|
+
def datepicker
|
8
|
+
datepicker_element
|
9
|
+
end
|
10
|
+
|
11
|
+
gwt_datebox(:datebox, :class => 'gwt-DateBox', :popup => true)
|
12
|
+
def datebox
|
13
|
+
datebox_element
|
14
|
+
end
|
15
|
+
end
|
@@ -5,10 +5,10 @@ class DialogBoxPage
|
|
5
5
|
|
6
6
|
button(:show_dialog, :text => 'Show Dialog Box')
|
7
7
|
|
8
|
-
|
8
|
+
gwt_dialogbox(:dialogbox, :class => 'gwt-DialogBox')
|
9
9
|
|
10
10
|
def dialog_box
|
11
|
-
|
11
|
+
dialogbox_element
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class GwtWidgets::DateBox < PageObject::Elements::Table
|
2
|
+
|
3
|
+
def input
|
4
|
+
require 'pry'; binding.pry;
|
5
|
+
text_field_element(:class => 'gwt-DateBox', :type => "text")
|
6
|
+
end
|
7
|
+
|
8
|
+
def choose_day (day)
|
9
|
+
div_element(:class => 'datePickerDay', :text => day.to_s).click
|
10
|
+
end
|
11
|
+
|
12
|
+
def chosen_day
|
13
|
+
div_element(:class => 'datePickerDay datePickerDayIsValue').text
|
14
|
+
end
|
15
|
+
|
16
|
+
def highlighted_day
|
17
|
+
div_element(:class => 'datePickerDay datePickerDayIsToday').text
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class GwtWidgets::DatePicker < PageObject::Elements::TextField
|
2
|
+
|
3
|
+
def choose_day (day)
|
4
|
+
div_element(:class => 'datePickerDay', :text => day.to_s).click
|
5
|
+
end
|
6
|
+
|
7
|
+
def chosen_day
|
8
|
+
div_element(:class => 'datePickerDay datePickerDayIsValue').text
|
9
|
+
end
|
10
|
+
|
11
|
+
def highlighted_day
|
12
|
+
div_element(:class => 'datePickerDay datePickerDayIsToday').text
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
end
|
data/lib/gwt_widgets/version.rb
CHANGED
data/lib/gwt_widgets.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'page-object'
|
2
2
|
require 'gwt_widgets/version'
|
3
3
|
require 'gwt_widgets/dialog_box'
|
4
|
+
require 'gwt_widgets/date_picker'
|
5
|
+
require 'gwt_widgets/date_box'
|
4
6
|
|
5
7
|
module GwtWidgets
|
6
8
|
|
7
|
-
PageObject.register_widget(:
|
9
|
+
PageObject.register_widget(:gwt_dialogbox, GwtWidgets::DialogBox, 'div')
|
10
|
+
PageObject.register_widget(:gwt_datebox, GwtWidgets::DateBox, 'input')
|
11
|
+
PageObject.register_widget(:gwt_datepicker, GwtWidgets::DatePicker, 'table')
|
8
12
|
|
9
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gwt_widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: page-object
|
@@ -138,14 +138,20 @@ files:
|
|
138
138
|
- README.md
|
139
139
|
- Rakefile
|
140
140
|
- cucumber.yml
|
141
|
+
- features/datepicker.feature
|
141
142
|
- features/dialog_box.feature
|
143
|
+
- features/step_definitions/datebox_steps.rb
|
144
|
+
- features/step_definitions/datepicker_steps.rb
|
142
145
|
- features/step_definitions/dialogbox_steps.rb
|
143
146
|
- features/support/env.rb
|
144
147
|
- features/support/hooks.rb
|
148
|
+
- features/support/pages/date_picker_page.rb
|
145
149
|
- features/support/pages/dialog_box_page.rb
|
146
150
|
- features/support/persistent_browser.rb
|
147
151
|
- gwt_widget.gemspec
|
148
152
|
- lib/gwt_widgets.rb
|
153
|
+
- lib/gwt_widgets/date_box.rb
|
154
|
+
- lib/gwt_widgets/date_picker.rb
|
149
155
|
- lib/gwt_widgets/dialog_box.rb
|
150
156
|
- lib/gwt_widgets/version.rb
|
151
157
|
homepage: http://github.com/joelbyler/gwt_widgets
|
@@ -162,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
168
|
version: '0'
|
163
169
|
segments:
|
164
170
|
- 0
|
165
|
-
hash:
|
171
|
+
hash: 1353361856140982205
|
166
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
173
|
none: false
|
168
174
|
requirements:
|
@@ -171,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
177
|
version: '0'
|
172
178
|
segments:
|
173
179
|
- 0
|
174
|
-
hash:
|
180
|
+
hash: 1353361856140982205
|
175
181
|
requirements: []
|
176
182
|
rubyforge_project: gwt_widgets
|
177
183
|
rubygems_version: 1.8.25
|
@@ -179,10 +185,14 @@ signing_key:
|
|
179
185
|
specification_version: 3
|
180
186
|
summary: PageObject Widgets extention for GWT apps
|
181
187
|
test_files:
|
188
|
+
- features/datepicker.feature
|
182
189
|
- features/dialog_box.feature
|
190
|
+
- features/step_definitions/datebox_steps.rb
|
191
|
+
- features/step_definitions/datepicker_steps.rb
|
183
192
|
- features/step_definitions/dialogbox_steps.rb
|
184
193
|
- features/support/env.rb
|
185
194
|
- features/support/hooks.rb
|
195
|
+
- features/support/pages/date_picker_page.rb
|
186
196
|
- features/support/pages/dialog_box_page.rb
|
187
197
|
- features/support/persistent_browser.rb
|
188
198
|
has_rdoc:
|