Dactyloidae iOS initial commit

This commit is contained in:
wuggy 2026-06-26 21:04:09 -07:00
commit 7154a0497e
2123 changed files with 197052 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>10.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View file

@ -0,0 +1,118 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import XCTest
class MarketingSnapshotTests: XCTestCase {
let LoadingTimeout: NSTimeInterval = 60
let exists = NSPredicate(format: "exists = true")
let loaded = NSPredicate(format: "value BEGINSWITH '100'")
var sleep = false
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
let app = XCUIApplication()
setupSnapshot(app)
app.launch()
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func loadWebPage(url: String, testForAutocompleteDialog: Bool = false) {
let app = XCUIApplication()
let addressTextField = app.textFields.elementBoundByIndex(0)
addressTextField.tap()
addressTextField.typeText(url)
if testForAutocompleteDialog {
// for var idx:UInt = 0; idx < app.buttons.count; idx++ {
// let button = app.buttons.elementBoundByIndex(idx)
// print("\(button.identifier): \(button.value)")
// }
app.buttons.elementBoundByIndex(8).tap()
}
let progressIndicator = app.progressIndicators.elementBoundByIndex(0)
expectationForPredicate(exists, evaluatedWithObject: progressIndicator, handler: nil)
expectationForPredicate(loaded, evaluatedWithObject: progressIndicator, handler: nil)
app.typeText("\n")
waitForExpectations(timeout: LoadingTimeout, handler: nil)
}
func testTakeMarketingScreenshots() {
let app = XCUIApplication()
// dismiss the intro tour
app.buttons.elementBoundByIndex(1).tap()
snapshot("00TopSites")
// go to synced tabs home screen
app.buttons.elementBoundByIndex(4).tap()
snapshot("03SyncedTabs")
// return to top sites
app.buttons.elementBoundByIndex(1).tap()
// create new tab
app.staticTexts.firstWithName("1").tap()
let addTabButton = app.buttons.elementBoundByIndex(3)
addTabButton.tap()
// load some web pages in some new tabs
loadWebPage("http://twitter.com", testForAutocompleteDialog: true)
app.staticTexts.firstWithName("2").tap()
addTabButton.tap()
loadWebPage("https://mozilla.org/firefox/desktop")
app.staticTexts.firstWithName("3").tap()
addTabButton.tap()
loadWebPage("https://mozilla.org")
app.staticTexts.firstWithName("4").tap()
addTabButton.tap()
loadWebPage("firefox")
loadWebPage("https://mozilla.org/firefox/new")
app.staticTexts.firstWithName("5").tap()
snapshot("02TabTray")
// return to first tab
app.collectionViews.firstMatchingType(.Cell).tap()
let addressTextField = app.textFields.elementBoundByIndex(0)
addressTextField.tap()
// perform a search but don't complete (we're testing autocomplete here)
addressTextField.typeText("firef")
snapshot("01SearchResults")
// cancel search
app.buttons.elementBoundByIndex(1).tap()
}
}
extension XCUIElementQuery {
func firstWithName(name: String) -> XCUIElement {
let values = self.containingPredicate(NSPredicate(format: "label = '\(name)'"))
if values.count > 0 {
return values.elementBoundByIndex(0)
}
return self.elementBoundByIndex(0)
}
func firstMatchingType( type: XCUIElementType) -> XCUIElement {
return self.childrenMatchingType(type).elementBoundByIndex(0)
}
}