testcentricity 3.0.3 → 3.0.6

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/README.md +1 -0
  4. data/lib/testcentricity/app_core/appium_connect_helper.rb +1 -0
  5. data/lib/testcentricity/app_core/screen_section.rb +0 -1
  6. data/lib/testcentricity/app_elements/app_element_helper.rb +69 -16
  7. data/lib/testcentricity/version.rb +1 -1
  8. metadata +5 -143
  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/LOCAL_data.yml +0 -15
  20. data/config/test_data/data.yml +0 -9
  21. data/features/deep_links.feature +0 -26
  22. data/features/login.feature +0 -30
  23. data/features/navigation.feature +0 -43
  24. data/features/step_definitions/generic_steps.rb +0 -62
  25. data/features/support/android/screens/about_screen.rb +0 -11
  26. data/features/support/android/screens/base_app_screen.rb +0 -31
  27. data/features/support/android/screens/biometrics_screen.rb +0 -17
  28. data/features/support/android/screens/checkout_address_screen.rb +0 -17
  29. data/features/support/android/screens/checkout_payment_screen.rb +0 -22
  30. data/features/support/android/screens/geo_location_screen.rb +0 -28
  31. data/features/support/android/screens/login_screen.rb +0 -18
  32. data/features/support/android/screens/products_screen.rb +0 -13
  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/nav_widgets/nav_menu.rb +0 -39
  37. data/features/support/data/user_data.rb +0 -17
  38. data/features/support/env.rb +0 -62
  39. data/features/support/hooks.rb +0 -135
  40. data/features/support/ios/screens/about_screen.rb +0 -11
  41. data/features/support/ios/screens/base_app_screen.rb +0 -20
  42. data/features/support/ios/screens/biometrics_screen.rb +0 -17
  43. data/features/support/ios/screens/checkout_address_screen.rb +0 -17
  44. data/features/support/ios/screens/checkout_payment_screen.rb +0 -22
  45. data/features/support/ios/screens/geo_location_screen.rb +0 -32
  46. data/features/support/ios/screens/login_screen.rb +0 -18
  47. data/features/support/ios/screens/products_screen.rb +0 -13
  48. data/features/support/ios/screens/qr_code_scanner_screen.rb +0 -11
  49. data/features/support/ios/screens/saucebot_screen.rb +0 -16
  50. data/features/support/ios/screens/webview_screen.rb +0 -13
  51. data/features/support/ios/sections/list_items/product_cell_item.rb +0 -13
  52. data/features/support/ios/sections/nav_widgets/nav_bar.rb +0 -31
  53. data/features/support/ios/sections/nav_widgets/nav_menu.rb +0 -41
  54. data/features/support/shared_components/screens/base_app_screen.rb +0 -35
  55. data/features/support/shared_components/screens/checkout_address_screen.rb +0 -17
  56. data/features/support/shared_components/screens/checkout_payment_screen.rb +0 -22
  57. data/features/support/shared_components/screens/login_screen.rb +0 -39
  58. data/features/support/shared_components/screens/saucebot_screen.rb +0 -17
  59. data/features/support/shared_components/screens/webview_screen.rb +0 -12
  60. data/features/support/shared_components/sections/nav_menu.rb +0 -58
  61. data/features/support/world_data.rb +0 -12
  62. data/features/support/world_pages.rb +0 -29
  63. data/reports/.keep +0 -1
  64. data/spec/fixtures/page_object.rb +0 -22
  65. data/spec/fixtures/page_section_object.rb +0 -21
  66. data/spec/fixtures/screen_object.rb +0 -16
  67. data/spec/fixtures/screen_section_object.rb +0 -16
  68. data/spec/spec_helper.rb +0 -33
  69. data/spec/testcentricity/elements/button_spec.rb +0 -18
  70. data/spec/testcentricity/elements/checkbox_spec.rb +0 -28
  71. data/spec/testcentricity/elements/image_spec.rb +0 -13
  72. data/spec/testcentricity/elements/label_spec.rb +0 -18
  73. data/spec/testcentricity/elements/list_spec.rb +0 -13
  74. data/spec/testcentricity/elements/ui_element_spec.rb +0 -72
  75. data/spec/testcentricity/mobile/appium_connect_spec.rb +0 -117
  76. data/spec/testcentricity/mobile/screen_object_spec.rb +0 -63
  77. data/spec/testcentricity/mobile/screen_section_object_spec.rb +0 -56
  78. data/spec/testcentricity/version_spec.rb +0 -7
  79. data/spec/testcentricity/web/browser_spec.rb +0 -41
  80. data/spec/testcentricity/web/local_webdriver_spec.rb +0 -86
  81. data/spec/testcentricity/web/mobile_webdriver_spec.rb +0 -123
  82. data/spec/testcentricity/web/page_object_spec.rb +0 -85
  83. data/spec/testcentricity/web/page_section_object_spec.rb +0 -72
  84. data/testcentricity.gemspec +0 -48
data/config/cucumber.yml DELETED
@@ -1,146 +0,0 @@
1
- <% desktop = "--require features BROWSER_TILE=true BROWSER_SIZE=1300,1000 --publish-quiet" %>
2
- <% mobile = "--require features --publish-quiet" %>
3
- <% reports = "--require features --format pretty --format html --out reports/test_results.html --format junit --out reports --format json --out reports/test_results.json" %>
4
- <% regression = "--tags '@regression and (not @wip and not @failing)' --require features" %>
5
- <% acceptance = "--tags '@bat and (not @wip and not @failing)' --require features" %>
6
-
7
-
8
- #==============
9
- # generic test context profiles
10
- #==============
11
-
12
- failing: --tags '@failing and not @wip'
13
- wip: --tags '@wip and not @failing'
14
- dev: --tags '@dev and (not @wip and not @failing)'
15
- regress: <%= regression %>
16
- bvt: <%= acceptance %>
17
-
18
-
19
- #==============
20
- # test reporting profiles
21
- #==============
22
-
23
- report: <%= reports %> REPORTING=true
24
- parallel: PARALLEL=true REPORTING=true --require features --format pretty --format html --out reports/test_results<%= ENV['TEST_ENV_NUMBER'] %>.html --format junit --out reports --format json --out reports/test_results<%= ENV['TEST_ENV_NUMBER'] %>.json
25
-
26
-
27
- #==============
28
- # conditionally load Page and Screen Object implementations based on which target platform we're running on
29
- #==============
30
-
31
- ios: PLATFORM=ios --tags @ios -r features/support/ios -e features/support/android
32
- android: PLATFORM=android --tags @android -r features/support/android -e features/support/ios
33
- web: PLATFORM=web --tags @web -r features/support/web -e features/support/ios -e features/support/android
34
-
35
-
36
- #==============
37
- # target_test_environment profiles
38
- #==============
39
-
40
- local: TEST_ENVIRONMENT=LOCAL
41
- debug: DEBUG=true
42
-
43
-
44
- #==============
45
- # profiles for mobile device screen orientation
46
- #==============
47
-
48
- landscape: ORIENTATION=landscape
49
- portrait: ORIENTATION=portrait
50
-
51
-
52
- #==============
53
- # profile to start Appium Server prior to running mobile browser tests on iOS or Android simulators or physical devices
54
- #==============
55
- run_appium: APPIUM_SERVER=run
56
- upload_app: UPLOAD_APP=true
57
-
58
-
59
- #==============
60
- # profiles for native iOS apps hosted within XCode iOS simulators
61
- # NOTE: Requires installation of XCode, iOS version specific target simulators, and Appium
62
- #==============
63
-
64
- appium_ios: WEB_BROWSER=appium --profile ios AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="iOS" NEW_COMMAND_TIMEOUT="30" <%= mobile %>
65
- app_ios_14: --profile appium_ios APP_VERSION="14.5"
66
- app_ios_15: --profile appium_ios APP_VERSION="15.4"
67
-
68
- iphone_12PM_14_sim: --profile app_ios_14 DEVICE_TYPE=phone APP_DEVICE="iPhone 12 Pro Max"
69
- iphone_13PM_15_sim: --profile app_ios_15 DEVICE_TYPE=phone APP_DEVICE="iPhone 13 Pro Max"
70
- iphone_11_14_sim: --profile app_ios_14 DEVICE_TYPE=phone APP_DEVICE="iPhone 11"
71
- ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
72
- ios_sim: --profile iphone_13PM_15_sim --profile local --profile run_appium
73
-
74
-
75
- #==============
76
- # profiles for native Android apps hosted within Android Studio Android Virtual Device emulators
77
- # NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, and Appium
78
- #==============
79
-
80
- appium_android: WEB_BROWSER=appium --profile android AUTOMATION_ENGINE=UiAutomator2 APP_PLATFORM_NAME="Android" <%= mobile %>
81
- app_android_12: --profile appium_android APP_VERSION="12.0"
82
- pixel_5_api31_sim: --profile app_android_12 DEVICE_TYPE=phone APP_DEVICE="Pixel_5_API_31"
83
- android_sim: --profile pixel_5_api31_sim --profile local --profile run_appium
84
-
85
-
86
- #==============
87
- # profiles for remotely hosted devices on the BrowserStack service
88
- #==============
89
-
90
- browserstack: WEB_BROWSER=browserstack BS_USERNAME="<INSERT USER NAME HERE>" BS_AUTHKEY="<INSERT PASSWORD HERE>" TEST_CONTEXT="TestCentricity"
91
-
92
- # BrowserStack iOS real device native app profiles
93
- bs_ios: --profile browserstack --profile ios BS_OS=ios <%= mobile %>
94
- bs_iphone: --profile bs_ios DEVICE_TYPE=phone
95
- bs_iphone13PM_15: --profile bs_iphone BS_OS_VERSION="15" BS_DEVICE="iPhone 13 Pro Max"
96
- bs_iphone11_14: --profile bs_iphone BS_OS_VERSION="14" BS_DEVICE="iPhone 11"
97
-
98
- # BrowserStack Android real device native app profiles
99
- bs_android: --profile browserstack --profile android BS_OS=android <%= mobile %>
100
- bs_pixel5: --profile bs_android BS_DEVICE="Google Pixel 5" BS_OS_VERSION="12.0" DEVICE_TYPE=phone
101
-
102
-
103
- #==============
104
- # profiles for remotely hosted devices on the SauceLabs service
105
- #==============
106
-
107
- saucelabs: WEB_BROWSER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="us-west-1" AUTOMATE_PROJECT="TestCentricity - SauceLabs"
108
-
109
- # SauceLabs iOS real device native app profiles
110
- sl_ios: --profile saucelabs --profile ios SL_OS=ios <%= mobile %>
111
- sl_iphone: --profile sl_ios DEVICE_TYPE=phone
112
- sl_iphone13PM_15: --profile sl_iphone SL_DEVICE="iPhone 13 Pro Max Simulator" SL_OS_VERSION="15.4"
113
-
114
- # SauceLabs Android real device native app profiles
115
- sl_android: --profile saucelabs --profile android SL_OS=android <%= mobile %>
116
- sl_pixel5: --profile sl_android SL_DEVICE="Google Pixel 5 GoogleAPI Emulator" SL_OS_VERSION="12.0" DEVICE_TYPE=phone
117
-
118
-
119
- #==============
120
- # profiles for remotely hosted devices on the TestingBot service
121
- #==============
122
-
123
- testingbot: WEB_BROWSER=testingbot TB_USERNAME="<INSERT USER NAME HERE>" TB_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TestCentricity - TestingBot"
124
-
125
- # TestingBot iOS real device native app profiles
126
- tb_ios: --profile testingbot --profile ios TB_OS=iOS <%= mobile %>
127
- tb_iphone: --profile tb_ios DEVICE_TYPE=phone
128
- tb_iphone11_14_dev: --profile tb_iphone TB_OS_VERSION="14.0" TB_DEVICE="iPhone 11" REAL_DEVICE=true
129
- tb_iphone11_14_sim: --profile tb_iphone TB_OS_VERSION="14.2" TB_DEVICE="iPhone 11"
130
- tb_iphone13PM_15_sim: --profile tb_iphone TB_OS_VERSION="15.4" TB_DEVICE="iPhone 13 Pro Max"
131
-
132
- # TestingBot Android real device native app profiles
133
- tb_android: --profile testingbot --profile android TB_OS=Android <%= mobile %>
134
- tb_pixel_dev: --profile tb_android TB_DEVICE="Pixel" TB_OS_VERSION="9.0" DEVICE_TYPE=phone REAL_DEVICE=true
135
- tb_pixel6_sim: --profile tb_android TB_DEVICE="Pixel 6" TB_OS_VERSION="12.0" DEVICE_TYPE=phone
136
-
137
-
138
- #==============
139
- # profiles for remotely hosted devices on the LambdaTest service
140
- #==============
141
-
142
- lambdatest: WEB_BROWSER=lambdatest LT_USERNAME="<INSERT USER NAME HERE>" LT_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TestCentricity - LambdaTest"
143
-
144
- # LambdaTest iOS real device native app profiles
145
- lt_ios: --profile lambdatest --profile ios LT_OS=iOS <%= mobile %>
146
- lt_iphone: --profile lt_ios DEVICE_TYPE=phone
@@ -1,56 +0,0 @@
1
- # Localization file for English/U.S. locale.
2
-
3
- en-US:
4
- time:
5
- formats:
6
- default: "%m/%d/%Y"
7
- long: "%B %d, %Y"
8
- short: "%b %d"
9
- abbrev: "%b %d, %Y"
10
- abbrev_month: "%b"
11
- month_year: "%B %Y"
12
- date:
13
- abbr_day_names:
14
- - Sun
15
- - Mon
16
- - Tue
17
- - Wed
18
- - Thu
19
- - Fri
20
- - Sat
21
- abbr_month_names:
22
- -
23
- - Jan
24
- - Feb
25
- - Mar
26
- - Apr
27
- - May
28
- - Jun
29
- - Jul
30
- - Aug
31
- - Sep
32
- - Oct
33
- - Nov
34
- - Dec
35
- day_names:
36
- - Sunday
37
- - Monday
38
- - Tuesday
39
- - Wednesday
40
- - Thursday
41
- - Friday
42
- - Saturday
43
- month_names:
44
- -
45
- - January
46
- - February
47
- - March
48
- - April
49
- - May
50
- - June
51
- - July
52
- - August
53
- - September
54
- - October
55
- - November
56
- - December
@@ -1,15 +0,0 @@
1
-
2
- User_creds:
3
- valid_data:
4
- username: 'bob@example.com'
5
- password: '10203040'
6
- invalid_user:
7
- username: 'iggy.snicklefritz@example.com'
8
- password: '10203040'
9
- locked_account:
10
- username: 'alice@example.com'
11
- password: '10203040'
12
- no_username:
13
- password: '10203040'
14
- no_password:
15
- username: 'bob@example.com'
@@ -1,9 +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'
@@ -1,26 +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 |
@@ -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,62 +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
@@ -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,13 +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
- def verify_page_ui
7
- super
8
- ui = {
9
- header_label => { visible: true, caption: 'Products' }
10
- }
11
- verify_ui_states(ui)
12
- end
13
- 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,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