Selenium 1.1.12 → 1.1.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,6 @@ require 'alert'
10
10
  require 'html_element'
11
11
  require 'button'
12
12
  require 'link'
13
- require 'locator'
14
13
  require 'text_field'
15
14
  require 'text_area'
16
15
  require 'key'
@@ -6,11 +6,11 @@ class TextField < HtmlElement
6
6
  end
7
7
 
8
8
  def enter(value)
9
- @webpage.enter(@locator, value)
9
+ @webpage.enter(locator, value)
10
10
  end
11
11
 
12
12
  def value
13
- @webpage.value(@locator)
13
+ @webpage.value(locator)
14
14
  end
15
15
  end
16
16
  end
@@ -1 +1 @@
1
- 1.1.12
1
+ 1.1.14
@@ -95,6 +95,7 @@ module Selenium
95
95
  raise "couldn't understand how to build locator using #{how} with #{what}"
96
96
  end
97
97
  end
98
+ locator
98
99
  end
99
100
 
100
101
  def file_upload(how, what)
Binary file
@@ -40,6 +40,26 @@ module Selenium
40
40
  webpage.link(:href, 'a.html').locator.should == "xpath=//a[@href='a.html']"
41
41
  end
42
42
 
43
+ it 'should convert how and what to locator for selenium driver' do
44
+ webpage.element_locator('name').should == 'name'
45
+ webpage.element_locator(:id, 'id').should == 'id=id'
46
+ webpage.element_locator(:name, 'name').should == 'name=name'
47
+ webpage.element_locator(:xpath, '//a').should == 'xpath=//a'
48
+ end
49
+
50
+ it 'should support elements by passing in name directly' do
51
+ webpage.open_page('/test/index.html')
52
+ text_field = webpage.text_field('doubleclick')
53
+ text_field.locator.should == 'doubleclick'
54
+ text_field.enter('webpage')
55
+ webpage.text_area('doubleclick').enter('webpage')
56
+ webpage.text_area('doubleclick').double_click
57
+ webpage.should be_alert_present
58
+ webpage.alert_message.should == 'double clicked with value webpage'
59
+ webpage.text_area('doubleclick').key_press('a')
60
+ webpage.text_area('doubleclick').value.should == 'webpagea'
61
+ end
62
+
43
63
  it 'should support double click and key press' do
44
64
  webpage.open_page('/test/index.html')
45
65
  webpage.enter('doubleclick', 'webpage')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Selenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Duan
@@ -9,7 +9,7 @@ autorequire: selenium
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-13 00:00:00 -07:00
12
+ date: 2008-07-17 00:00:00 -07:00
13
13
  default_executable: selenium
14
14
  dependencies: []
15
15
 
@@ -36,7 +36,6 @@ files:
36
36
  - lib/selenium/html_element.rb
37
37
  - lib/selenium/key.rb
38
38
  - lib/selenium/link.rb
39
- - lib/selenium/locator.rb
40
39
  - lib/selenium/openqa
41
40
  - lib/selenium/openqa/README
42
41
  - lib/selenium/openqa/selenium-server.jar.txt
@@ -1,15 +0,0 @@
1
- module Selenium
2
- module Locator
3
- def by_name(name)
4
- name
5
- end
6
-
7
- def by_id(id)
8
- "id=#{id}"
9
- end
10
-
11
- def by_text(text)
12
- "link=#{text}"
13
- end
14
- end
15
- end