testcentricity_mobile 4.0.1 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0905d797751e541ce6f8a2c6c6dd26d5d5584e628f163628a210b9a5798bcf1
4
- data.tar.gz: 53ae41335c32637957051f14aeb2641c6d8fd3e8b3dd439a11097bd7ec035043
3
+ metadata.gz: 8d1c72189a3ecb6043ddb0ce1d7b16f1f2e67469522a97afbce050dcb75ab13f
4
+ data.tar.gz: 35348b22511759c81c7cce36f293f8eaa902fede99436b6803043db1ecc3c2bc
5
5
  SHA512:
6
- metadata.gz: 1d7a071d804e24f74c6933cf6f747893ebaef6a7b185f8182cc671b3ac9700b366da763ba0c1ca76e5392341c996ad0c51c6df23ca6269aeb5b237196e00f1f4
7
- data.tar.gz: dccfa0b3227f0d87025b1cd69236f739f1c2802ed7a2ce076312c07e4b107e2022a4db50401f8b5d0163a22792b38d27831c469b79ed240ea5be6b6d18c5dbaf
6
+ metadata.gz: 65dd7f632f96537cd043fb0e1246859e029b987fffbab216948818307c2ae1ed1ca57db8ef17883392d5ffeaa759b656602c696399a08431b83527f5862aedca
7
+ data.tar.gz: ae61adcb122c74499f17e930ad9457a0790547cac3a9c9807bf954d7bd62d34af8d431549d6e0b37c926ce1c30aadb41765091cc98467c831d1510861cb5e09a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [4.0.3] - 05-APR-2024
6
+
7
+ ### Fixed
8
+
9
+ * `AppiumConnect.initialize_appium`, `AppiumServer.start`, and `AppiumServer.running?` methods now support Appium version 2.x.
10
+ Backward compatibility with Appium version 1.x is provided if `APPIUM_SERVER_VERSION` Environment Variable is set to `1`.
11
+
12
+
13
+ ## [4.0.2] - 27-MAR-2024
14
+
15
+ ### Changed
16
+
17
+ * Updated `selenium-webdriver` gem to version 4.19.0.
18
+
19
+
5
20
  ## [4.0.0] - 26-MAR-2024
6
21
 
7
22
  ### Fixed
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
  The TestCentricity™ Mobile core framework for native mobile iOS and Android app testing implements a Screen Object Model
11
- DSL for use with Cucumber (version 7.x or greater) and Appium. It also facilitates the configuration of the appropriate
11
+ DSL for use with Cucumber (version 7.x or greater) and Appium 2.x. It also facilitates the configuration of the appropriate
12
12
  Appium capabilities and driver required to establish a connection with locally or cloud hosted iOS and Android real devices
13
13
  or simulators.
14
14
 
@@ -28,6 +28,15 @@ A complete history of bug fixes and new features can be found in the {file:CHANG
28
28
 
29
29
  The RubyDocs for this gem can be found [here](https://www.rubydoc.info/gems/testcentricity_mobile/).
30
30
 
31
+ Two example projects that demonstrates the implementation of a screen object model framework using Cucumber and TestCentricity™
32
+ Mobile can be found at the following:
33
+ * [tc_mobile_react_native_demo](https://github.com/TestCentricity/tc_mobile_react_native_demo)
34
+ * [tc_mobile_wdio_demo](https://github.com/TestCentricity/tc_mobile_wdio_demo)
35
+
36
+ Refer to [this wiki page](https://github.com/TestCentricity/testcentricity_mobile/wiki/XCUItest-driver-bug-impacts-iOS-dialogs-managed-by-com.apple.springboard) for
37
+ information on a bug with the latest versions of the XCUItest driver that affects Appium's ability to interact with and
38
+ verify iOS system level modal dialogs.
39
+
31
40
 
32
41
  ### Which gem should I use?
33
42
 
@@ -310,9 +319,11 @@ Refer to the [Speeding Up Tests With Deep Links](https://appiumpro.com/editions/
310
319
  A `ScreenSection` is a collection of **UI Elements** that may appear in multiple locations on a screen, or on multiple
311
320
  screens in an app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a menu,
312
321
  a navigation bar, or a search capability. **UI Elements** and functional behavior are confined to the scope of a `ScreenSection`
313
- object.
322
+ object. A `ScreenSection` may contain other `ScreenSection` objects.
314
323
 
315
- A `ScreenSection` may contain other `ScreenSection` objects.
324
+ Below is an example of a footer navigation bar feature that is common to multiple screen -
325
+
326
+ ![Navigation Footer](https://raw.githubusercontent.com/TestCentricity/testcentricity_mobile/main/.github/images/NavBar1.png "Navigation Footer") ![Navigation Footer](https://raw.githubusercontent.com/TestCentricity/testcentricity_mobile/main/.github/images/NavBar2.png "Navigation Footer")
316
327
 
317
328
 
318
329
  ### Defining a ScreenSection
@@ -472,11 +483,20 @@ Single `AppUIElement` declarations have the following format:
472
483
  elementType :elementName, { locator_strategy: locator_identifier }
473
484
 
474
485
  * The `elementName` is the unique name that you will use to refer to the UI element and is specified as a `Symbol`.
475
- * The `locator_strategy` specifies the [selector strategy](https://appium.io/docs/en/commands/element/find-elements/index.html#selector-strategies)
476
- that Appium will use to find the `AppUIElement`. Valid selectors are `accessibility_id:`, `id:`, `name:`, `class:`, `xpath:`,
477
- `predicate:` (iOS only), `class_chain:` (iOS only), and `css:` (WebViews in hybrid apps only).
486
+ * The `locator_strategy` specifies the selector strategy that Appium will use to find the `AppUIElement`. Valid selectors are:
487
+ - `accessibility_id:`
488
+ - `id:`
489
+ - `name:`
490
+ - `class:`
491
+ - `xpath:`
492
+ - `predicate:` (iOS only)
493
+ - `class_chain:` (iOS only)
494
+ - `css:` (WebViews in hybrid apps only).
478
495
  * The `locator_identifier` is the value or attribute that uniquely and unambiguously identifies the `AppUIElement`.
479
496
 
497
+ Refer to [this page](https://appium.github.io/appium-xcuitest-driver/5.12/locator-strategies/) for information on selector strategies for iOS.
498
+ Refer to [this page](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#element-location) for information on selector strategies for Android.
499
+
480
500
  Multiple `AppUIElement` declarations for a collection of elements of the same type can be performed by passing a hash table
481
501
  containing the names and locators of each individual element.
482
502
 
@@ -687,38 +707,44 @@ The `verify_ui_states` method also supports I18n string translations using prope
687
707
  :translate_capitalize String
688
708
  :translate_titlecase String
689
709
 
690
- The example below depicts the usage of the `verify_ui_states` method to verify that the captions for menu items are correctly
691
- translated.
710
+ The example below depicts the usage of the `verify_ui_states` method to verify that the captions for navigation menu items
711
+ are correctly translated.
712
+
713
+ ![Localized UI](https://raw.githubusercontent.com/TestCentricity/testcentricity_mobile/main/.github/images/LocalizedUI.png "Localized UI")
692
714
  ```ruby
693
715
  def verify_menu
694
716
  ui = {
695
- account_settings_item => {
717
+ menu_title => {
718
+ visible: true,
719
+ caption: { translate: 'NavMenu.title' }
720
+ },
721
+ recipes_item => {
696
722
  visible: true,
697
- caption: { translate: 'Settings.account' }
723
+ caption: { translate: 'NavMenu.recipes' }
698
724
  },
699
- help_item => {
725
+ browser_item => {
700
726
  visible: true,
701
- caption: { translate: 'Settings.help' }
727
+ caption: { translate: 'NavMenu.browser' }
702
728
  },
703
- feedback_item => {
729
+ groceries_item => {
704
730
  visible: true,
705
- caption: { translate: 'Settings.feedback' }
731
+ caption: { translate: 'NavMenu.groceries' }
706
732
  },
707
- legal_item => {
733
+ pantry_item => {
708
734
  visible: true,
709
- caption: { translate: 'Settings.legal' }
735
+ caption: { translate: 'NavMenu.pantry' }
710
736
  },
711
- configurations_item => {
737
+ meals_item => {
712
738
  visible: true,
713
- caption: { translate: 'Settings.configurations' }
739
+ caption: { translate: 'NavMenu.meals' }
714
740
  },
715
- contact_us_item => {
741
+ menus_item => {
716
742
  visible: true,
717
- caption: { translate: 'Settings.contact' }
743
+ caption: { translate: 'NavMenu.menus' }
718
744
  },
719
- sign_out_item => {
745
+ settings_item => {
720
746
  visible: true,
721
- caption: { translate: 'Settings.sign_out' }
747
+ caption: { translate: 'NavMenu.settings' }
722
748
  }
723
749
  }
724
750
  verify_ui_states(ui)
@@ -730,38 +756,41 @@ menu example above, the translated strings for English, Spanish, and French are
730
756
  **English** - `en.yml`
731
757
  ```yaml
732
758
  en:
733
- Settings:
734
- account: 'Account'
735
- help: 'Help'
736
- feedback: 'Feedback'
737
- legal: 'Legal'
738
- configurations: 'Configurations'
739
- contact: 'Contact'
740
- sign_out: 'Sign out'
759
+ NavMenu:
760
+ title: 'Main Menu'
761
+ recipes: 'Recipes'
762
+ browser: 'Browser'
763
+ groceries: 'Groceries'
764
+ pantry: 'Pantry'
765
+ meals: 'Meals'
766
+ menus: 'Menus'
767
+ settings: 'Settings'
741
768
  ```
742
769
  **Spanish** - `es.yml`
743
770
  ```yaml
744
771
  es:
745
- Settings:
746
- account: 'Cuenta'
747
- help: 'Ayuda'
748
- feedback: 'Comentario'
749
- legal: 'Legal'
750
- configurations: 'Configuraciones'
751
- contact: 'Contacto'
752
- sign_out: 'Cerrar sesión'
772
+ NavMenu:
773
+ title: 'Menú principal'
774
+ recipes: 'Recetas'
775
+ browser: 'Navegador'
776
+ groceries: 'Compra'
777
+ pantry: 'Despensa'
778
+ meals: 'Comidas'
779
+ menus: 'Menús'
780
+ settings: 'Ajustes'
753
781
  ```
754
782
  **French** - `fr.yml`
755
783
  ```yaml
756
784
  fr:
757
- Settings:
758
- account: 'Compte'
759
- help: 'Aide'
760
- feedback: 'Retour'
761
- legal: 'Légal'
762
- configurations: 'Configurations'
763
- contact: 'Contact'
764
- sign_out: 'Fermer la session'
785
+ NavMenu:
786
+ title: 'Menu principal'
787
+ recipes: 'Recettes'
788
+ browser: 'Navigateur'
789
+ groceries: 'Courses'
790
+ pantry: 'Provisions'
791
+ meals: 'Repas'
792
+ menus: 'Menus'
793
+ settings: 'Réglades'
765
794
  ```
766
795
 
767
796
  Each supported language/locale combination has a corresponding `.yml` file. I18n `.yml` file naming convention uses
@@ -963,6 +992,10 @@ Refer to [this page](https://appium.io/docs/en/2.4/guides/caps/) for information
963
992
  to invoking Cucumber to run your features/scenarios on locally hosted iOS or Android simulators or physical devices. Refer
964
993
  to [**section 8.2.3 (Starting and Stopping Appium Server)**](#starting-and-stopping-appium-server) below.
965
994
 
995
+ ⚠️ If you are running locally hosted mobile tests on iOS or Android simulators or devices using version 1.x of the Appium
996
+ server, the `APPIUM_SERVER_VERSION` environment variable must be set to `1` in order to ensure that the correct Appium server
997
+ endpoint is used.
998
+
966
999
  #### Connecting to Locally Hosted iOS Simulators or Physical Devices
967
1000
 
968
1001
  You can run your automated tests on locally hosted iOS simulators or physically connected devices using Appium and XCode
@@ -1179,6 +1212,13 @@ starting your Cucumber test suite(s):
1179
1212
 
1180
1213
  run_appium: APPIUM_SERVER=run
1181
1214
 
1215
+ If you are running locally hosted mobile tests on iOS or Android simulators or devices using version 1.x of the Appium server,
1216
+ the `APPIUM_SERVER_VERSION` environment variable must be set to `1` in order to ensure that the correct Appium server endpoint
1217
+ is used. This can be set by adding the following to your `cucumber.yml` file and including `-p appium_1x` in your command line
1218
+ when starting your Cucumber test suite(s):
1219
+
1220
+ appium_1x: APPIUM_SERVER_VERSION=1
1221
+
1182
1222
  Refer to [**section 8.4 (Using Configuration Specific Profiles in `cucumber.yml`)**](#using-configuration-specific-profiles-in-cucumber-yml) below.
1183
1223
 
1184
1224
 
@@ -1199,6 +1239,10 @@ body of an example group:
1199
1239
  $server.stop if Environ.driver == :appium && $server.running?
1200
1240
  end
1201
1241
  ```
1242
+ If you are running locally hosted mobile tests on iOS or Android simulators or devices using version 1.x of the Appium server,
1243
+ the `APPIUM_SERVER_VERSION` environment variable must be set to `1` in order to ensure that the correct Appium server endpoint
1244
+ is used.
1245
+
1202
1246
 
1203
1247
  ### Connecting to Remote Cloud Hosted iOS and Android Simulators or Physical Devices
1204
1248
 
@@ -1621,6 +1665,7 @@ with access to your version control system.
1621
1665
  # physical devices
1622
1666
  #==============
1623
1667
  run_appium: APPIUM_SERVER=run
1668
+ appium_1x: APPIUM_SERVER_VERSION=1
1624
1669
 
1625
1670
 
1626
1671
  #==============
@@ -1718,6 +1763,11 @@ You can ensure that Appium Server is running by including `-p run_appium` in you
1718
1763
 
1719
1764
  cucumber -p ipad_pro_12_15_sim -p portrait -p run_appium
1720
1765
 
1766
+ If you are running locally hosted mobile tests using version 1.x of Appium server, you must include `-p appium_1x` in
1767
+ your command line:
1768
+
1769
+ cucumber -p ipad_pro_12_15_sim -p landscape -p run_appium -p appium_1x
1770
+
1721
1771
 
1722
1772
  The following command specifies that Cucumber will run tests against a cloud hosted iPhone 13 Pro Max running iOS 15.4 on the
1723
1773
  BrowserStack service:
@@ -390,7 +390,13 @@ module TestCentricity
390
390
 
391
391
  def self.appium_local_capabilities
392
392
  # specify endpoint url
393
- @endpoint = 'http://127.0.0.1:4723/wd/hub' if @endpoint.nil?
393
+ if @endpoint.nil?
394
+ @endpoint = if ENV['APPIUM_SERVER_VERSION'] && ENV['APPIUM_SERVER_VERSION'].to_i == 1
395
+ 'http://127.0.0.1:4723/wd/hub'
396
+ else
397
+ 'http://127.0.0.1:4723'
398
+ end
399
+ end
394
400
  # define local Appium capabilities
395
401
  if @capabilities.nil?
396
402
  Environ.device_name = ENV['APP_DEVICE']
@@ -459,11 +465,7 @@ module TestCentricity
459
465
  Environ.device_name = @capabilities[:'appium:deviceName']
460
466
  Environ.device_os_version = @capabilities[:'appium:platformVersion']
461
467
  Environ.device_orientation = @capabilities[:'appium:orientation']
462
- Environ.device = if @capabilities[:'appium:udid']
463
- :device
464
- else
465
- :simulator
466
- end
468
+ Environ.device = @capabilities[:'appium:udid'] ? :device : :simulator
467
469
  @capabilities
468
470
  end
469
471
  end
@@ -38,9 +38,14 @@ module TestCentricity
38
38
  # Check to see if Appium Server is running
39
39
  #
40
40
  def running?
41
+ endpoint = if ENV['APPIUM_SERVER_VERSION'] && ENV['APPIUM_SERVER_VERSION'].to_i == 1
42
+ 'http://0.0.0.0:4723/wd/hub/sessions'
43
+ else
44
+ 'http://0.0.0.0:4723/sessions'
45
+ end
41
46
  response = false
42
47
  begin
43
- response = Net::HTTP.get_response(URI('http://0.0.0.0:4723/wd/hub/sessions'))
48
+ response = Net::HTTP.get_response(URI(endpoint))
44
49
  rescue
45
50
  end
46
51
  response && response.code_type == Net::HTTPOK
@@ -1,3 +1,3 @@
1
1
  module TestCentricityMobile
2
- VERSION = '4.0.1'
2
+ VERSION = '4.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.3
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: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 4.18.1
215
+ version: 4.19.0
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 4.18.1
222
+ version: 4.19.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: test-unit
225
225
  requirement: !ruby/object:Gem::Requirement