Mercurial > public > simoleon
comparison SimoleonAppPreview/SimoleonAppPreview.swift @ 148:23395b98a921
Add app preview interaction
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 18 Aug 2021 11:17:31 +0100 |
parents | 4271fb5f69e2 |
children |
comparison
equal
deleted
inserted
replaced
147:cbf8a128462e | 148:23395b98a921 |
---|---|
24 } | 24 } |
25 | 25 |
26 func recordInteraction(of app: XCUIApplication) { | 26 func recordInteraction(of app: XCUIApplication) { |
27 app.launch() | 27 app.launch() |
28 | 28 |
29 // Write amount in textfield | 29 /* |
30 * Type amount to convert | |
31 * Click 'Done' to dismiss keyboard | |
32 */ | |
30 app.textFields["ConversionTextField"].tap() | 33 app.textFields["ConversionTextField"].tap() |
31 app.keys["4"].tap() | 34 app.keys["4"].tap() |
32 app.keys["5"].tap() | 35 app.keys["5"].tap() |
33 app.keys["0"].tap() | 36 app.keys["0"].tap() |
34 app.keys["0"].tap() | 37 app.keys["0"].tap() |
35 app.keys["0"].tap() | 38 app.keys["0"].tap() |
36 | 39 |
37 // Tap done to dismiss keyboard | 40 // Tap done to dismiss keyboard |
38 app.navigationBars.buttons.element(boundBy: 0).tap() | 41 app.navigationBars.buttons.element(boundBy: 0).tap() |
39 | 42 |
40 // Open currency selector and select USD/BTC | 43 /* |
44 * Open currency selector | |
45 * Select USD/BTC | |
46 */ | |
41 app.scrollViews.buttons["OpenCurrencySelector"].tap() | 47 app.scrollViews.buttons["OpenCurrencySelector"].tap() |
42 let currencySearchBar = app.textFields["CurrencySearchBar"] | 48 let currencySearchBar = app.textFields["CurrencySearchBar"] |
43 currencySearchBar.tap() | 49 currencySearchBar.tap() |
44 currencySearchBar.typeText("Usd/btc\n") | 50 currencySearchBar.typeText("Usd/btc\n") |
45 sleep(1) | 51 sleep(1) |
46 app.tables.buttons.firstMatch.tap() | 52 app.tables.buttons.firstMatch.tap() |
47 sleep(2) | 53 sleep(2) |
54 | |
55 /* | |
56 * Go to favorite view | |
57 * Open XAG/CAD | |
58 * Convert 100 ounce to CAD | |
59 * Go back to favorite | |
60 * Delete XAG to CAD | |
61 */ | |
62 app.tabBars.buttons.element(boundBy: 1).tap() | |
63 let favoritesList = app.tables["FavoritesList"].cells | |
64 sleep(1) | |
65 let xagToCad = favoritesList.element(boundBy: 7) | |
66 xagToCad.tap() | |
67 sleep(2) | |
68 | |
69 // Convert 100 ounce to CAD | |
70 app.textFields["ConversionTextField"].tap() | |
71 app.keys["1"].tap() | |
72 app.keys["0"].tap() | |
73 app.keys["0"].tap() | |
74 sleep(2) | |
75 | |
76 // Tap done to dismiss keyboard | |
77 app.navigationBars.buttons.element(boundBy: 1).tap() | |
78 | |
79 // Go back | |
80 app.navigationBars.buttons.element(boundBy: 0).tap() | |
81 sleep(1) | |
82 | |
83 // Delete row from favorites | |
84 xagToCad.swipeLeft() | |
85 xagToCad.buttons.firstMatch.tap() | |
48 } | 86 } |
49 | 87 |
50 func testUSEnglish() throws { | 88 func testUSEnglish() throws { |
51 let app = XCUIApplication() | 89 let app = XCUIApplication() |
52 app.launchArguments += ["-AppleLanguages", "(en-US)"] | 90 app.launchArguments += ["-AppleLanguages", "(en-US)"] |