druid-ts 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69f2f0968bdcb0f4b0bf3bc82c40747118a2b2c8
4
- data.tar.gz: d7e98d748da74a8936534b3a4b3a3b628130ff80
3
+ metadata.gz: 3fea63e0e39bb671b5e23a9be17e0b7e4f5dd947
4
+ data.tar.gz: 774a427a1de59e651cf3e04fe3beb74e75e2d33b
5
5
  SHA512:
6
- metadata.gz: a2b3000474fb1dc3ec20bc53e8bf452e49f90ef3d7cece31bd309136bb6e6dff6c7319bdecdbfb98598b7baa5a0fd83f56b4d46882ec8200bdf90a925fd8a17b
7
- data.tar.gz: 84203743b392fd02051531e63209dc6581d83e6830995d091b9f8ef7a35cdcfe6bd8e25aec3c95b4a8cf5f7c65d994aff373d622f7d0631a4573e2a9d1e4fc2a
6
+ metadata.gz: e0cbcc12bd07002c104cd2917143d965c2d5a83d879f968afe4a787de343be843a962802985c0ed65b4f3ecf16776734dd3eaa70f3fa98a498dacddaeecdf90e
7
+ data.tar.gz: 14fc2d10172626f055c285414c4100d81199378bb1eab28af47779ff3aa03f6d10d648b315d252d309d04a40e8c7b63a0f65be1bdd02291e5a4ab41c3b78e957
data/ChangeLog CHANGED
@@ -1,10 +1,77 @@
1
- === 2017-01-13
1
+ === Version-1.1.7/2017-01-16
2
+ * Enhancements
3
+ * Updated expected_element to use the global default element wait by default
4
+ * Added scroll_into_view method to Element
5
+ * Updated routes to accept more than two entries in the array which are passed as arguments
6
+ * Added *_element and *_elements methods to Druid and Element for the following types
7
+ * addr
8
+ * address
9
+ * article
10
+ * aside
11
+ * bdi
12
+ * bdo
13
+ * cite
14
+ * code
15
+ * dd
16
+ * dfn
17
+ * dt
18
+ * em
19
+ * figcaption
20
+ * figure
21
+ * footer
22
+ * header
23
+ * hgroup
24
+ * kbd
25
+ * mark
26
+ * nav
27
+ * noscript
28
+ * rp
29
+ * rt
30
+ * ruby
31
+ * samp
32
+ * section
33
+ * sub
34
+ * summary
35
+ * sup
36
+ * var
37
+ * wbr
38
+ === 2017-01-15
39
+ * Fixes
40
+ * Fixed issue when calling new multi-element class methods using a block
41
+ === Version 1.1.6/2017-01-13
2
42
  * Enhancement
3
43
  * Added callback to initialize_accessors method during initialization
4
44
  * Added html method to Element
5
45
  * Added generated method to return text for a table
6
46
  * Added generated method to return text for an unordered list
7
47
  * Added generated method to return text for an ordered list
48
+ * Added the following class level methods to return all elements matching the locator
49
+ * divs
50
+ * buttons
51
+ * text_fields
52
+ * hidden_fields
53
+ * text_areas
54
+ * select_lists
55
+ * links
56
+ * checkboxes
57
+ * radio_buttons
58
+ * spans
59
+ * tables
60
+ * cells
61
+ * images
62
+ * forms
63
+ * list_items
64
+ * unordered_lists
65
+ * ordered_lists
66
+ * h1s
67
+ * h2s
68
+ * h3s
69
+ * h4s
70
+ * h5s
71
+ * h6s
72
+ * paragraphs
73
+ * labels
74
+ * file_fields
8
75
  === 2017-01-09
9
76
  * Enhancement
10
77
  * Added params class instance variable to hold hash values that can be used in the page
data/Gemfile CHANGED
@@ -7,3 +7,4 @@ gem 'selenium-webdriver', '2.53.4'
7
7
  gem 'rspec'
8
8
  gem 'cucumber'
9
9
  gem 'rack'
10
+ gem 'net-http-persistent'
@@ -1,5 +1,5 @@
1
1
  <%
2
- std_opts = "BROWSER=firefox --no-source --color --format pretty"
2
+ std_opts = "--no-source --color --format pretty"
3
3
  %>
4
4
 
5
5
  default: DRIVER=WATIR <%= std_opts %>
@@ -1,45 +1,45 @@
1
- #Feature: Support for the audio element
1
+ Feature: Support for the audio element
2
2
 
3
- #Background:
4
- #Given I am on the static elements page
3
+ Background:
4
+ Given I am on the static elements page
5
5
 
6
- #Scenario: Finding an audio element
7
- #When I retrieve the audio element
8
- #Then I should know it exists
9
- #And I should know it is visible
6
+ Scenario: Finding an audio element
7
+ When I retrieve the audio element
8
+ Then I should know it exists
9
+ And I should know it is visible
10
10
 
11
- #Scenario Outline: Locating an audio element on the page
12
- #When I search for the audio element by "<search_by>"
13
- #Then I should know it is visible
11
+ Scenario Outline: Locating an audio element on the page
12
+ When I search for the audio element by "<search_by>"
13
+ Then I should know it is visible
14
14
 
15
- #Examples:
16
- #| search_by |
17
- #| id |
18
- #| class |
19
- #| name |
20
- #| xpath |
21
- #| index |
15
+ Examples:
16
+ | search_by |
17
+ | id |
18
+ | class |
19
+ | name |
20
+ | xpath |
21
+ | index |
22
22
 
23
- #Scenario Outline: Locating audios using multiple parameters
24
- #When I search for the audio element by "<param1>" and "<param2>"
25
- #Then I should know it is visible
23
+ Scenario Outline: Locating audios using multiple parameters
24
+ When I search for the audio element by "<param1>" and "<param2>"
25
+ Then I should know it is visible
26
26
 
27
- #Examples:
28
- #| param1 | param2 |
29
- #| class | index |
30
- #| name | index |
27
+ Examples:
28
+ | param1 | param2 |
29
+ | class | index |
30
+ | name | index |
31
31
 
32
- #Scenario: Should know if it is autoplay
33
- #When I retrieve the audio element
34
- #Then I should know the audio is not autoplay
32
+ Scenario: Should know if it is autoplay
33
+ When I retrieve the audio element
34
+ Then I should know the audio is not autoplay
35
35
 
36
- #Scenario: Should know if the controls are displayed
37
- #When I retrieve the audio element
38
- #Then I should know that the controls are displayed
36
+ Scenario: Should know if the controls are displayed
37
+ When I retrieve the audio element
38
+ Then I should know that the controls are displayed
39
39
 
40
- #Scenario: Should know if it is paused
41
- #When I retrieve the audio element
42
- #Then I should know that the audio is paused
40
+ Scenario: Should know if it is paused
41
+ When I retrieve the audio element
42
+ Then I should know that the audio is paused
43
43
 
44
44
  #Scenario: Should know its duration
45
45
  #When I retrieve the audio element
@@ -232,3 +232,8 @@ Feature: Elements
232
232
  Scenario: Getting an element's id
233
233
  When I retrieve a button element
234
234
  Then I should know its id is "button_id"
235
+
236
+ Scenario: Scrolling so an element is visible
237
+ When I retrieve a heading element
238
+ And I scroll the heading element into view
239
+ Then the heading element should be visible
@@ -40,6 +40,8 @@
40
40
  </script>
41
41
 
42
42
  <audio controls id="audio" name="audio" class="audio">
43
+ <!-- <source src="04-Death_Becomes_Fur.mp4" type='audio/mp4'/> -->
44
+ <!-- <source src="04-Death_Becomes_Fur.oga" type='audio/ogg; codecs=vorbis'/> -->
43
45
  <p>Your user agent does not support the HTML5 Audio element.</p>
44
46
  </audio>
45
47
 
@@ -288,3 +288,192 @@ Feature: Multi Elements
288
288
  Scenario: Selecting file fields using no identifier
289
289
  When I select all file fields using no identifier
290
290
  Then I should have 3 file fields
291
+
292
+ Scenario: Selecting all divs based on a class declaration
293
+ When I select the divs using the generated method
294
+ Then I should have 3 divs
295
+ And the text of div 1 should be "Div 1"
296
+ And the text of div 2 should be "Div 2"
297
+ And the text of div 3 should be "Div 3"
298
+
299
+ Scenario: Selecting buttons based on a class declaration
300
+ When I select the buttons using the generated method
301
+ Then I should have 3 buttons
302
+ And the value of button 1 should be "Button 1"
303
+ And the value of button 2 should be "Button 2"
304
+ And the value of button 3 should be "Button 3"
305
+
306
+ Scenario: Selecting text fields based on a class declaration
307
+ When I select the text field using the generated method
308
+ Then I should have 3 text fields
309
+ And the value of text field 1 should be "text 1"
310
+ And the value of text field 2 should be "text 2"
311
+ And the value of text field 3 should be "text 3"
312
+
313
+ Scenario: Selecting hidden fields based on a class declaration
314
+ When I select the hidden fields using the generated method
315
+ Then I should have 3 hidden fields
316
+ And the value of hidden field 1 should be "hidden 1"
317
+ And the value of hidden field 2 should be "hidden 2"
318
+ And the value of hidden field 3 should be "hidden 3"
319
+
320
+ Scenario: Selecting text areas based on a class declaration
321
+ When I select the text areas using the generated method
322
+ Then I should have 3 text areas
323
+ And the value of text area 1 should be "textarea 1"
324
+ And the value of text area 2 should be "textarea 2"
325
+ And the value of text area 3 should be "textarea 3"
326
+
327
+ Scenario: Selecting select lists based on a class declaration
328
+ When I select the select lists using the generated method
329
+ Then I should have 3 select lists
330
+ And the value of select list 1 should be "selectlist 1"
331
+ And the value of select list 2 should be "selectlist 2"
332
+ And the value of select list 3 should be "selectlist 3"
333
+
334
+ Scenario: Selecting links based on a class declaration
335
+ When I select the links using the generated method
336
+ Then I should have 3 links
337
+ And the text of link 1 should be "link 1"
338
+ And the text of link 2 should be "link 2"
339
+ And the text of link 3 should be "link 3"
340
+
341
+ Scenario: Selecting checkboxes based on a class declaration
342
+ When I select the check boxes using the generated method
343
+ Then I should have 3 checkboxes
344
+ And the value of checkbox 1 should be "checkbox 1"
345
+ And the value of checkbox 2 should be "checkbox 2"
346
+ And the value of checkbox 3 should be "checkbox 3"
347
+
348
+ Scenario: Selecting radio buttons based on a class declaration
349
+ When I select the radio buttons using the generated method
350
+ Then I should have 3 radio buttons
351
+ And the value of radio button 1 should be "radio 1"
352
+ And the value of radio button 2 should be "radio 2"
353
+ And the value of radio button 3 should be "radio 3"
354
+
355
+ Scenario: Selecting spans based on a class declaration
356
+ When I select the spans using the generated method
357
+ Then I should have 3 spans
358
+ And the text of span 1 should be "Span 1"
359
+ And the text of span 2 should be "Span 2"
360
+ And the text of span 3 should be "Span 3"
361
+
362
+ Scenario: Selecting tables based on a class declaration
363
+ When I select the tables using the generated method
364
+ Then I should have 3 tables
365
+ And the first row first column for table 1 should have "Data 1"
366
+ And the first row first column for table 2 should have "Data 4"
367
+ And the first row first column for table 3 should have "Data 7"
368
+
369
+ Scenario: Selecting cells based on a class declaration
370
+ When I select the cells using the generated method
371
+ Then I should have 3 cells
372
+ And the text for cell 1 should be "Data 1"
373
+ And the text for cell 2 should be "Data 2"
374
+ And the text for cell 3 should be "Data 3"
375
+
376
+ Scenario: Selecting images based on a class declaration
377
+ When I select the images using the generated method
378
+ Then I should have 3 images
379
+ And the alt for image 1 should be "image 1"
380
+ And the alt for image 2 should be "image 2"
381
+ And the alt for image 3 should be "image 3"
382
+
383
+ Scenario: Selecting forms based on a class declaration
384
+ When I select the forms using the generated method
385
+ Then I should have 3 forms
386
+ And the action for form 1 should be "form1"
387
+ And the action for form 2 should be "form2"
388
+ And the action for form 3 should be "form3"
389
+
390
+ Scenario: Selecting list items based on a class declaration
391
+ When I select the list items using the generated method
392
+ Then I should have 3 list items
393
+ And the text for list item 1 should be "Item One"
394
+ And the text for list item 2 should be "Item Two"
395
+ And the text for list item 3 should be "Item Three"
396
+
397
+ Scenario: Selecting unordered lists based on a class declaration
398
+ When I select the unordered lists using the generated method
399
+ Then I should have 3 unordered lists
400
+ And the text for the first item in unordered list 1 should be "Item One"
401
+ And the text for the first item in unordered list 2 should be "Item Four"
402
+ And the text for the first item in unordered list 3 should be "Item Five"
403
+
404
+ Scenario: Selecting ordered lists based on a class declaration
405
+ When I select the ordered lists using the generated method
406
+ Then I should have 3 ordered lists
407
+ And the text for the first item in ordered list 1 should be "Number One"
408
+ And the text for the first item in ordered list 2 should be "Number Two"
409
+ And the text for the first item in ordered list 3 should be "Number Three"
410
+
411
+ Scenario: Selecting h1s based on a class declaration
412
+ When I select the h1s using the generated method
413
+ Then I should have 3 h1s
414
+ And the text for h1 1 should be "H1 One"
415
+ And the text for h1 2 should be "H1 Two"
416
+ And the text for h1 3 should be "H1 Three"
417
+
418
+ Scenario: Selecting h2s based on a class declaration
419
+ When I select the h2s using the generated method
420
+ Then I should have 3 h2s
421
+ And the text for h2 1 should be "H2 One"
422
+ And the text for h2 2 should be "H2 Two"
423
+ And the text for h2 3 should be "H2 Three"
424
+
425
+ Scenario: Selecting h3s based on a class declaration
426
+ When I select the h3s using the generated method
427
+ Then I should have 3 h3s
428
+ And the text for h3 1 should be "H3 One"
429
+ And the text for h3 2 should be "H3 Two"
430
+ And the text for h3 3 should be "H3 Three"
431
+
432
+ Scenario: Selecting h4s based on a class declaration
433
+ When I select the h4s using the generated method
434
+ Then I should have 3 h4s
435
+ And the text for h4 1 should be "H4 One"
436
+ And the text for h4 2 should be "H4 Two"
437
+ And the text for h4 3 should be "H4 Three"
438
+
439
+ Scenario: Selecting h5s based on a class declaration
440
+ When I select the h5s using the generated method
441
+ Then I should have 3 h5s
442
+ And the text for h5 1 should be "H5 One"
443
+ And the text for h5 2 should be "H5 Two"
444
+ And the text for h5 3 should be "H5 Three"
445
+
446
+ Scenario: Selecting h6s based on a class declaration
447
+ When I select the h6s using the generated method
448
+ Then I should have 3 h6s
449
+ And the text for h6 1 should be "H6 One"
450
+ And the text for h6 2 should be "H6 Two"
451
+ And the text for h6 3 should be "H6 Three"
452
+
453
+ Scenario: Selecting paragraphs based on a class declaration
454
+ When I select the paragraphs using the generated method
455
+ Then I should have 3 paragraphs
456
+ And the text for paragraph 1 should be "Paragraph One"
457
+ And the text for paragraph 2 should be "Paragraph Two"
458
+ And the text for paragraph 3 should be "Paragraph Three"
459
+
460
+ Scenario: Selecting labels based on a class declaration
461
+ When I select the labels using the generated method
462
+ Then I should have 3 labels
463
+ And the text for label 1 should be "Label 1"
464
+ And the text for label 2 should be "Label 2"
465
+ And the text for label 3 should be "Label 3"
466
+
467
+ Scenario: Selecting file fields based on a class declaration
468
+ When I select the file fields using the generated method
469
+ Then I should have 3 file fields
470
+ And the title for file field 1 should be "File Field 1"
471
+ And the title for file field 2 should be "File Field 2"
472
+ And the title for file field 3 should be "File Field 3"
473
+
474
+ Scenario: Selecting all divs using a block instead of an identifier
475
+ When I select the divs using a block
476
+ Then I should have 3 divs
477
+ And the text of div 1 should be "Div 1"
478
+ And the text of div 2 should be "Div 2"
479
+ And the text of div 3 should be "Div 3"
@@ -5,7 +5,11 @@ require 'webrick'
5
5
  class SampleApp
6
6
 
7
7
  def self.start(host, port)
8
- Rack::Handler::WEBrick.run(new, :Host => host, :Port => port)
8
+ Rack::Handler::WEBrick.run new,
9
+ :Host => host,
10
+ :Port => port,
11
+ :Logger => ::WEBrick::Log.new(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null'),
12
+ :AccessLog => [nil, nil]
9
13
  end
10
14
 
11
15
  def initialize
@@ -134,3 +134,11 @@ end
134
134
  Then(/^I should know the html is "(.*)"$/) do |html|
135
135
  expect(@element.html).to eql html
136
136
  end
137
+
138
+ When(/^I scroll the heading element into view$/) do
139
+ @element.scroll_into_view
140
+ end
141
+
142
+ Then(/^the heading element should be visible$/) do
143
+ expect(@element).to be_visible
144
+ end
@@ -1,5 +1,5 @@
1
1
  When(/^I locate the form by "(.*?)"$/) do |how|
2
- @element = @page.send "form_#{how}_form"
2
+ @element = @page.send "form_#{how}_element"
3
3
  end
4
4
 
5
5
  Then(/^I should be able to submit the form$/) do
@@ -7,7 +7,7 @@ Then(/^I should be able to submit the form$/) do
7
7
  end
8
8
 
9
9
  When(/^I locate the form using "(.*?)" and "(.*?)"$/) do |param1, param2|
10
- @element = @page.send "form_#{param1}_#{param2}_form"
10
+ @element = @page.send "form_#{param1}_#{param2}_element"
11
11
  end
12
12
 
13
13
  When(/^I locate the form$/) do
@@ -6,16 +6,22 @@ class JavascriptPage
6
6
  button(:compute, :value => 'Compute')
7
7
  end
8
8
 
9
+ def build_url(page)
10
+ target = ENV['BROWSER']
11
+ return "http://localhost:4567/#{page}" if target.nil? or target.include? 'local'
12
+ "http://ec2-107-22-131-88.compute-1.amazonaws.com:4567/#{page}"
13
+ end
14
+
9
15
  Given(/^I am on jQuery example page$/) do
10
16
  Druid.javascript_framework = :jquery
11
17
  @page = JavascriptPage.new(@driver)
12
- @page.navigate_to "http://localhost:4567/jquery.html"
18
+ @page.navigate_to build_url("jquery.html")
13
19
  end
14
20
 
15
21
  Given(/^I am on the Prototype example page$/) do
16
22
  Druid.javascript_framework = :prototype
17
23
  @page = JavascriptPage.new(@driver)
18
- @page.navigate_to "http://localhost:4567/prototype.html"
24
+ @page.navigate_to build_url("prototype.html")
19
25
  end
20
26
 
21
27
  When(/^I ask to compute "([^"]*)"$/) do |expression|