Skip to content

Commit 394eb78

Browse files
authored
Screenshot: More flakiness fixes and fastlane update (#14492)
2 parents 2c45b02 + ee16ae9 commit 394eb78

File tree

4 files changed

+31
-37
lines changed

4 files changed

+31
-37
lines changed

WooCommerce/WooCommerceScreenshots/WooCommerceScreenshots.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class WooCommerceScreenshots: XCTestCase {
4242

4343
return false
4444
}
45-
app.tap()
4645

4746
try MyStoreScreen()
4847

Yosemite/Yosemite/Model/Mocks/ActionHandlers/MockActionHandler.swift

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,22 @@ extension MockActionHandler {
3838
/// A helper for saving mock objects into Core Data
3939
func save<T, U>(mocks: [T], as dataType: U.Type, onCompletion: @escaping (Error?) -> ()) where U: ReadOnlyConvertible & NSManagedObject {
4040

41-
var error: Error?
42-
43-
let storage = storageManager.viewStorage
44-
45-
storage.perform {
41+
storageManager.performAndSave({ storage in
4642
let objects: [NSManagedObject] = mocks.map {
4743
let newObject = storage.insertNewObject(ofType: U.self)
4844
newObject.update(with: $0 as! U.ReadOnlyType)
4945
return newObject
5046
}
5147

52-
do {
53-
try storage.obtainPermanentIDs(for: objects)
48+
// Obtain permanent IDs inside the same block
49+
try storage.obtainPermanentIDs(for: objects)
50+
}, completion: { result in
51+
switch result {
52+
case .success:
53+
onCompletion(nil)
54+
case .failure(let error):
55+
onCompletion(error)
5456
}
55-
catch let err {
56-
error = err
57-
}
58-
}
59-
60-
storageManager.saveDerivedType(derivedStorage: storage) {
61-
onCompletion(error)
62-
}
57+
}, on: .main)
6358
}
6459
}

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FASTLANE_METADATA_FOLDER = File.join(FASTLANE_DIR, 'metadata')
2626
WORKSPACE_PATH = File.join(PROJECT_ROOT_FOLDER, 'WooCommerce.xcworkspace')
2727
BUILDKITE_RELEASE_PIPELINE = 'release-builds.yml'
2828
IOS_LOCALES = %w[ar de-DE en-US es-ES fr-FR he id it ja ko nl-NL pt-BR ru sv tr zh-Hans zh-Hant].freeze
29-
SIMULATOR_VERSION = '15.5' # For screenshots
29+
SIMULATOR_VERSION = '16.0' # For screenshots
3030
SCREENSHOTS_SCHEME = 'WooCommerceScreenshots'
3131
SCREENSHOT_DEVICES = [
3232
'iPhone 11 Pro Max',

fastlane/screenshots.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,39 @@
6363
"filename": "iPhone 11 Pro Max-01.png",
6464
"background": "#674399",
6565
"screenshot": "iPhone 11 Pro Max-1-dark-order-dashboard.png",
66-
"text": "metadata/{locale}/app_store_screenshot_1.txt"
66+
"text": "metadata/{locale}/promo_screenshot_1.txt"
6767
},
6868
// Create orders on the fly
6969
{
7070
"device": "iPhone 11 Pro Max",
7171
"filename": "iPhone 11 Pro Max-02.png",
7272
"background": "#C9356E",
7373
"screenshot": "iPhone 11 Pro Max-2-light-order-creation.png",
74-
"text": "metadata/{locale}/app_store_screenshot_2.txt"
74+
"text": "metadata/{locale}/promo_screenshot_2.txt"
7575
},
7676
// Take payments in person
7777
{
7878
"device": "iPhone 11 Pro Max",
7979
"filename": "iPhone 11 Pro Max-03.png",
8080
"background": "#674399",
8181
"screenshot": "iPhone 11 Pro Max-3-dark-order-payment.png",
82-
"text": "metadata/{locale}/app_store_screenshot_3.txt"
82+
"text": "metadata/{locale}/promo_screenshot_3.txt"
8383
},
8484
// Add and edit products with a touch
8585
{
8686
"device": "iPhone 11 Pro Max",
8787
"filename": "iPhone 11 Pro Max-04.png",
8888
"background": "#C9356E",
8989
"screenshot": "iPhone 11 Pro Max-4-light-product-add.png",
90-
"text": "metadata/{locale}/app_store_screenshot_4.txt"
90+
"text": "metadata/{locale}/promo_screenshot_4.txt"
9191
},
9292
// Get notified of every sale
9393
{
9494
"device": "iPhone 11 Pro Max",
9595
"filename": "iPhone 11 Pro Max-05.png",
9696
"background": "#674399",
9797
"screenshot": "iPhone 11 Pro Max-5-dark-order-notification.png",
98-
"text": "metadata/{locale}/app_store_screenshot_5.txt"
98+
"text": "metadata/{locale}/promo_screenshot_5.txt"
9999
},
100100

101101
// iPhone 8 Plus
@@ -105,39 +105,39 @@
105105
"filename": "iPhone 8 Plus-01.png",
106106
"background": "#674399",
107107
"screenshot": "iPhone 8 Plus-1-dark-order-dashboard.png",
108-
"text": "metadata/{locale}/app_store_screenshot_1.txt"
108+
"text": "metadata/{locale}/promo_screenshot_1.txt"
109109
},
110110
// Create orders on the fly
111111
{
112112
"device": "iPhone 8 Plus",
113113
"filename": "iPhone 8 Plus-02.png",
114114
"background": "#C9356E",
115115
"screenshot": "iPhone 8 Plus-2-light-order-creation.png",
116-
"text": "metadata/{locale}/app_store_screenshot_2.txt"
116+
"text": "metadata/{locale}/promo_screenshot_2.txt"
117117
},
118118
// Take payments in person
119119
{
120120
"device": "iPhone 8 Plus",
121121
"filename": "iPhone 8 Plus-03.png",
122122
"background": "#674399",
123123
"screenshot": "iPhone 8 Plus-3-dark-order-payment.png",
124-
"text": "metadata/{locale}/app_store_screenshot_3.txt"
124+
"text": "metadata/{locale}/promo_screenshot_3.txt"
125125
},
126126
// Add and edit products with a touch
127127
{
128128
"device": "iPhone 8 Plus",
129129
"filename": "iPhone 8 Plus-04.png",
130130
"background": "#C9356E",
131131
"screenshot": "iPhone 8 Plus-4-light-product-add.png",
132-
"text": "metadata/{locale}/app_store_screenshot_4.txt"
132+
"text": "metadata/{locale}/promo_screenshot_4.txt"
133133
},
134134
// Get notified of every sale
135135
{
136136
"device": "iPhone 8 Plus",
137137
"filename": "iPhone 8 Plus-05.png",
138138
"background": "#674399",
139139
"screenshot": "iPhone 8 Plus-5-dark-order-notification.png",
140-
"text": "metadata/{locale}/app_store_screenshot_5.txt"
140+
"text": "metadata/{locale}/promo_screenshot_5.txt"
141141
},
142142

143143

@@ -148,39 +148,39 @@
148148
"filename": "iPad Pro (12.9-inch) (2nd generation)-01.png",
149149
"background": "#674399",
150150
"screenshot": "iPad Pro (12.9-inch) (2nd generation)-1-dark-order-dashboard.png",
151-
"text": "metadata/{locale}/app_store_screenshot_1.txt"
151+
"text": "metadata/{locale}/promo_screenshot_1.txt"
152152
},
153153
// Create orders on the fly
154154
{
155155
"device": "iPad Pro 12.9 (2nd Generation)",
156156
"filename": "iPad Pro (12.9-inch) (2nd generation)-02.png",
157157
"background": "#C9356E",
158158
"screenshot": "iPad Pro (12.9-inch) (2nd generation)-2-light-order-creation.png",
159-
"text": "metadata/{locale}/app_store_screenshot_2.txt"
159+
"text": "metadata/{locale}/promo_screenshot_2.txt"
160160
},
161161
// Take payments in person
162162
{
163163
"device": "iPad Pro 12.9 (2nd Generation)",
164164
"filename": "iPad Pro (12.9-inch) (2nd generation)-03.png",
165165
"background": "#674399",
166166
"screenshot": "iPad Pro (12.9-inch) (2nd generation)-3-dark-order-payment.png",
167-
"text": "metadata/{locale}/app_store_screenshot_3.txt"
167+
"text": "metadata/{locale}/promo_screenshot_3.txt"
168168
},
169169
// Add and edit products with a touch
170170
{
171171
"device": "iPad Pro 12.9 (2nd Generation)",
172172
"filename": "iPad Pro (12.9-inch) (2nd generation)-04.png",
173173
"background": "#C9356E",
174174
"screenshot": "iPad Pro (12.9-inch) (2nd generation)-4-light-product-add.png",
175-
"text": "metadata/{locale}/app_store_screenshot_4.txt"
175+
"text": "metadata/{locale}/promo_screenshot_4.txt"
176176
},
177177
// Get notified of every sale
178178
{
179179
"device": "iPad Pro 12.9 (2nd Generation)",
180180
"filename": "iPad Pro (12.9-inch) (2nd generation)-05.png",
181181
"background": "#674399",
182182
"screenshot": "iPad Pro (12.9-inch) (2nd generation)-5-dark-order-notification.png",
183-
"text": "metadata/{locale}/app_store_screenshot_5.txt"
183+
"text": "metadata/{locale}/promo_screenshot_5.txt"
184184
},
185185

186186
/// iPad Pro 12.9 (3rd Generation)
@@ -190,39 +190,39 @@
190190
"filename": "iPad Pro (12.9-inch) (3rd generation)-01.png",
191191
"background": "#674399",
192192
"screenshot": "iPad Pro (12.9-inch) (3rd generation)-1-dark-order-dashboard.png",
193-
"text": "metadata/{locale}/app_store_screenshot_1.txt"
193+
"text": "metadata/{locale}/promo_screenshot_1.txt"
194194
},
195195
// Create orders on the fly
196196
{
197197
"device": "iPad Pro 12.9 (3rd Generation)",
198198
"filename": "iPad Pro (12.9-inch) (3rd generation)-02.png",
199199
"background": "#C9356E",
200200
"screenshot": "iPad Pro (12.9-inch) (3rd generation)-2-light-order-creation.png",
201-
"text": "metadata/{locale}/app_store_screenshot_2.txt"
201+
"text": "metadata/{locale}/promo_screenshot_2.txt"
202202
},
203203
// Take payments in person
204204
{
205205
"device": "iPad Pro 12.9 (3rd Generation)",
206206
"filename": "iPad Pro (12.9-inch) (3rd generation)-03.png",
207207
"background": "#674399",
208208
"screenshot": "iPad Pro (12.9-inch) (3rd generation)-3-dark-order-payment.png",
209-
"text": "metadata/{locale}/app_store_screenshot_3.txt"
209+
"text": "metadata/{locale}/promo_screenshot_3.txt"
210210
},
211211
// Add and edit products with a touch
212212
{
213213
"device": "iPad Pro 12.9 (3rd Generation)",
214214
"filename": "iPad Pro (12.9-inch) (3rd generation)-04.png",
215215
"background": "#C9356E",
216216
"screenshot": "iPad Pro (12.9-inch) (3rd generation)-4-light-product-add.png",
217-
"text": "metadata/{locale}/app_store_screenshot_4.txt"
217+
"text": "metadata/{locale}/promo_screenshot_4.txt"
218218
},
219219
// Get notified of every sale
220220
{
221221
"device": "iPad Pro 12.9 (3rd Generation)",
222222
"filename": "iPad Pro (12.9-inch) (3rd generation)-05.png",
223223
"background": "#674399",
224224
"screenshot": "iPad Pro (12.9-inch) (3rd generation)-5-dark-order-notification.png",
225-
"text": "metadata/{locale}/app_store_screenshot_5.txt"
225+
"text": "metadata/{locale}/promo_screenshot_5.txt"
226226
}
227227
]
228228
}

0 commit comments

Comments
 (0)