testcentricity 3.0.4 → 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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +48 -46
  4. data/lib/testcentricity/app_core/appium_connect_helper.rb +6 -8
  5. data/lib/testcentricity/app_core/screen_section.rb +0 -1
  6. data/lib/testcentricity/app_elements/app_element_helper.rb +14 -4
  7. data/lib/testcentricity/version.rb +1 -1
  8. metadata +13 -158
  9. data/.gitignore +0 -40
  10. data/.rspec +0 -4
  11. data/.rubocop.yml +0 -38
  12. data/.ruby-version +0 -1
  13. data/.simplecov +0 -9
  14. data/CODE_OF_CONDUCT.md +0 -13
  15. data/Gemfile +0 -6
  16. data/Rakefile +0 -63
  17. data/config/cucumber.yml +0 -146
  18. data/config/locales/en-US.yml +0 -56
  19. data/config/test_data/data.yml +0 -76
  20. data/features/deep_links.feature +0 -38
  21. data/features/login.feature +0 -30
  22. data/features/navigation.feature +0 -43
  23. data/features/step_definitions/generic_steps.rb +0 -67
  24. data/features/support/android/screens/about_screen.rb +0 -11
  25. data/features/support/android/screens/base_app_screen.rb +0 -31
  26. data/features/support/android/screens/biometrics_screen.rb +0 -17
  27. data/features/support/android/screens/checkout_address_screen.rb +0 -17
  28. data/features/support/android/screens/checkout_payment_screen.rb +0 -22
  29. data/features/support/android/screens/geo_location_screen.rb +0 -28
  30. data/features/support/android/screens/login_screen.rb +0 -18
  31. data/features/support/android/screens/product_item_screen.rb +0 -39
  32. data/features/support/android/screens/products_screen.rb +0 -27
  33. data/features/support/android/screens/qr_code_scanner_screen.rb +0 -15
  34. data/features/support/android/screens/saucebot_screen.rb +0 -16
  35. data/features/support/android/screens/webview_screen.rb +0 -13
  36. data/features/support/android/sections/list_items/product_list_item.rb +0 -13
  37. data/features/support/android/sections/nav_widgets/nav_menu.rb +0 -39
  38. data/features/support/data/product_data.rb +0 -27
  39. data/features/support/data/user_data.rb +0 -17
  40. data/features/support/env.rb +0 -62
  41. data/features/support/hooks.rb +0 -135
  42. data/features/support/ios/screens/about_screen.rb +0 -11
  43. data/features/support/ios/screens/base_app_screen.rb +0 -20
  44. data/features/support/ios/screens/biometrics_screen.rb +0 -17
  45. data/features/support/ios/screens/checkout_address_screen.rb +0 -17
  46. data/features/support/ios/screens/checkout_payment_screen.rb +0 -22
  47. data/features/support/ios/screens/geo_location_screen.rb +0 -32
  48. data/features/support/ios/screens/login_screen.rb +0 -18
  49. data/features/support/ios/screens/product_item_screen.rb +0 -39
  50. data/features/support/ios/screens/products_screen.rb +0 -27
  51. data/features/support/ios/screens/qr_code_scanner_screen.rb +0 -11
  52. data/features/support/ios/screens/saucebot_screen.rb +0 -16
  53. data/features/support/ios/screens/webview_screen.rb +0 -13
  54. data/features/support/ios/sections/list_items/product_list_item.rb +0 -13
  55. data/features/support/ios/sections/nav_widgets/nav_bar.rb +0 -31
  56. data/features/support/ios/sections/nav_widgets/nav_menu.rb +0 -41
  57. data/features/support/shared_components/screens/base_app_screen.rb +0 -35
  58. data/features/support/shared_components/screens/checkout_address_screen.rb +0 -17
  59. data/features/support/shared_components/screens/checkout_payment_screen.rb +0 -22
  60. data/features/support/shared_components/screens/login_screen.rb +0 -39
  61. data/features/support/shared_components/screens/saucebot_screen.rb +0 -17
  62. data/features/support/shared_components/screens/webview_screen.rb +0 -12
  63. data/features/support/shared_components/sections/nav_menu.rb +0 -58
  64. data/features/support/world_data.rb +0 -15
  65. data/features/support/world_pages.rb +0 -30
  66. data/reports/.keep +0 -1
  67. data/spec/fixtures/page_object.rb +0 -22
  68. data/spec/fixtures/page_section_object.rb +0 -21
  69. data/spec/fixtures/screen_object.rb +0 -16
  70. data/spec/fixtures/screen_section_object.rb +0 -16
  71. data/spec/spec_helper.rb +0 -33
  72. data/spec/testcentricity/elements/button_spec.rb +0 -18
  73. data/spec/testcentricity/elements/checkbox_spec.rb +0 -28
  74. data/spec/testcentricity/elements/image_spec.rb +0 -13
  75. data/spec/testcentricity/elements/label_spec.rb +0 -18
  76. data/spec/testcentricity/elements/list_spec.rb +0 -13
  77. data/spec/testcentricity/elements/ui_element_spec.rb +0 -72
  78. data/spec/testcentricity/mobile/appium_connect_spec.rb +0 -117
  79. data/spec/testcentricity/mobile/screen_object_spec.rb +0 -63
  80. data/spec/testcentricity/mobile/screen_section_object_spec.rb +0 -56
  81. data/spec/testcentricity/version_spec.rb +0 -7
  82. data/spec/testcentricity/web/browser_spec.rb +0 -41
  83. data/spec/testcentricity/web/local_webdriver_spec.rb +0 -86
  84. data/spec/testcentricity/web/mobile_webdriver_spec.rb +0 -123
  85. data/spec/testcentricity/web/page_object_spec.rb +0 -85
  86. data/spec/testcentricity/web/page_section_object_spec.rb +0 -72
  87. data/testcentricity.gemspec +0 -48
@@ -1,39 +0,0 @@
1
- class ProductItemScreen < BaseAppScreen
2
- trait(:page_name) { 'Product Item' }
3
- trait(:page_locator) { { accessibility_id: 'product screen' } }
4
- trait(:page_url) { "product-details/#{ProductData.current.id.to_s}" }
5
-
6
- # Product Item screen UI elements
7
- labels price_value: { accessibility_id: 'product price' },
8
- description_value: { accessibility_id: 'product description' },
9
- quantity_value: { accessibility_id: 'counter amount' },
10
- highlights_label: { accessibility_id: 'Product Highlights' }
11
- image :product_image, { xpath: '//XCUIElementTypeImage' }
12
- buttons add_to_cart_button: { accessibility_id: 'Add To Cart button' },
13
- minus_qty_button: { accessibility_id: 'counter minus button' },
14
- plus_qty_button: { accessibility_id: 'counter plus button' },
15
- black_color_button: { accessibility_id: 'black circle' },
16
- blue_color_button: { accessibility_id: 'blue circle' },
17
- gray_color_button: { accessibility_id: 'gray circle' },
18
- red_color_button: { accessibility_id: 'red circle' }
19
-
20
- def verify_page_ui
21
- super
22
- ui = {
23
- header_label => { visible: true, caption: ProductData.current.name },
24
- price_value => { visible: true, caption: ProductData.current.price },
25
- highlights_label => { visible: true, caption: 'Product Highlights' },
26
- description_value => { visible: true, caption: ProductData.current.description },
27
- product_image => { visible: true, enabled: true },
28
- black_color_button => { visible: ProductData.current.colors.include?('BLACK') },
29
- blue_color_button => { visible: ProductData.current.colors.include?('BLUE') },
30
- gray_color_button => { visible: ProductData.current.colors.include?('GRAY') },
31
- red_color_button => { visible: ProductData.current.colors.include?('RED') },
32
- minus_qty_button => { visible: true, enabled: true },
33
- quantity_value => { visible: true, enabled: true, caption: '1' },
34
- plus_qty_button => { visible: true, enabled: true },
35
- add_to_cart_button => { visible: true, enabled: true, caption: 'Add To Cart' }
36
- }
37
- verify_ui_states(ui)
38
- end
39
- end
@@ -1,27 +0,0 @@
1
- class ProductsScreen < BaseAppScreen
2
- trait(:page_name) { 'Products' }
3
- trait(:page_locator) { { accessibility_id: 'products screen' } }
4
- trait(:page_url) { 'store-overview' }
5
-
6
- # Products screen UI elements
7
- list :product_list, { xpath: '//XCUIElementTypeScrollView/XCUIElementTypeOther[1]' }
8
- section :product_list_item, ProductListItem
9
-
10
- def initialize
11
- super
12
- # define the list item element for the Product list object
13
- list_elements = { list_item: { xpath: '//XCUIElementTypeOther[@name="store item"]' } }
14
- product_list.define_list_elements(list_elements)
15
- # associate the Product List Item indexed section object with the Product list object
16
- product_list_item.set_list_index(product_list)
17
- end
18
-
19
- def verify_page_ui
20
- super
21
- ui = {
22
- header_label => { visible: true, caption: 'Products' },
23
- # product_list => { visible: true, itemcount: 6 }
24
- }
25
- verify_ui_states(ui)
26
- end
27
- end
@@ -1,11 +0,0 @@
1
- class QRCodeScannerScreen < BaseAppScreen
2
- trait(:page_name) { 'QR Code Scanner' }
3
- trait(:page_locator) { { accessibility_id: 'qr code screen' } }
4
- trait(:page_url) { 'qr-code-scanner' }
5
- trait(:navigator) { nav_menu.open_qr_code_scanner }
6
-
7
- def verify_page_ui
8
- super
9
- verify_ui_states(header_label => { visible: true, caption: 'QR Code Scanner' })
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- class SauceBotScreen < BaseAppScreen
2
- include SharedSauceBotScreen
3
-
4
- trait(:page_name) { 'SauceBot Video' }
5
- trait(:page_locator) { { accessibility_id: 'SauceBot screen' } }
6
- trait(:navigator) { nav_menu.open_saucebot_video }
7
-
8
- # SauceBot Video screen UI elements
9
- element :video_player, { accessibility_id: 'YouTube Video Player' }
10
- buttons video_back: { accessibility_id: 'video icon backward' },
11
- video_play: { accessibility_id: 'video icon play' },
12
- video_pause: { accessibility_id: 'video icon stop' },
13
- video_forward: { accessibility_id: 'video icon forward' },
14
- video_volume: { accessibility_id: 'video icon volume-up' },
15
- video_mute: { accessibility_id: 'video icon volume-mute' }
16
- end
@@ -1,13 +0,0 @@
1
- class WebViewScreen < BaseAppScreen
2
- include SharedWebViewScreen
3
-
4
- trait(:page_name) { 'Webview' }
5
- trait(:page_locator) { { accessibility_id: 'webview selection screen' } }
6
- trait(:page_url) { 'webview' }
7
- trait(:navigator) { nav_menu.open_webview }
8
-
9
- # Webview screen UI elements
10
- label :url_label, { accessibility_id: 'URL' }
11
- textfield :url_field, { accessibility_id: 'URL input field' }
12
- button :go_to_site_button, { accessibility_id: 'Go To Site button' }
13
- end
@@ -1,13 +0,0 @@
1
- class ProductListItem < TestCentricity::ScreenSection
2
- trait(:section_name) { 'Product List Item' }
3
- trait(:section_locator) { { xpath: '//XCUIElementTypeOther[@name="store item"]' } }
4
-
5
- # Product Cell Item UI elements
6
- labels product_name: { xpath: '//XCUIElementTypeStaticText[@name="store item text"]' },
7
- product_price: { xpath: '//XCUIElementTypeStaticText[@name="store item price"]' }
8
- buttons review_star_1: { xpath: '//XCUIElementTypeOther[@name="review star 1"]' },
9
- review_star_2: { xpath: '//XCUIElementTypeOther[@name="review star 2"]' },
10
- review_star_3: { xpath: '//XCUIElementTypeOther[@name="review star 3"]' },
11
- review_star_4: { xpath: '//XCUIElementTypeOther[@name="review star 4"]' },
12
- review_star_5: { xpath: '//XCUIElementTypeOther[@name="review star 5"]' }
13
- end
@@ -1,31 +0,0 @@
1
- class NavBar < TestCentricity::ScreenSection
2
- trait(:section_name) { 'Nav Bar' }
3
- trait(:section_locator) { { xpath: '(//XCUIElementTypeOther[@name="Catalog, tab, 1 of 3 0 Menu, tab, 3 of 3"])[1]' } }
4
-
5
- # Nav Bar UI elements
6
- buttons catalog_tab: { accessibility_id: 'tab bar option catalog' },
7
- cart_tab: { accessibility_id: 'tab bar option cart' },
8
- menu_tab: { accessibility_id: 'tab bar option menu' }
9
- label :cart_quantity, {}
10
-
11
- def verify_ui
12
- ui = {
13
- catalog_tab => { visible: true, enabled: true, caption: 'Catalog, tab, 1 of 3' },
14
- cart_tab => { visible: true, enabled: true },
15
- menu_tab => { visible: true, enabled: true, caption: 'Menu, tab, 3 of 3' }
16
- }
17
- verify_ui_states(ui)
18
- end
19
-
20
- def open_catalog
21
- catalog_tab.click
22
- end
23
-
24
- def open_cart
25
- cart_tab.click
26
- end
27
-
28
- def open_menu
29
- menu_tab.click
30
- end
31
- end
@@ -1,41 +0,0 @@
1
- class NavMenu < TestCentricity::ScreenSection
2
- include SharedNavMenu
3
-
4
- trait(:section_name) { 'Nav Menu' }
5
- trait(:section_locator) { { xpath: '//XCUIElementTypeScrollView' } }
6
-
7
- # Nav Menu UI elements
8
- buttons close_button: { accessibility_id: 'close menu' },
9
- webview_button: { accessibility_id: 'menu item webview' },
10
- qr_code_button: { accessibility_id: 'menu item qr code scanner' },
11
- geo_location_button: { accessibility_id: 'menu item geo location' },
12
- drawing_button: { accessibility_id: 'menu item drawing' },
13
- report_a_bug_button: { accessibility_id: 'menu item report a bug' },
14
- about_button: { accessibility_id: 'menu item about' },
15
- reset_app_button: { accessibility_id: 'menu item reset app' },
16
- biometrics_button: { accessibility_id: 'menu item biometrics' },
17
- log_in_button: { accessibility_id: 'menu item log in' },
18
- log_out_button: { accessibility_id: 'menu item log out' },
19
- api_calls_button: { accessibility_id: 'menu item api calls' },
20
- sauce_video_button: { accessibility_id: 'menu item sauce bot video' }
21
-
22
- def verify_ui
23
- ui = {
24
- self => { visible: true },
25
- close_button => { visible: true, enabled: true },
26
- webview_button => { visible: true, enabled: true, caption: 'Webview' },
27
- qr_code_button => { visible: true, enabled: true, caption: 'QR Code Scanner' },
28
- geo_location_button => { visible: true, enabled: true, caption: 'Geo Location' },
29
- drawing_button => { visible: true, enabled: true, caption: 'Drawing' },
30
- report_a_bug_button => { visible: true, enabled: true, caption: 'Report A Bug' },
31
- about_button => { visible: true, enabled: true, caption: 'About' },
32
- reset_app_button => { visible: true, enabled: true, caption: 'Reset App State' },
33
- biometrics_button => { visible: true, enabled: true, caption: 'FaceID' },
34
- log_in_button => { visible: true, enabled: true, caption: 'Log In' },
35
- log_out_button => { visible: true, enabled: true, caption: 'Log Out' },
36
- api_calls_button => { visible: true, enabled: true, caption: 'Api Calls' },
37
- sauce_video_button => { visible: true, enabled: true, caption: 'Sauce Bot Video' }
38
- }
39
- verify_ui_states(ui)
40
- end
41
- end
@@ -1,35 +0,0 @@
1
- module SharedBaseAppScreen
2
- include WorldData
3
- include WorldPages
4
-
5
- def nav_menu_action(action)
6
- case action.downcase.to_sym
7
- when :open
8
- invoke_nav_menu
9
- when :close
10
- nav_menu.close if nav_menu.visible?
11
- else
12
- raise "#{action} is not a valid selector"
13
- end
14
- end
15
-
16
- def navigate_to
17
- invoke_nav_menu
18
- navigator
19
- end
20
-
21
- def verify_nav_menu(state)
22
- case state.downcase.to_sym
23
- when :closed
24
- nav_menu.verify_closed
25
- when :displayed
26
- nav_menu.verify_ui
27
- else
28
- raise "#{action} is not a valid selector"
29
- end
30
- end
31
-
32
- def modal_action(action)
33
- alert_modal.await_and_respond(action.downcase.to_sym, timeout = 1)
34
- end
35
- end
@@ -1,17 +0,0 @@
1
- module SharedCheckoutAddressScreen
2
- def verify_page_ui
3
- super
4
- ui = {
5
- header_label => { visible: true, caption: 'Checkout' },
6
- fullname_field => { visible: true, enabled: true, placeholder: 'Rebecca Winter' },
7
- address1_field => { visible: true, enabled: true, placeholder: 'Mandorley 112' },
8
- address2_field => { visible: true, enabled: true, placeholder: 'Entrance 1' },
9
- city_field => { visible: true, enabled: true, placeholder: 'Truro' },
10
- state_region_field => { visible: true, enabled: true, placeholder: 'Cornwall' },
11
- zip_code_field => { visible: true, enabled: true, placeholder: '89750' },
12
- country_field => { visible: true, enabled: true, placeholder: 'United Kingdom' },
13
- to_payment_button => { visible: true, enabled: true, caption: 'To Payment' }
14
- }
15
- verify_ui_states(ui)
16
- end
17
- end
@@ -1,22 +0,0 @@
1
- module SharedCheckoutPaymentScreen
2
- def verify_page_ui
3
- super
4
- ui = {
5
- header_label => { visible: true, caption: 'Checkout' },
6
- payee_name_field => { visible: true, enabled: true, placeholder: 'Rebecca Winter' },
7
- card_number_field => { visible: true, enabled: true, placeholder: '3258 1265 7568 789' },
8
- expiration_field => { visible: true, enabled: true, placeholder: '03/25' },
9
- security_code_field => { visible: true, enabled: true, placeholder: '123' },
10
- bill_address_check => { visible: true, enabled: true },
11
- recipient_name_field => { visible: false },
12
- address1_field => { visible: false },
13
- address2_field => { visible: false },
14
- city_field => { visible: false },
15
- state_region_field => { visible: false },
16
- zip_code_field => { visible: false },
17
- country_field => { visible: false },
18
- review_order_button => { visible: true, enabled: true, caption: 'Review Order' }
19
- }
20
- verify_ui_states(ui)
21
- end
22
- end
@@ -1,39 +0,0 @@
1
- module SharedLoginScreen
2
- def verify_page_ui
3
- super
4
- ui = {
5
- header_label => { visible: true, caption: 'Login' },
6
- username_label => { visible: true, caption: 'Username' },
7
- username_field => { visible: true, enabled: true },
8
- password_label => { visible: true, caption: 'Password' },
9
- password_field => { visible: true, enabled: true },
10
- login_button => { visible: true, enabled: true, caption: 'Login' }
11
- }
12
- verify_ui_states(ui)
13
- end
14
-
15
- def login(username, password)
16
- fields = {
17
- username_field => username,
18
- password_field => password
19
- }
20
- populate_data_fields(fields)
21
- login_button.tap
22
- end
23
-
24
- def verify_entry_error(reason)
25
- ui = case reason.gsub(/\s+/, '_').downcase.to_sym
26
- when :invalid_password, :invalid_user
27
- { generic_error => { visible: true, caption: 'Provided credentials do not match any user in this service.' } }
28
- when :locked_account
29
- { generic_error => { visible: true, caption: 'Sorry, this user has been locked out.' } }
30
- when :no_username
31
- { username_error => { visible: true, caption: 'Username is required' } }
32
- when :no_password
33
- { password_error => { visible: true, caption: 'Password is required' } }
34
- else
35
- raise "#{reason} is not a valid selector"
36
- end
37
- verify_ui_states(ui)
38
- end
39
- end
@@ -1,17 +0,0 @@
1
- module SharedSauceBotScreen
2
- def verify_page_ui
3
- super
4
- video_player.wait_until_visible(10)
5
- ui = {
6
- header_label => { visible: true, caption: 'SauceBot - The Beginning' },
7
- video_player => { visible: true, enabled: true },
8
- video_back => { visible: true, enabled: true },
9
- video_pause => { visible: true, enabled: true },
10
- video_play => { visible: false },
11
- video_forward => { visible: true, enabled: true },
12
- video_volume => { visible: true, enabled: true },
13
- video_mute => { visible: false }
14
- }
15
- verify_ui_states(ui)
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- module SharedWebViewScreen
2
- def verify_page_ui
3
- super
4
- ui = {
5
- header_label => { visible: true, caption: 'Webview' },
6
- url_label => { visible: true, caption: 'URL' },
7
- url_field => { visible: true, enabled: true, placeholder: 'https://www.website.com' },
8
- go_to_site_button => { visible: true, enabled: true, caption: 'Go To Site' }
9
- }
10
- verify_ui_states(ui)
11
- end
12
- end
@@ -1,58 +0,0 @@
1
- module SharedNavMenu
2
- def close
3
- close_button.click
4
- self.wait_until_hidden(3)
5
- end
6
-
7
- def verify_closed
8
- verify_ui_states(close_button => { visible: false })
9
- end
10
-
11
- def open_webview
12
- webview_button.click
13
- end
14
-
15
- def open_qr_code_scanner
16
- qr_code_button.click
17
- end
18
-
19
- def open_geo_location
20
- geo_location_button.click
21
- end
22
-
23
- def open_drawing
24
- drawing_button.click
25
- end
26
-
27
- def open_report_a_bug
28
- report_a_bug_button.click
29
- end
30
-
31
- def open_about
32
- about_button.click
33
- end
34
-
35
- def open_reset_app
36
- reset_app_button.click
37
- end
38
-
39
- def open_biometrics
40
- biometrics_button.click
41
- end
42
-
43
- def open_log_in
44
- log_in_button.click
45
- end
46
-
47
- def open_log_out
48
- log_out_button.click
49
- end
50
-
51
- def open_api_calls
52
- api_calls_button.click
53
- end
54
-
55
- def open_saucebot_video
56
- sauce_video_button.click
57
- end
58
- end
@@ -1,15 +0,0 @@
1
- module WorldData
2
- #
3
- # data_objects method returns a hash table of your web app's data objects and associated data object classes to be instantiated
4
- # by the TestCentricity™ DataManager. Data Object class definitions are contained in the features/support/data folder.
5
- #
6
- def data_objects
7
- {
8
- user_data_source: UserDataSource,
9
- product_data_source: ProductDataSource
10
- }
11
- end
12
- end
13
-
14
-
15
- World(WorldData)
@@ -1,30 +0,0 @@
1
- module WorldPages
2
-
3
- #
4
- # The page_objects method returns a hash table of your web or native mobile app's page objects and associated page
5
- # classes to be instantiated by the TestCentricity PageManager.
6
- #
7
- # Web Page Object class definitions are contained in the features/support/web/pages folder.
8
- # iOS Screen Object class definitions are contained in the features/support/ios/screens folder.
9
- # Android Screen Object class definitions are contained in the features/support/android/screens folder.
10
- #
11
- def page_objects
12
- {
13
- base_app_screen: BaseAppScreen,
14
- about_screen: AboutScreen,
15
- login_screen: LoginScreen,
16
- webview_screen: WebViewScreen,
17
- products_screen: ProductsScreen,
18
- product_item_screen: ProductItemScreen,
19
- checkout_address_screen: CheckoutAddressScreen,
20
- checkout_payment_screen: CheckoutPaymentScreen,
21
- qr_code_scanner_screen: QRCodeScannerScreen,
22
- geo_location_screen: GeoLocationScreen,
23
- biometrics_screen: BiometricsScreen,
24
- saucebot_video_screen: SauceBotScreen
25
- }
26
- end
27
- end
28
-
29
-
30
- World(WorldPages)
data/reports/.keep DELETED
@@ -1 +0,0 @@
1
- Placeholder file to allow the reports folder to be saved to repository. This folder is required for Jenkins test jobs using the Cucumber Reporting plug-in.
@@ -1,22 +0,0 @@
1
- class TestPage < TestCentricity::PageObject
2
- trait(:page_name) { 'Basic Test Page' }
3
- trait(:page_url) { '/basic_test_page.html' }
4
- trait(:page_locator) { 'form#HTMLFormElements' }
5
-
6
- elements element1: 'div#element1'
7
- buttons button1: 'button#button1'
8
- textfields field1: 'input#field1'
9
- links link1: 'a#link1'
10
- ranges range1: 'input#range1'
11
- images image1: 'img#image1'
12
- radios radio1: 'input#radio1'
13
- checkboxes check1: 'input#check1'
14
- filefields file1: 'input#file1'
15
- labels label1: 'label#label1'
16
- tables table1: 'table#table1'
17
- selectlists select1: 'select#select1'
18
- lists list1: 'ul#list1'
19
- videos video1: 'video#video1'
20
- audios audio1: 'audio#audio1'
21
- sections section1: TestPageSection
22
- end
@@ -1,21 +0,0 @@
1
- class TestPageSection < TestCentricity::PageSection
2
- trait(:section_locator) { 'div#section' }
3
- trait(:section_name) { 'Basic Test Section' }
4
-
5
- elements element1: 'div#element1'
6
- buttons button1: 'button#button1'
7
- textfields field1: 'input#field1'
8
- links link1: 'a#link1'
9
- ranges range1: 'input#range1'
10
- images image1: 'img#image1'
11
- radios radio1: 'input#radio1'
12
- checkboxes check1: 'input#check1'
13
- filefields file1: 'input#file1'
14
- labels label1: 'label#label1'
15
- tables table1: 'table#table1'
16
- selectlists select1: 'select#select1'
17
- lists list1: 'ul#list1'
18
- videos video1: 'video#video1'
19
- audios audio1: 'audio#audio1'
20
- sections section2: TestPageSection
21
- end
@@ -1,16 +0,0 @@
1
- class TestScreen < TestCentricity::ScreenObject
2
- trait(:page_name) { 'Basic Test Screen' }
3
- trait(:page_locator) { { accessibility_id: 'test screen' } }
4
-
5
- elements element1: { accessibility_id: 'element 1' }
6
- buttons button1: { accessibility_id: 'button 1' }
7
- textfields field1: { accessibility_id: 'text input 1' }
8
- checkboxes check1: { accessibility_id: 'checkbox 1' }
9
- labels label1: { accessibility_id: 'label 1' }
10
- images image1: { accessibility_id: 'image 1' }
11
- switches switch1: { accessibility_id: 'switch 1' }
12
- lists list1: { accessibility_id: 'list 1' }
13
- selectlists selectlist1: { accessibility_id: 'selectlist 1' }
14
- alerts alert1: { accessibility_id: 'alert 1' }
15
- sections section1: TestScreenSection
16
- end
@@ -1,16 +0,0 @@
1
- class TestScreenSection < TestCentricity::ScreenSection
2
- trait(:section_locator) { { accessibility_id: 'test section' } }
3
- trait(:section_name) { 'Basic Test Section' }
4
-
5
- elements element1: { accessibility_id: 'element 1' }
6
- buttons button1: { accessibility_id: 'button 1' }
7
- textfields field1: { accessibility_id: 'text input 1' }
8
- checkboxes check1: { accessibility_id: 'checkbox 1' }
9
- labels label1: { accessibility_id: 'label 1' }
10
- images image1: { accessibility_id: 'image 1' }
11
- switches switch1: { accessibility_id: 'switch 1' }
12
- lists list1: { accessibility_id: 'list 1' }
13
- selectlists selectlist1: { accessibility_id: 'selectlist 1' }
14
- alert :alert1, { accessibility_id: 'alert 1' }
15
- sections section2: TestScreenSection
16
- end
data/spec/spec_helper.rb DELETED
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'capybara/rspec'
4
- require 'require_all'
5
- require 'simplecov'
6
- require 'testcentricity'
7
- require 'testcentricity_web'
8
-
9
- require_rel 'fixtures'
10
-
11
- include TestCentricity
12
-
13
- SimpleCov.command_name("RSpec-#{Time.now.strftime('%Y%m%d%H%M%S')}")
14
-
15
- $LOAD_PATH << './lib'
16
-
17
- # set the default locale and auto load all translations from config/locales/*.rb,yml.
18
- ENV['LOCALE'] = 'en-US' unless ENV['LOCALE']
19
- I18n.load_path += Dir['config/locales/*.{rb,yml}']
20
- I18n.default_locale = 'en-US'
21
- I18n.locale = ENV['LOCALE']
22
- Faker::Config.locale = ENV['LOCALE']
23
-
24
- # prevent Test::Unit's AutoRunner from executing during RSpec's rake task
25
- Test::Unit.run = true if defined?(Test::Unit) && Test::Unit.respond_to?(:run=)
26
-
27
- RSpec.configure do |config|
28
- config.mock_with :rspec do |mocks|
29
- mocks.allow_message_expectations_on_nil = true
30
- mocks.verify_doubled_constant_names = true
31
- mocks.verify_partial_doubles = true
32
- end
33
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe TestCentricity::AppButton, required: true do
4
- subject(:test_button) { described_class.new(:test_button, self, { accessibility_id: 'button 1' }, :page) }
5
-
6
- it 'returns class' do
7
- expect(test_button.class).to eql TestCentricity::AppButton
8
- end
9
-
10
- it 'registers with type button' do
11
- expect(test_button.get_object_type).to eql :button
12
- end
13
-
14
- it 'should click the button' do
15
- expect(test_button).to receive(:click)
16
- test_button.click
17
- end
18
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe TestCentricity::AppCheckBox, required: true do
4
- subject(:test_check) { described_class.new(:test_check, self, { accessibility_id: 'check 1' }, :page) }
5
-
6
- it 'returns class' do
7
- expect(test_check.class).to eql TestCentricity::AppCheckBox
8
- end
9
-
10
- it 'registers with type checkbox' do
11
- expect(test_check.get_object_type).to eql :checkbox
12
- end
13
-
14
- it 'should check the checkbox' do
15
- expect(test_check).to receive(:check)
16
- test_check.check
17
- end
18
-
19
- it 'should uncheck the checkbox' do
20
- expect(test_check).to receive(:uncheck)
21
- test_check.uncheck
22
- end
23
-
24
- it 'should know if checkbox is checked' do
25
- allow(test_check).to receive(:checked?).and_return(true)
26
- expect(test_check.checked?).to eq(true)
27
- end
28
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe TestCentricity::AppImage, required: true do
4
- subject(:test_image) { described_class.new(:test_image, self, { accessibility_id: 'image 1' }, :page) }
5
-
6
- it 'returns class' do
7
- expect(test_image.class).to eql TestCentricity::AppImage
8
- end
9
-
10
- it 'registers with type image' do
11
- expect(test_image.get_object_type).to eql :image
12
- end
13
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe TestCentricity::AppLabel, required: true do
4
- subject(:test_label) { described_class.new(:test_label, self, { accessibility_id: 'label 1' }, :page) }
5
-
6
- it 'returns class' do
7
- expect(test_label.class).to eql TestCentricity::AppLabel
8
- end
9
-
10
- it 'registers with type label' do
11
- expect(test_label.get_object_type).to eql :label
12
- end
13
-
14
- it 'returns caption' do
15
- allow(test_label).to receive(:caption).and_return('caption')
16
- expect(test_label.caption).to eql 'caption'
17
- end
18
- end