fastlane-plugin-snapshot_test 0.2.2 → 0.2.3
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/LICENSE +1 -1
- data/README.md +12 -0
- data/lib/fastlane/plugin/snapshot_test/actions/compatibility/screenshot_notifier.rb +15 -0
- data/lib/fastlane/plugin/snapshot_test/actions/regression/compare_snapshot.rb +31 -15
- data/lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb +10 -0
- data/lib/fastlane/plugin/snapshot_test/actions/take_screenshot.rb +25 -0
- data/lib/fastlane/plugin/snapshot_test/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1188ae451fe6c78b6970a1a5fa6c42671b48059e586a8acf11d4288a89b3e8b
|
4
|
+
data.tar.gz: 9604828f6e2a7c1698924af5b4aaada7dc9245334b981a0ad10bd4c4d288bfea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59978bdbdc886ea6afe9202064490ca43f12a401597f0df89c6ffd622f87e06e54c909fe1b3786326d78a5698d6b4976a2c89532bceb441d465b66694e06508e
|
7
|
+
data.tar.gz: 42e652f5cf57d497238a7fcb8ea39b0f44c1a5fc61b76c5b23d9dc4ef62a76ead3dfa3cb765543b768afde19de14eac610bbf15134836ec3dbad191715b18b0b
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2019
|
3
|
+
Copyright (c) 2019 CyberAgent, Inc.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -20,6 +20,18 @@ compare screenshots with previous commit's screenshots.
|
|
20
20
|
|
21
21
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
22
|
|
23
|
+
In case of `screenshot_dir` like below,
|
24
|
+
|
25
|
+
```
|
26
|
+
.screenshot
|
27
|
+
├ Nexus6
|
28
|
+
| ├ MainPage.jpg
|
29
|
+
| └ SubPage.jpg
|
30
|
+
└ Nexus6P
|
31
|
+
├ MainPage.jpg
|
32
|
+
└ SubPage.jpg
|
33
|
+
```
|
34
|
+
|
23
35
|
## Run tests for this plugin
|
24
36
|
|
25
37
|
To run both the tests, and code style validation, run
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fastlane/action'
|
2
|
+
|
2
3
|
require_relative '../../helper/helper'
|
3
4
|
|
4
5
|
module Fastlane
|
@@ -160,6 +161,20 @@ module Fastlane
|
|
160
161
|
def self.is_supported?(platform)
|
161
162
|
platform == :android
|
162
163
|
end
|
164
|
+
|
165
|
+
def self.example_code
|
166
|
+
['screenshot_notifier(
|
167
|
+
gcloud_service_key_file: "fastlane/client-secret.json",
|
168
|
+
screenshot_bucket: "cats-firebase",
|
169
|
+
screenshot_dir: ".screenshot",
|
170
|
+
github_owner: "cats-oss",
|
171
|
+
github_repository: "android",
|
172
|
+
github_pr_number: ENV["CI_PULL_REQUEST"][/(?<=https:\/\/github.com\/cats-oss\/android\/pull\/)(.*)/],
|
173
|
+
github_api_token: ENV["DANGER_GITHUB_API_TOKEN"],
|
174
|
+
image_length: 100
|
175
|
+
)']
|
176
|
+
end
|
177
|
+
|
163
178
|
end
|
164
179
|
end
|
165
180
|
end
|
@@ -49,17 +49,17 @@ module Fastlane
|
|
49
49
|
bucket = params[:snapshot_bucket]
|
50
50
|
commit_hash = Helper.get_current_commit_hash
|
51
51
|
|
52
|
-
message =
|
53
|
-
## Snapshot Test Result
|
54
|
-
Commit Hash: #{commit_hash}
|
52
|
+
message = <<~EOS
|
53
|
+
## Snapshot Test Result
|
54
|
+
Commit Hash: #{commit_hash}
|
55
55
|
|
56
|
-
#{summary_table(result[:new_items], result[:deleted_items], result[:changed_items], result[:passed_items])}
|
56
|
+
#{summary_table(result[:new_items], result[:deleted_items], result[:changed_items], result[:passed_items])}
|
57
57
|
|
58
|
-
#{changed_items_table(result[:changed_items], bucket, commit_hash, params[:working_dir], params[:image_length])}
|
58
|
+
#{changed_items_table(result[:changed_items], bucket, commit_hash, params[:working_dir], params[:image_length])}
|
59
59
|
|
60
|
-
#{new_items_table(result[:new_items], bucket, commit_hash, params[:working_dir], params[:image_length])}
|
60
|
+
#{new_items_table(result[:new_items], bucket, commit_hash, params[:working_dir], params[:image_length])}
|
61
61
|
|
62
|
-
#{deleted_items_list(result[:deleted_items])}
|
62
|
+
#{deleted_items_list(result[:deleted_items])}
|
63
63
|
EOS
|
64
64
|
|
65
65
|
GitHubNotifier.fold_comments(
|
@@ -80,14 +80,14 @@ Commit Hash: #{commit_hash}
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def self.summary_table(new_items, deleted_items, changed_items, passed_items)
|
83
|
-
|
84
|
-
### Summary
|
85
|
-
| | Count |
|
86
|
-
| --- | --- |
|
87
|
-
| New Screenshots | #{new_items.size} |
|
88
|
-
| Deleted Screenshots | #{deleted_items.size} |
|
89
|
-
| Changed Screenshots | #{changed_items.size} |
|
90
|
-
| Passed Screenshots | #{passed_items.size} |
|
83
|
+
<<~EOS
|
84
|
+
### Summary
|
85
|
+
| | Count |
|
86
|
+
| --- | --- |
|
87
|
+
| New Screenshots | #{new_items.size} |
|
88
|
+
| Deleted Screenshots | #{deleted_items.size} |
|
89
|
+
| Changed Screenshots | #{changed_items.size} |
|
90
|
+
| Passed Screenshots | #{passed_items.size} |
|
91
91
|
EOS
|
92
92
|
end
|
93
93
|
|
@@ -222,6 +222,22 @@ Commit Hash: #{commit_hash}
|
|
222
222
|
def self.is_supported?(platform)
|
223
223
|
true
|
224
224
|
end
|
225
|
+
|
226
|
+
def self.example_code
|
227
|
+
['pr_number = ENV["CI_PULL_REQUEST"] != nil ? ENV["CI_PULL_REQUEST"][/(?<=https:\/\/github.com\/cats-oss\/android\/pull\/)(.*)/] : nil
|
228
|
+
compare_snapshot(
|
229
|
+
gcloud_service_key_file: "fastlane/client-secret.json",
|
230
|
+
snapshot_bucket: "cats-android-snapshot",
|
231
|
+
working_dir: ".snapshot_test",
|
232
|
+
screenshot_dir: ".screenshot/shamu-22-ja_JP-portrait",
|
233
|
+
github_owner: "cats-oss",
|
234
|
+
github_repository: "android",
|
235
|
+
github_pr_number: pr_number,
|
236
|
+
github_api_token: ENV["DANGER_GITHUB_API_TOKEN"],
|
237
|
+
image_length: 100
|
238
|
+
)']
|
239
|
+
end
|
240
|
+
|
225
241
|
end
|
226
242
|
end
|
227
243
|
end
|
@@ -58,6 +58,16 @@ module Fastlane
|
|
58
58
|
def self.is_supported?(platform)
|
59
59
|
true
|
60
60
|
end
|
61
|
+
|
62
|
+
def self.example_code
|
63
|
+
['upload_snapshot(
|
64
|
+
gcloud_service_key_file: "fastlane/client-secret.json",
|
65
|
+
snapshot_bucket: "cats-android-snapshot",
|
66
|
+
working_dir: ".snapshot_test",
|
67
|
+
screenshot_dir: ".screenshot/shamu-22-ja_JP-portrait"
|
68
|
+
)']
|
69
|
+
end
|
70
|
+
|
61
71
|
end
|
62
72
|
end
|
63
73
|
end
|
@@ -116,6 +116,31 @@ module Fastlane
|
|
116
116
|
hash_obj[property] = default
|
117
117
|
end
|
118
118
|
end
|
119
|
+
|
120
|
+
def self.example_code
|
121
|
+
['take_screenshot(
|
122
|
+
project_id: "cats-firebase",
|
123
|
+
gcloud_service_key_file: "fastlane/client-secret.json",
|
124
|
+
devices: [
|
125
|
+
{
|
126
|
+
model: "shamu",
|
127
|
+
version: "22",
|
128
|
+
locale: "ja_JP",
|
129
|
+
orientation: "portrait"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
model: "Pixel2",
|
133
|
+
version: "28"
|
134
|
+
}
|
135
|
+
],
|
136
|
+
app_apk: "tools/app-snapshot-debug.apk",
|
137
|
+
app_test_apk: "app/build/outputs/apk/androidTest/snapshot/debug/installedapp-snapshot-debug-androidTest.apk",
|
138
|
+
firebase_test_lab_results_bucket: "cats-android-firebase-instrumented-test",
|
139
|
+
timeout: "10m",
|
140
|
+
download_dir: ".screenshot"
|
141
|
+
)']
|
142
|
+
end
|
143
|
+
|
119
144
|
end
|
120
145
|
end
|
121
146
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-snapshot_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moyuru Aizawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|