app_prism 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +64 -8
- data/lib/app_prism/screen_factory.rb +1 -1
- data/lib/app_prism/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc07056fa8b243c870129b1ca1a2dd71d0553164201109da9516e09557be520
|
4
|
+
data.tar.gz: d8ea6545b6e013187cd24d9cc3e043a228699521f600efb959b963736732b627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4842cff7e7f6cb99ba0499b28fb825200e1b58e4bdafdc167bcaf8b1c7baa8a22f54629e73bdf7eb095001f058a4008a7742c31731b14f288362af7be8589b9
|
7
|
+
data.tar.gz: f26422d4596c7698148fa95bcae0fca214c2104b53fd218a93f856420e1a7496ca763dcb1873124ff694ebdd86963e18f669f1f137c98656c0604da1672f1e07
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.3
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# AppPrsim
|
2
2
|
|
3
|
-
|
3
|
+
[](https://circleci.com/gh/bazarnyi/app_prism)
|
4
4
|
|
5
|
-
|
5
|
+
_A Multi-platform Page Object Model DSL for Appium_
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -14,7 +14,7 @@ gem 'app_prism'
|
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
$ bundle
|
17
|
+
$ bundle install
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
@@ -22,17 +22,73 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Here's an overview of how SitePrism is designed to be used:
|
26
26
|
|
27
|
-
|
27
|
+
```ruby
|
28
|
+
# define your app screens
|
29
|
+
|
30
|
+
class BaseScreen
|
31
|
+
include AppPrism
|
32
|
+
|
33
|
+
element :app_icon, android: { id: 'ViewActivityIntro_AppLogo' },
|
34
|
+
ios: { xpath: '//XCUIElementTypeIcon[@name="some name here"]' }
|
35
|
+
|
36
|
+
element :notification, android: { accessibility_id: 'NotificationShortLookView' },
|
37
|
+
ios: { accessibility_id: 'NotificationShortLookView' }
|
38
|
+
|
39
|
+
element :toolbar_done, android: { xpath: '//android.widget.LinearLayout[@content-desc="ViewActivityIntro_Toolbar"]/android.widget.TextView' },
|
40
|
+
ios: { xpath: '//XCUIElementTypeToolbar[@name="Toolbar"]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[@name="DONE" or @name="Done"]' }
|
41
|
+
|
42
|
+
def wheelpicker
|
43
|
+
@driver.find_elements(:class_name, 'XCUIElementTypePickerWheel').first
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class LogInScreen < BaseScreen
|
48
|
+
element :log_in_button, android: { id: 'ButtonRoundCorner_CustomImageView_Icon' },
|
49
|
+
ios: { accessibility_id: 'LOG IN' }
|
50
|
+
end
|
28
51
|
|
29
|
-
|
52
|
+
# define sections used on multiple screens or multiple times on one screen
|
30
53
|
|
31
|
-
|
54
|
+
class ScreenDialog < AppPrism::Sections::ScreenSection
|
55
|
+
element :title, android: { id: 'title' },
|
56
|
+
ios: { xpath: '//XCUIElementTypeStaticText[@name="Skip account"]' }
|
57
|
+
|
58
|
+
element :yes, android: { id: 'FragmentTwoButtonAlertDialog_Button_Positive' },
|
59
|
+
ios: { accessibility_id: 'Yes' }
|
60
|
+
|
61
|
+
element :no, android: { id: 'FragmentTwoButtonAlertDialog_Button_Negative' },
|
62
|
+
ios: { accessibility_id: 'No' }
|
63
|
+
end
|
64
|
+
|
65
|
+
# Basic usage in tests are very similar to usage of Site Prism gem for Web UI test automation
|
66
|
+
# the only difference is that page factory approach is used to better manage screens interractions
|
67
|
+
|
68
|
+
Given(/^I launch the app$/) do
|
69
|
+
if ios?
|
70
|
+
accept_ios_notification
|
71
|
+
else
|
72
|
+
wait_while_app_is_loading
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
Given(/^I swipe demo screens to the Sign in form$/) do
|
77
|
+
wait_for_activity_to_load 'IntroductionActivity' if android?
|
78
|
+
wait_for_element 'view pager', 'welcome'
|
79
|
+
6.times do
|
80
|
+
swipe 'left'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
Then(/^I see relevant skip sign in notification dialog$/) do
|
85
|
+
expect(on(WelcomeScreen).screen_dialog.title_element.text).to include 'some text'
|
86
|
+
end
|
87
|
+
```
|
32
88
|
|
33
89
|
## Contributing
|
34
90
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
91
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bazarnyi/app_prism. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
92
|
|
37
93
|
## License
|
38
94
|
|
data/lib/app_prism/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_prism
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denys Bazarnyi, Dmitriy Konovalov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
168
|
+
rubygems_version: 3.0.3
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Write a short summary, because RubyGems requires one.
|