testcentricity 3.0.4 → 3.0.5

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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/testcentricity/app_core/appium_connect_helper.rb +1 -0
  4. data/lib/testcentricity/app_core/screen_section.rb +0 -1
  5. data/lib/testcentricity/app_elements/app_element_helper.rb +1 -1
  6. data/lib/testcentricity/version.rb +1 -1
  7. metadata +5 -150
  8. data/.gitignore +0 -40
  9. data/.rspec +0 -4
  10. data/.rubocop.yml +0 -38
  11. data/.ruby-version +0 -1
  12. data/.simplecov +0 -9
  13. data/CODE_OF_CONDUCT.md +0 -13
  14. data/Gemfile +0 -6
  15. data/Rakefile +0 -63
  16. data/config/cucumber.yml +0 -146
  17. data/config/locales/en-US.yml +0 -56
  18. data/config/test_data/data.yml +0 -76
  19. data/features/deep_links.feature +0 -38
  20. data/features/login.feature +0 -30
  21. data/features/navigation.feature +0 -43
  22. data/features/step_definitions/generic_steps.rb +0 -67
  23. data/features/support/android/screens/about_screen.rb +0 -11
  24. data/features/support/android/screens/base_app_screen.rb +0 -31
  25. data/features/support/android/screens/biometrics_screen.rb +0 -17
  26. data/features/support/android/screens/checkout_address_screen.rb +0 -17
  27. data/features/support/android/screens/checkout_payment_screen.rb +0 -22
  28. data/features/support/android/screens/geo_location_screen.rb +0 -28
  29. data/features/support/android/screens/login_screen.rb +0 -18
  30. data/features/support/android/screens/product_item_screen.rb +0 -39
  31. data/features/support/android/screens/products_screen.rb +0 -27
  32. data/features/support/android/screens/qr_code_scanner_screen.rb +0 -15
  33. data/features/support/android/screens/saucebot_screen.rb +0 -16
  34. data/features/support/android/screens/webview_screen.rb +0 -13
  35. data/features/support/android/sections/list_items/product_list_item.rb +0 -13
  36. data/features/support/android/sections/nav_widgets/nav_menu.rb +0 -39
  37. data/features/support/data/product_data.rb +0 -27
  38. data/features/support/data/user_data.rb +0 -17
  39. data/features/support/env.rb +0 -62
  40. data/features/support/hooks.rb +0 -135
  41. data/features/support/ios/screens/about_screen.rb +0 -11
  42. data/features/support/ios/screens/base_app_screen.rb +0 -20
  43. data/features/support/ios/screens/biometrics_screen.rb +0 -17
  44. data/features/support/ios/screens/checkout_address_screen.rb +0 -17
  45. data/features/support/ios/screens/checkout_payment_screen.rb +0 -22
  46. data/features/support/ios/screens/geo_location_screen.rb +0 -32
  47. data/features/support/ios/screens/login_screen.rb +0 -18
  48. data/features/support/ios/screens/product_item_screen.rb +0 -39
  49. data/features/support/ios/screens/products_screen.rb +0 -27
  50. data/features/support/ios/screens/qr_code_scanner_screen.rb +0 -11
  51. data/features/support/ios/screens/saucebot_screen.rb +0 -16
  52. data/features/support/ios/screens/webview_screen.rb +0 -13
  53. data/features/support/ios/sections/list_items/product_list_item.rb +0 -13
  54. data/features/support/ios/sections/nav_widgets/nav_bar.rb +0 -31
  55. data/features/support/ios/sections/nav_widgets/nav_menu.rb +0 -41
  56. data/features/support/shared_components/screens/base_app_screen.rb +0 -35
  57. data/features/support/shared_components/screens/checkout_address_screen.rb +0 -17
  58. data/features/support/shared_components/screens/checkout_payment_screen.rb +0 -22
  59. data/features/support/shared_components/screens/login_screen.rb +0 -39
  60. data/features/support/shared_components/screens/saucebot_screen.rb +0 -17
  61. data/features/support/shared_components/screens/webview_screen.rb +0 -12
  62. data/features/support/shared_components/sections/nav_menu.rb +0 -58
  63. data/features/support/world_data.rb +0 -15
  64. data/features/support/world_pages.rb +0 -30
  65. data/reports/.keep +0 -1
  66. data/spec/fixtures/page_object.rb +0 -22
  67. data/spec/fixtures/page_section_object.rb +0 -21
  68. data/spec/fixtures/screen_object.rb +0 -16
  69. data/spec/fixtures/screen_section_object.rb +0 -16
  70. data/spec/spec_helper.rb +0 -33
  71. data/spec/testcentricity/elements/button_spec.rb +0 -18
  72. data/spec/testcentricity/elements/checkbox_spec.rb +0 -28
  73. data/spec/testcentricity/elements/image_spec.rb +0 -13
  74. data/spec/testcentricity/elements/label_spec.rb +0 -18
  75. data/spec/testcentricity/elements/list_spec.rb +0 -13
  76. data/spec/testcentricity/elements/ui_element_spec.rb +0 -72
  77. data/spec/testcentricity/mobile/appium_connect_spec.rb +0 -117
  78. data/spec/testcentricity/mobile/screen_object_spec.rb +0 -63
  79. data/spec/testcentricity/mobile/screen_section_object_spec.rb +0 -56
  80. data/spec/testcentricity/version_spec.rb +0 -7
  81. data/spec/testcentricity/web/browser_spec.rb +0 -41
  82. data/spec/testcentricity/web/local_webdriver_spec.rb +0 -86
  83. data/spec/testcentricity/web/mobile_webdriver_spec.rb +0 -123
  84. data/spec/testcentricity/web/page_object_spec.rb +0 -85
  85. data/spec/testcentricity/web/page_section_object_spec.rb +0 -72
  86. data/testcentricity.gemspec +0 -48
@@ -1,76 +0,0 @@
1
- # This section is populated with Environment data required to execute automated test suites on all supported environments
2
- Environments:
3
- LOCAL:
4
- DEEP_LINK_PREFIX: 'mydemoapprn'
5
- IOS_BUNDLE_ID: 'com.saucelabs.mydemoapp.rn'
6
- ANDROID_APP_ID: 'com.saucelabs.mydemoapp.rn'
7
- IOS_APP_PATH: '/Users/Shared/Test_Apps/iOS/MyRNDemoApp.app'
8
- IOS_IPA_PATH: '/Users/Shared/Test_Apps/iOS/iOS-Real-Device-MyRNDemoApp.1.3.0-162.ipa'
9
- ANDROID_APK_PATH: '/Users/Shared/Test_Apps/Android/Android-MyDemoAppRN.1.2.0.build-231.apk'
10
-
11
- # This section is populated with user credential data required to test the Login screen features
12
- User_creds:
13
- valid_data:
14
- username: 'bob@example.com'
15
- password: '10203040'
16
- invalid_user:
17
- username: 'iggy.snicklefritz@example.com'
18
- password: '10203040'
19
- locked_account:
20
- username: 'alice@example.com'
21
- password: '10203040'
22
- no_username:
23
- password: '10203040'
24
- no_password:
25
- username: 'bob@example.com'
26
-
27
- # This section is populated with Product data required for testing the Shopping features
28
- Products:
29
- 1:
30
- id: 1
31
- name: 'Sauce Labs Backpack'
32
- description: 'carry.allTheThings() with the sleek, streamlined Sly Pack that melds uncompromising style with unequaled laptop and tablet protection.'
33
- price: '$29.99'
34
- review: 4
35
- colors: ['BLACK', 'BLUE', 'GRAY', 'RED']
36
- defaultColor: 'BLACK'
37
- 2:
38
- id: 2
39
- name: 'Sauce Labs Bike Light'
40
- description: "A red light isn't the desired state in testing but it sure helps when riding your bike at night. Water-resistant with 3 lighting modes, 1 AAA battery included."
41
- price: '$9.99'
42
- review: 4
43
- colors: ['BLACK']
44
- defaultColor: 'BLACK'
45
- 3:
46
- id: 3
47
- name: 'Sauce Labs Bolt T-Shirt'
48
- description: 'Get your testing superhero on with the Sauce Labs bolt T-shirt. From American Apparel, 100% ringspun combed cotton, heather gray with red bolt.'
49
- price: '$15.99'
50
- review: 4
51
- colors: ['BLACK']
52
- defaultColor: 'BLACK'
53
- 4:
54
- id: 4
55
- name: 'Sauce Labs Fleece Jacket'
56
- description: "It's not every day that you come across a midweight quarter-zip fleece jacket capable of handling everything from a relaxing day outdoors to a busy day at the office."
57
- price: '$49.99'
58
- review: 4
59
- colors: ['GRAY']
60
- defaultColor: 'GRAY'
61
- 5:
62
- id: 5
63
- name: 'Sauce Labs Onesie'
64
- description: "Rib snap infant onesie for the junior automation engineer in development. Reinforced 3-snap bottom closure, two-needle hemmed sleeved and bottom won't unravel."
65
- price: '$7.99'
66
- review: 4
67
- colors: ['BLACK', 'GRAY', 'RED']
68
- defaultColor: 'RED'
69
- 6:
70
- id: 6
71
- name: 'Test.allTheThings() T-Shirt'
72
- description: 'This classic Sauce Labs t-shirt is perfect to wear when cozying up to your keyboard to automate a few tests. Super-soft and comfy ringspun combed cotton.'
73
- price: '$15.99'
74
- review: 4
75
- colors: ['BLACK', 'GRAY', 'RED']
76
- defaultColor: 'RED'
@@ -1,38 +0,0 @@
1
- @mobile @ios @android @regression
2
-
3
-
4
- Feature: App screen deep links
5
- In order to ensure comprehensive support for native app deep links
6
- As a developer of the TestCentricity gem
7
- I expect to validate that app screens can be directly accessed with minimal UI interactions
8
-
9
-
10
- Background:
11
- Given I have launched the SauceLabs My Demo app
12
-
13
-
14
- Scenario Outline: Verify screens can be directly accessed via deep links
15
- Given I am on the <start> screen
16
- When I load the <destination> screen
17
- Then I expect the <destination> screen to be correctly displayed
18
-
19
- Examples:
20
- |start |destination |
21
- |Products |About |
22
- |Products |Login |
23
- |Products |Webview |
24
- |Products |Checkout - Address |
25
- |Products |Checkout - Payment |
26
- |About |Products |
27
-
28
-
29
- Scenario Outline: Verify Product Item screen can be directly accessed via deep links
30
- Given I am on the Products screen
31
- And I access the data for product id <product_id>
32
- When I load the Product Item screen
33
- Then I expect the Product Item screen to be correctly displayed
34
-
35
- Examples:
36
- |product_id |
37
- |1 |
38
- |5 |
@@ -1,30 +0,0 @@
1
- @mobile @ios @android @regression
2
-
3
-
4
- Feature: Login page
5
- In order to ensure comprehensive support for native app login features
6
- As a developer of the TestCentricity gem
7
- I expect users to access the app only with valid login credentials
8
-
9
-
10
- Background:
11
- Given I have launched the SauceLabs My Demo app
12
-
13
-
14
- Scenario: Verify login with valid credentials
15
- Given I am on the Login screen
16
- When I enter user credentials with valid data
17
- Then I expect the Checkout - Address screen to be correctly displayed
18
-
19
-
20
- Scenario Outline: Verify correct error states when using invalid credentials
21
- Given I am on the Login screen
22
- When I enter user credentials with <reason>
23
- Then I expect an error to be displayed due to <reason>
24
-
25
- Examples:
26
- |reason |
27
- |no username |
28
- |no password |
29
- |locked account |
30
- |invalid user |
@@ -1,43 +0,0 @@
1
- @mobile @ios @android @regression
2
-
3
-
4
- Feature: Screen Navigation
5
- In order to ensure comprehensive support for native app navigation features
6
- As a developer of the TestCentricity gem
7
- I expect to validate that app screens can be accessed via navigation controls
8
-
9
-
10
- Background:
11
- Given I have launched the SauceLabs My Demo app
12
- And I am on the Products screen
13
-
14
-
15
- Scenario: Verify navigation menu can be invoked and is properly displayed
16
- When I open the navigation menu
17
- Then I expect the navigation menu to be correctly displayed
18
- When I close the navigation menu
19
- Then I expect the navigation menu to be hidden
20
-
21
-
22
- Scenario Outline: Verify screen navigation features
23
- When I tap the <screen_name> navigation menu item
24
- Then I expect the <screen_name> screen to be correctly displayed
25
-
26
- Examples:
27
- |screen_name |
28
- |About |
29
- |Login |
30
- |Webview |
31
- |SauceBot Video |
32
-
33
-
34
- Scenario Outline: Verify screen navigation features with popup modals
35
- When I tap the <screen_name> navigation menu item
36
- And I accept the popup request modal
37
- Then I expect the <screen_name> screen to be correctly displayed
38
-
39
- Examples:
40
- |screen_name |
41
- |QR Code Scanner |
42
- |Geo Location |
43
- |Biometrics |
@@ -1,67 +0,0 @@
1
- include TestCentricity
2
-
3
-
4
- Given(/^I have launched the SauceLabs My Demo app$/) do
5
- # activate the app
6
- AppiumConnect.launch_app
7
- end
8
-
9
-
10
- When(/^I (?:load|am on) the (.*) (?:page|screen)$/) do |screen_name|
11
- # find and load the specified target page/screen
12
- target_page = PageManager.find_page(screen_name)
13
- target_page.load_page
14
- end
15
-
16
-
17
- When(/^I (?:click|tap) the ([^\"]*) navigation menu item$/) do |screen_name|
18
- # find and navigate to the specified target page/screen
19
- target_page = PageManager.find_page(screen_name)
20
- target_page.navigate_to
21
- PageManager.current_page = target_page
22
- end
23
-
24
-
25
- Then(/^I expect the (.*) (?:page|screen) to be correctly displayed$/) do |screen_name|
26
- # find and verify that the specified target page/screen is loaded
27
- target_page = PageManager.find_page(screen_name)
28
- target_page.verify_page_exists
29
- # verify that target page/screen is correctly displayed
30
- target_page.verify_page_ui
31
- end
32
-
33
-
34
- When(/^I enter user credentials with (.*)$/) do |creds|
35
- cred_data = user_data_source.find_user_creds(creds.gsub(/\s+/, '_').downcase)
36
- login_screen.login(cred_data.username, cred_data.password)
37
- end
38
-
39
-
40
- Then(/^I expect an error to be displayed due to (.*)$/) do |reason|
41
- PageManager.current_page.verify_entry_error(reason)
42
- end
43
-
44
-
45
- When(/^I (.*) the navigation menu$/) do |action|
46
- PageManager.current_page.nav_menu_action(action)
47
- end
48
-
49
-
50
- Then(/^I expect the navigation menu to be correctly displayed$/) do
51
- PageManager.current_page.verify_nav_menu(state = :displayed)
52
- end
53
-
54
-
55
- Then(/^I expect the navigation menu to be hidden$/) do
56
- PageManager.current_page.verify_nav_menu(state = :closed)
57
- end
58
-
59
-
60
- When(/^I (.*) the popup request modal$/) do |action|
61
- PageManager.current_page.modal_action(action)
62
- end
63
-
64
-
65
- When(/^I access the data for product id (.*)$/) do |product_id|
66
- product_data_source.find_product(product_id)
67
- end
@@ -1,11 +0,0 @@
1
- class AboutScreen < BaseAppScreen
2
- trait(:page_name) { 'About' }
3
- trait(:page_locator) { { accessibility_id: 'about screen' } }
4
- trait(:page_url) { 'about' }
5
- trait(:navigator) { nav_menu.open_about }
6
-
7
- def verify_page_ui
8
- super
9
- verify_ui_states(header_label => { visible: true, caption: 'About' })
10
- end
11
- end
@@ -1,31 +0,0 @@
1
- class BaseAppScreen < TestCentricity::ScreenObject
2
- include SharedBaseAppScreen
3
-
4
- trait(:page_name) { 'Base App Screen' }
5
-
6
- # Base App screen UI elements
7
- buttons menu_button: { accessibility_id: 'open menu' },
8
- cart_button: { accessibility_id: 'cart badge' }
9
- labels header_label: { xpath: '//android.view.ViewGroup[@content-desc="container header"]/android.widget.TextView' },
10
- cart_quantity: { xpath: '//android.view.ViewGroup[@content-desc="cart badge"]/android.widget.TextView' }
11
- alerts grant_modal: { id: 'com.android.permissioncontroller:id/grant_dialog' },
12
- alert_modal: { id: 'android:id/parentPanel' }
13
- section :nav_menu, NavMenu
14
-
15
- def verify_page_ui
16
- ui = {
17
- menu_button => { visible: true, enabled: true },
18
- cart_button => { visible: true, enabled: true }
19
- }
20
- verify_ui_states(ui)
21
- end
22
-
23
- def invoke_nav_menu
24
- menu_button.click
25
- nav_menu.wait_until_visible(3)
26
- end
27
-
28
- def open_cart
29
- cart_button.click
30
- end
31
- end
@@ -1,17 +0,0 @@
1
- class BiometricsScreen < BaseAppScreen
2
- trait(:page_name) { 'Biometrics' }
3
- trait(:page_locator) { { accessibility_id: 'biometrics screen' } }
4
- trait(:navigator) { nav_menu.open_biometrics }
5
-
6
- # Biometrics screen UI elements
7
- switch :fingerprint_switch, { accessibility_id: 'biometrics switch'}
8
-
9
- def verify_page_ui
10
- super
11
- ui = {
12
- header_label => { visible: true, caption: 'FingerPrint' },
13
- fingerprint_switch => { visible: true, enabled: false }
14
- }
15
- verify_ui_states(ui)
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- class CheckoutAddressScreen < BaseAppScreen
2
- include SharedCheckoutAddressScreen
3
-
4
- trait(:page_name) { 'Checkout - Address' }
5
- trait(:page_locator) { { accessibility_id: 'checkout address screen' } }
6
- trait(:page_url) { 'checkout-address' }
7
-
8
- # Checkout Address screen UI elements
9
- textfields fullname_field: { accessibility_id: 'Full Name* input field' },
10
- address1_field: { accessibility_id: 'Address Line 1* input field' },
11
- address2_field: { accessibility_id: 'Address Line 2 input field' },
12
- city_field: { accessibility_id: 'City* input field' },
13
- state_region_field: { accessibility_id: 'State/Region input field' },
14
- zip_code_field: { accessibility_id: 'Zip Code* input field' },
15
- country_field: { accessibility_id: 'Country* input field' }
16
- button :to_payment_button, { accessibility_id: 'To Payment button' }
17
- end
@@ -1,22 +0,0 @@
1
- class CheckoutPaymentScreen < BaseAppScreen
2
- include SharedCheckoutPaymentScreen
3
-
4
- trait(:page_name) { 'Checkout - Payment' }
5
- trait(:page_locator) { { accessibility_id: 'checkout payment screen' } }
6
- trait(:page_url) { 'checkout-payment' }
7
-
8
- # Checkout Payment screen UI elements
9
- textfields payee_name_field: { xpath: '(//android.widget.EditText[@content-desc="Full Name* input field"])[1]' },
10
- card_number_field: { accessibility_id: 'Card Number* input field' },
11
- expiration_field: { accessibility_id: 'Expiration Date* input field' },
12
- security_code_field: { accessibility_id: 'Security Code* input field' },
13
- recipient_name_field: { xpath: '(//android.widget.EditText[@content-desc="Full Name* input field"])[2]' },
14
- address1_field: { accessibility_id: 'Address Line 1* input field' },
15
- address2_field: { accessibility_id: 'Address Line 2 input field' },
16
- city_field: { accessibility_id: 'City* input field' },
17
- state_region_field: { accessibility_id: 'State/Region input field' },
18
- zip_code_field: { accessibility_id: 'Zip Code* input field' },
19
- country_field: { accessibility_id: 'Country* input field' }
20
- checkbox :bill_address_check, { xpath: '//android.view.ViewGroup[contains(@content-desc, "checkbox")]/android.view.ViewGroup'}
21
- button :review_order_button, { accessibility_id: 'Review Order button' }
22
- end
@@ -1,28 +0,0 @@
1
- class GeoLocationScreen < BaseAppScreen
2
- trait(:page_name) { 'Geo Location' }
3
- trait(:page_locator) { { accessibility_id: 'geo location screen' } }
4
- trait(:page_url) { 'geo-locations' }
5
- trait(:navigator) { nav_menu.open_geo_location }
6
-
7
- # Geo Location screen UI elements
8
- buttons start_observing_button: { accessibility_id: 'Start Observing button'},
9
- stop_observing_button: { accessibility_id: 'Stop Observing button'}
10
- labels latitude_data: { accessibility_id: 'latitude data' },
11
- longitude_data: { accessibility_id: 'longitude data' }
12
-
13
- def verify_page_ui
14
- super
15
- ui = {
16
- header_label => { visible: true, caption: 'Geo Location' },
17
- start_observing_button => { visible: true, enabled: false, caption: 'Start Observing' },
18
- stop_observing_button => { visible: true, enabled: true, caption: 'Stop Observing' },
19
- latitude_data => { visible: true, caption: { not_equal: '0' } },
20
- longitude_data => { visible: true, caption: { not_equal: '0' } }
21
- }
22
- verify_ui_states(ui)
23
- end
24
-
25
- def modal_action(action)
26
- grant_modal.await_and_respond(action.downcase.to_sym, timeout = 1, button_name = 'Only this time')
27
- end
28
- end
@@ -1,18 +0,0 @@
1
- class LoginScreen < BaseAppScreen
2
- include SharedLoginScreen
3
-
4
- trait(:page_name) { 'Login' }
5
- trait(:page_locator) { { accessibility_id: 'login screen' } }
6
- trait(:page_url) { 'login' }
7
- trait(:navigator) { nav_menu.open_log_in }
8
-
9
- # Login screen UI elements
10
- labels username_label: { xpath: '//android.view.ViewGroup[@content-desc="login screen"]/android.widget.ScrollView/android.view.ViewGroup/android.widget.TextView[2]'},
11
- password_label: { xpath: '//android.view.ViewGroup[@content-desc="login screen"]/android.widget.ScrollView/android.view.ViewGroup/android.widget.TextView[3]'},
12
- username_error: { accessibility_id: 'Username-error-message' },
13
- password_error: { accessibility_id: 'Password-error-message' },
14
- generic_error: { accessibility_id: 'generic-error-message' }
15
- textfields username_field: { accessibility_id: 'Username input field' },
16
- password_field: { accessibility_id: 'Password input field' }
17
- button :login_button, { accessibility_id: 'Login button' }
18
- end
@@ -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: { xpath: '//android.view.ViewGroup/android.widget.TextView[2]' }
11
- image :product_image, { xpath: '//android.view.ViewGroup/android.widget.ImageView' }
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: '//android.widget.ScrollView' }
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: '//android.view.ViewGroup[@content-desc="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,15 +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
-
12
- def modal_action(action)
13
- grant_modal.await_and_respond(action.downcase.to_sym, timeout = 1, button_name = 'Only this time')
14
- end
15
- 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, { xpath: '//android.view.View[@resource-id="movie_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, { xpath: '//android.view.ViewGroup[@content-desc="webview selection screen"]/android.widget.ScrollView/android.view.ViewGroup/android.widget.TextView[1]' }
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: '//android.view.ViewGroup[@content-desc="store item"]' } }
4
-
5
- # Product Cell Item UI elements
6
- labels product_name: { xpath: '//android.widget.TextView[@content-desc="store item text"]' },
7
- product_price: { xpath: '//android.widget.TextView[@content-desc="store item price"]' }
8
- buttons review_star_1: { xpath: '//android.view.ViewGroup[@content-desc="review star 1"]' },
9
- review_star_2: { xpath: '//android.view.ViewGroup[@content-desc="review star 2"]' },
10
- review_star_3: { xpath: '//android.view.ViewGroup[@content-desc="review star 3"]' },
11
- review_star_4: { xpath: '//android.view.ViewGroup[@content-desc="review star 4"]' },
12
- review_star_5: { xpath: '//android.view.ViewGroup[@content-desc="review star 5"]' }
13
- end
@@ -1,39 +0,0 @@
1
- class NavMenu < TestCentricity::ScreenSection
2
- include SharedNavMenu
3
-
4
- trait(:section_name) { 'Nav Menu' }
5
- trait(:section_locator) { { xpath: '//android.widget.ScrollView/android.view.ViewGroup' } }
6
-
7
- # Nav Menu UI elements
8
- buttons close_button: { accessibility_id: 'menu item catalog' },
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
- about_button: { accessibility_id: 'menu item about' },
14
- reset_app_button: { accessibility_id: 'menu item reset app' },
15
- biometrics_button: { accessibility_id: 'menu item biometrics' },
16
- log_in_button: { accessibility_id: 'menu item log in' },
17
- log_out_button: { accessibility_id: 'menu item log out' },
18
- api_calls_button: { accessibility_id: 'menu item api calls' },
19
- sauce_video_button: { accessibility_id: 'menu item sauce bot video' }
20
-
21
- def verify_ui
22
- ui = {
23
- self => { visible: true },
24
- close_button => { visible: true, enabled: true },
25
- webview_button => { visible: true, enabled: true, caption: 'Webview' },
26
- qr_code_button => { visible: true, enabled: true, caption: 'QR Code Scanner' },
27
- geo_location_button => { visible: true, enabled: true, caption: 'Geo Location' },
28
- drawing_button => { visible: true, enabled: true, caption: 'Drawing' },
29
- about_button => { visible: true, enabled: true, caption: 'About' },
30
- reset_app_button => { visible: true, enabled: true, caption: 'Reset App State' },
31
- biometrics_button => { visible: true, enabled: true, caption: 'FingerPrint' },
32
- log_in_button => { visible: true, enabled: true, caption: 'Log In' },
33
- log_out_button => { visible: true, enabled: true, caption: 'Log Out' },
34
- api_calls_button => { visible: true, enabled: true, caption: 'Api Calls' },
35
- sauce_video_button => { visible: true, enabled: true, caption: 'Sauce Bot Video' }
36
- }
37
- verify_ui_states(ui)
38
- end
39
- end
@@ -1,27 +0,0 @@
1
- class ProductDataSource < TestCentricity::DataSource
2
- def find_product(product_id)
3
- ProductData.current = ProductData.new(environs.read('Products', product_id.to_i))
4
- end
5
- end
6
-
7
-
8
- class ProductData < TestCentricity::DataPresenter
9
- attribute :id, Integer
10
- attribute :name, String
11
- attribute :description, String
12
- attribute :price, String
13
- attribute :review, Integer
14
- attribute :colors, Array
15
- attribute :default_color, String
16
-
17
- def initialize(data)
18
- @id = data[:id]
19
- @name = data[:name]
20
- @description = data[:description]
21
- @price = data[:price]
22
- @review = data[:review]
23
- @colors = data[:colors]
24
- @default_color = data[:defaultColor]
25
- super
26
- end
27
- end
@@ -1,17 +0,0 @@
1
- class UserDataSource < TestCentricity::DataSource
2
- def find_user_creds(node_name)
3
- UserData.current = UserData.new(environs.read('User_creds', node_name))
4
- end
5
- end
6
-
7
-
8
- class UserData < TestCentricity::DataPresenter
9
- attribute :username, String
10
- attribute :password, String
11
-
12
- def initialize(data)
13
- @username = data[:username]
14
- @password = data[:password]
15
- super
16
- end
17
- end