testcentricity_web 3.0.20 → 3.1.0

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: e3b8fe8d95173d598c24d3537c293f21da627eb0
4
- data.tar.gz: 58de63e3525101ce846970603a55a89323d4d055
3
+ metadata.gz: b1f090325a684cd5d9944d021391a2919efabcc6
4
+ data.tar.gz: 961cc9979f42aec5554254812365bf81ad3cbbe5
5
5
  SHA512:
6
- metadata.gz: 2051e9f2f1c2b0abafa66cac87a325cf4f2c426e4a167028d8cba15cd2098e9a2c0f7f11e17340e5169772e04a1773a8129c72b961999f8b37aa6d89d5fe600e
7
- data.tar.gz: ccea7de027af0c5655a536d22395ef4987954b202995d66aea1c0a638bde1db9a5d0ca4bb9b4f611acfde8509cd29ddba6ea96183e21f2c8150b43fdb4bccdd2
6
+ metadata.gz: 6cad0f6ae2b183661acc9cf1769fb649dfe61db3a30dd1323a1434b2d9973fae183c69423ebc235aa31efb3545aaee76d5e9a90ce6f3e030e63be865fec43944
7
+ data.tar.gz: 02d5753fe6b347e868144d3e1cee790ad8c0ddbc90075a773d5cfa367f0a8d5a2dbf80f2f9b7f74c8a8e4c126a44e232a114d292fad815b69efd8f4da160eb88
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [3.1.0] - 2018-11-10
6
+
7
+ ### Added
8
+ * Adding greater support for WCAG 2.x accessibility testing and verification:
9
+ * `UIElement.role` method.
10
+ * `UIElement.tabindex` method.
11
+ * `UIElement.aria_labelledby` method.
12
+ * `UIElement.aria_describedby` method.
13
+ * `UIElement.aria_live` method.
14
+ * `UIElement.aria_selected?` method.
15
+ * `UIElement.aria_hidden?` method.
16
+ * `UIElement.aria_expanded?` method.
17
+ * `UIElement.aria_required?` method.
18
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `role`, `tabindex`, `aria-labelledby`,
19
+ `aria-describedby`, `aria-live`, `aria-selected`, `aria-hidden`, `aria-expanded`, and `aria-required` properties.
20
+
21
+
5
22
  ## [3.0.20] - 2018-11-08
6
23
 
7
24
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.0.20)
4
+ testcentricity_web (3.1.0)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
data/README.md CHANGED
@@ -494,9 +494,21 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
494
494
  element.y
495
495
  element.get_attribute(attrib)
496
496
  element.get_native_attribute(attrib)
497
+
498
+ **Object Accessibility methods:**
499
+
497
500
  element.aria_disabled?
498
501
  element.aria_label
499
-
502
+ element.role
503
+ element.tabindex
504
+ element.aria_labelledby
505
+ element.aria_describedby
506
+ element.aria_live
507
+ element.aria_selected?
508
+ element.aria_hidden?
509
+ element.aria_expanded?
510
+ element.aria_required?
511
+
500
512
  **Waiting methods:**
501
513
 
502
514
  element.wait_until_exists(seconds)
@@ -47,6 +47,8 @@ module TestCentricity
47
47
  attr_accessor :portal_context
48
48
  attr_accessor :external_page
49
49
 
50
+ attr_accessor :a11y_standard
51
+
50
52
  attr_accessor :protocol
51
53
  attr_accessor :hostname
52
54
  attr_accessor :base_url
@@ -60,17 +62,19 @@ module TestCentricity
60
62
  attr_accessor :db_password
61
63
 
62
64
  def initialize(data)
63
- @protocol = data['PROTOCOL']
64
- @hostname = data['HOST_NAME']
65
- @base_url = data['BASE_URL']
66
- @user_id = data['USER_ID']
67
- @password = data['PASSWORD']
68
- @append = data['APPEND']
69
- @option1 = data['OPTIONAL_1']
70
- @option2 = data['OPTIONAL_2']
71
- @dns = data['DNS']
72
- @db_username = data['DB_USERNAME']
73
- @db_password = data['DB_PASSWORD']
65
+ @protocol = data['PROTOCOL']
66
+ @hostname = data['HOST_NAME']
67
+ @base_url = data['BASE_URL']
68
+ @user_id = data['USER_ID']
69
+ @password = data['PASSWORD']
70
+ @append = data['APPEND']
71
+ @option1 = data['OPTIONAL_1']
72
+ @option2 = data['OPTIONAL_2']
73
+ @dns = data['DNS']
74
+ @db_username = data['DB_USERNAME']
75
+ @db_password = data['DB_PASSWORD']
76
+ @a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
77
+
74
78
  super
75
79
  end
76
80
 
@@ -290,6 +294,7 @@ module TestCentricity
290
294
  report_header = "#{report_header} <b>Locale:</b>\t\t #{ENV['LOCALE']}\n" if ENV['LOCALE']
291
295
  report_header = "#{report_header} <b>Language:</b>\t #{ENV['LANGUAGE']}\n" if ENV['LANGUAGE']
292
296
  report_header = "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
297
+ report_header = "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
293
298
  "#{report_header}\n\n"
294
299
  end
295
300
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.0.20'
2
+ VERSION = '3.1.0'
3
3
  end
@@ -664,10 +664,28 @@ module TestCentricity
664
664
  actual = ui_object.get_siebel_options
665
665
  when :style
666
666
  actual = ui_object.style
667
+ when :role
668
+ actual = ui_object.role
667
669
  when :aria_label
668
670
  actual = ui_object.aria_label
669
671
  when :aria_disabled
670
672
  actual = ui_object.aria_disabled?
673
+ when :tabindex
674
+ actual = ui_object.tabindex
675
+ when :aria_labelledby
676
+ actual = ui_object.aria_labelledby
677
+ when :aria_describedby
678
+ actual = ui_object.aria_describedby
679
+ when :aria_live
680
+ actual = ui_object.aria_live
681
+ when :aria_selected
682
+ actual = ui_object.aria_selected?
683
+ when :aria_hidden
684
+ actual = ui_object.aria_hidden?
685
+ when :aria_expanded
686
+ actual = ui_object.aria_expanded?
687
+ when :aria_required
688
+ actual = ui_object.aria_required?
671
689
  else
672
690
  if property.is_a?(Hash)
673
691
  property.each do |key, value|
@@ -864,10 +864,28 @@ module TestCentricity
864
864
  actual = ui_object.get_siebel_options
865
865
  when :style
866
866
  actual = ui_object.style
867
+ when :role
868
+ actual = ui_object.role
867
869
  when :aria_label
868
870
  actual = ui_object.aria_label
869
871
  when :aria_disabled
870
872
  actual = ui_object.aria_disabled?
873
+ when :tabindex
874
+ actual = ui_object.tabindex
875
+ when :aria_labelledby
876
+ actual = ui_object.aria_labelledby
877
+ when :aria_describedby
878
+ actual = ui_object.aria_describedby
879
+ when :aria_live
880
+ actual = ui_object.aria_live
881
+ when :aria_selected
882
+ actual = ui_object.aria_selected?
883
+ when :aria_hidden
884
+ actual = ui_object.aria_hidden?
885
+ when :aria_expanded
886
+ actual = ui_object.aria_expanded?
887
+ when :aria_required
888
+ actual = ui_object.aria_required?
871
889
  else
872
890
  if property.is_a?(Hash)
873
891
  property.each do |key, value|
@@ -566,6 +566,26 @@ module TestCentricity
566
566
  get_attribute('style')
567
567
  end
568
568
 
569
+ # Return state of UI object's role property
570
+ #
571
+ # @return [String]
572
+ # @example
573
+ # buy_now_button.role
574
+ #
575
+ def role
576
+ get_attribute('role')
577
+ end
578
+
579
+ # Return state of UI object's tabindex property
580
+ #
581
+ # @return [String]
582
+ # @example
583
+ # buy_now_button.tabindex
584
+ #
585
+ def tabindex
586
+ get_attribute('tabindex')
587
+ end
588
+
569
589
  # Return state of UI object's aria-label property
570
590
  #
571
591
  # @return [String]
@@ -576,6 +596,36 @@ module TestCentricity
576
596
  get_attribute('aria-label')
577
597
  end
578
598
 
599
+ # Return state of UI object's aria-labelledby property
600
+ #
601
+ # @return [String]
602
+ # @example
603
+ # buy_now_button.aria_labelledby
604
+ #
605
+ def aria_labelledby
606
+ get_attribute('aria-labelledby')
607
+ end
608
+
609
+ # Return state of UI object's aria-describedby property
610
+ #
611
+ # @return [String]
612
+ # @example
613
+ # buy_now_button.aria_describedby
614
+ #
615
+ def aria_describedby
616
+ get_attribute('aria-describedby')
617
+ end
618
+
619
+ # Return state of UI object's aria-live property
620
+ #
621
+ # @return [String]
622
+ # @example
623
+ # properties_list.aria_live
624
+ #
625
+ def aria_live
626
+ get_attribute('aria-live')
627
+ end
628
+
579
629
  # Return state of UI object's aria-disabled property
580
630
  #
581
631
  # @return [Boolean]
@@ -587,6 +637,50 @@ module TestCentricity
587
637
  state.boolean? ? state : state == 'true'
588
638
  end
589
639
 
640
+ # Return state of UI object's aria-selected property
641
+ #
642
+ # @return [Boolean]
643
+ # @example
644
+ # nutrition_info_tab.aria_selected?
645
+ #
646
+ def aria_selected?
647
+ state = get_attribute('aria-selected')
648
+ state.boolean? ? state : state == 'true'
649
+ end
650
+
651
+ # Return state of UI object's aria-hidden property
652
+ #
653
+ # @return [Boolean]
654
+ # @example
655
+ # nutrition_info_tab.aria_hidden?
656
+ #
657
+ def aria_hidden?
658
+ state = get_attribute('aria-hidden')
659
+ state.boolean? ? state : state == 'true'
660
+ end
661
+
662
+ # Return state of UI object's aria-expanded property
663
+ #
664
+ # @return [Boolean]
665
+ # @example
666
+ # catalog_tree.aria_expanded?
667
+ #
668
+ def aria_expanded?
669
+ state = get_attribute('aria-expanded')
670
+ state.boolean? ? state : state == 'true'
671
+ end
672
+
673
+ # Return state of UI object's aria-required property
674
+ #
675
+ # @return [Boolean]
676
+ # @example
677
+ # home_phone_field.aria_required?
678
+ #
679
+ def aria_required?
680
+ state = get_attribute('aria-required')
681
+ state.boolean? ? state : state == 'true'
682
+ end
683
+
590
684
  def get_attribute(attrib)
591
685
  obj, type = find_element(false)
592
686
  object_not_found_exception(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: 3.0.20
4
+ version: 3.1.0
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-11-08 00:00:00.000000000 Z
11
+ date: 2018-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler