forked from fastlane/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapshot.js
31 lines (21 loc) · 918 Bytes
/
snapshot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "SnapshotHelper.js"
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
var path = "./screenshots.json"
var result = target.host().performTaskWithPathArgumentsTimeout("/bin/cat" , [path], 5);
var config = result.stdout
UIALogger.logStart("Logging element " + config)
var json = JSON.parse(config)
UIALogger.logStart("Logging element " + json)
target.delay(5)
captureLocalizedScreenshot("01MainMenu")
window.tableViews()[0].cells()["sidebar" + json["sidebarListItemIndex"]].tap();
target.delay(1);
captureLocalizedScreenshot("02List")
window.tableViews()[1].cells()["list" + json["listDetailViewIndex"]].tap()
target.delay(1);
captureLocalizedScreenshot("03ListDetails")
target.frontMostApp().navigationBar().leftButton().tap();
target.delay(0.5);
target.frontMostApp().navigationBar().leftButton().tap();