Skip to content

Commit

Permalink
Hardcoded the UITest URI. Small script to execute the screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermanns committed Apr 23, 2020
1 parent dc6cdc1 commit 55d8e59
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
2 changes: 2 additions & 0 deletions fastlaneScreenshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
bundle exec fastlane ios screenshots
2 changes: 1 addition & 1 deletion nightguard WatchKit App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>521</string>
<string>522</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
2 changes: 1 addition & 1 deletion nightguard WatchKit Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>521</string>
<string>522</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>CLKComplicationSupportedFamilies</key>
Expand Down
4 changes: 2 additions & 2 deletions nightguard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@
CODE_SIGN_ENTITLEMENTS = nightguard/scoutwatch.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 529;
CURRENT_PROJECT_VERSION = 530;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -1822,7 +1822,7 @@
CODE_SIGN_ENTITLEMENTS = nightguard/scoutwatch.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 529;
CURRENT_PROJECT_VERSION = 530;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
ENABLE_BITCODE = YES;
Expand Down
2 changes: 1 addition & 1 deletion nightguard/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>521</string>
<string>522</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
4 changes: 2 additions & 2 deletions nightguard/XCUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ extension XCUIElement {
func clearText(andReplaceWith newText:String? = nil) {

let myValue = self.value
guard let stringValue = self.value as? String else {
guard let stringValue = myValue as? String else {
XCTFail("Tried to clear and enter text into a non string value")
return
}
self.tap()
//self.tap()
let deleteString = String(repeating: XCUIKeyboardKey.delete.rawValue, count: stringValue.count)
self.typeText(deleteString)

Expand Down
2 changes: 1 addition & 1 deletion nightguardTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>521</string>
<string>522</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion nightguardUITests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>521</string>
<string>522</string>
</dict>
</plist>
11 changes: 6 additions & 5 deletions nightguardUITests/scoutwatchUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,31 @@ class scoutwatchUITests: XCTestCase {
let tabBarsQuery = app.tabBars
XCTAssertEqual(tabBarsQuery.buttons.count, 4)

// Enter the Test-URL
/* Enter the Test-URL
tabBarsQuery.buttons["Preferences"].tap()
let tablecells = app.tables.cells
let urlTextField = tablecells.containing(.staticText, identifier:"URL").children(matching: .textField).element
urlTextField.clearText(andReplaceWith: "http://night.fritz.box")
urlTextField.clearText(andReplaceWith: "http://night.fritz.box")*/

tabBarsQuery.buttons["Main"].tap()
snapshot("01-main")

tabBarsQuery.buttons["Alarms"].tap()
snapshot("02-alarms")

tabBarsQuery.buttons["Stats"].tap()
if UIDevice.current.userInterfaceIdiom == .phone {
// only on a phone is a rotation needed if using the statistics panel
XCUIDevice.shared.orientation = .landscapeLeft
}
tabBarsQuery.buttons["Stats"].tap()
sleep(10)
sleep(3)
snapshot("03-stats")

tabBarsQuery.buttons["Preferences"].tap()
if UIDevice.current.userInterfaceIdiom == .phone {
XCUIDevice.shared.orientation = .portrait
}
tabBarsQuery.buttons["Preferences"].tap()
sleep(1)
snapshot("04-preferences")
}

Expand Down

0 comments on commit 55d8e59

Please sign in to comment.