testcentricity_web 2.3.15.1 → 2.3.16

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bfc2d05554b6d3b0325861b0684ad700d4996ed
4
- data.tar.gz: aa970d336156379d22a89fc818239f3ab9f4ee04
3
+ metadata.gz: 68595e3bcab28823d4fe64782abec19ff6419740
4
+ data.tar.gz: fe8e3d045f00f1736a5fc7f3456ce474410b2183
5
5
  SHA512:
6
- metadata.gz: 56c24b4835d2ae5454c52ef17709b6150843ee297051a1d85f8a6fc1dde356cb155a0a7b2d236a70a7185a3c3c57f37a993c30b30a518dc3971f796de0eab2de
7
- data.tar.gz: 909fef42e2a8d339315ee0708ae747747b19013d9918327d88dc30eacd156c92bc215d29b402204ca00675c27e85dfc3cc656cea24adb42f4a676f209e20f4a1
6
+ metadata.gz: 1d503a58934422dec74065e8cb9bf4707f4d0beb695e0253cbede76c26cd5a755c51021d0e76e1caef8f03983f5b8976c4b24d90dab9ec5ccffd8aee1a7d963d
7
+ data.tar.gz: c6a71f6edd10a03e6e130640316f247c7f208e6aff571727623d58d6fe176204288c57d88a2c3bb8d8c14acda86758c8265d99efb133875c481b58262802b56f
data/README.md CHANGED
@@ -28,6 +28,10 @@ hosted instances of Chrome, Firefox, Safari, and IE web browsers.
28
28
 
29
29
 
30
30
  ## What's New
31
+ ###Version 2.3.16
32
+
33
+ * Added `PageSection.double_click`, `PageObject.right_click`, and `PageObject.send_keys` methods.
34
+
31
35
  ###Version 2.3.15
32
36
 
33
37
  * Added `PageObject.wait_until_exists` and `PageObject.wait_until_gone` methods.
@@ -527,7 +527,7 @@ module TestCentricity
527
527
  #
528
528
  def disabled?
529
529
  section, = find_section
530
- raise "Section object '#{get_name}' (#{get_locator}) not found" unless section
530
+ section_not_found_exception(section)
531
531
  section.disabled?
532
532
  end
533
533
 
@@ -564,7 +564,7 @@ module TestCentricity
564
564
  #
565
565
  def displayed?
566
566
  section, = find_section
567
- raise "Section object '#{get_name}' (#{get_locator}) not found" unless section
567
+ section_not_found_exception(section)
568
568
  section.displayed?
569
569
  end
570
570
 
@@ -628,6 +628,43 @@ module TestCentricity
628
628
  raise "Section object '#{get_name}' (#{get_locator}) remained visible after #{timeout} seconds" if visible?
629
629
  end
630
630
 
631
+ # Click on a Section object
632
+ #
633
+ # @example
634
+ # bar_chart_section.click
635
+ #
636
+ def click
637
+ section, = find_section
638
+ section_not_found_exception(section)
639
+ begin
640
+ section.click
641
+ rescue
642
+ section.click_at(10, 10) unless Capybara.current_driver == :poltergeist
643
+ end
644
+ end
645
+
646
+ # Double-click on a Section object
647
+ #
648
+ # @example
649
+ # bar_chart_section.double_click
650
+ #
651
+ def double_click
652
+ section, = find_section
653
+ section_not_found_exception(section)
654
+ page.driver.browser.action.double_click(section.native).perform
655
+ end
656
+
657
+ # Right-click on a Section object
658
+ #
659
+ # @example
660
+ # bar_chart_section.right_click
661
+ #
662
+ def right_click
663
+ section, = find_section
664
+ section_not_found_exception(section)
665
+ page.driver.browser.action.context_click(section.native).perform
666
+ end
667
+
631
668
  # Click at a specific location within a Section object
632
669
  #
633
670
  # @param x [Integer] X offset
@@ -637,10 +674,22 @@ module TestCentricity
637
674
  #
638
675
  def click_at(x, y)
639
676
  section, = find_section
640
- raise "Section object '#{get_name}' (#{get_locator}) not found" unless section
677
+ section_not_found_exception(section)
641
678
  section.click_at(x, y)
642
679
  end
643
680
 
681
+ # Send keystrokes to a Section object
682
+ #
683
+ # @param keys [String] keys
684
+ # @example
685
+ # bar_chart_section.send_keys(:enter)
686
+ #
687
+ def send_keys(*keys)
688
+ section, = find_section
689
+ section_not_found_exception(section)
690
+ section.send_keys(*keys)
691
+ end
692
+
644
693
  def verify_ui_states(ui_states)
645
694
  ui_states.each do |ui_object, object_states|
646
695
  object_states.each do |property, state|
@@ -845,13 +894,13 @@ module TestCentricity
845
894
 
846
895
  def get_attribute(attrib)
847
896
  section, = find_section
848
- raise "Section object '#{get_name}' (#{get_locator}) not found" unless section
897
+ section_not_found_exception(section)
849
898
  section[attrib]
850
899
  end
851
900
 
852
901
  def get_native_attribute(attrib)
853
902
  section, = find_section
854
- raise "Section object '#{get_name}' (#{get_locator}) not found" unless section
903
+ section_not_found_exception(section)
855
904
  section.native.attribute(attrib)
856
905
  end
857
906
 
@@ -865,5 +914,10 @@ module TestCentricity
865
914
  rescue
866
915
  [nil, nil]
867
916
  end
917
+
918
+ def section_not_found_exception(section)
919
+ raise ObjectNotFoundError.new("Section object '#{get_name}' (#{get_locator}) not found") unless section
920
+ end
921
+
868
922
  end
869
923
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.3.15.1'
2
+ VERSION = '2.3.16'
3
3
  end
@@ -480,7 +480,7 @@ module TestCentricity
480
480
  def object_not_found_exception(obj, obj_type)
481
481
  @alt_locator.nil? ? locator = @locator : locator = @alt_locator
482
482
  obj_type.nil? ? object_type = 'Object' : object_type = obj_type
483
- raise ObjectNotFoundError("#{object_type} named '#{@name}' (#{locator}) not found") unless obj
483
+ raise ObjectNotFoundError.new("#{object_type} named '#{@name}' (#{locator}) not found") unless obj
484
484
  end
485
485
 
486
486
  def invalid_object_type_exception(obj, obj_type)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.15.1
4
+ version: 2.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler