mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 07:17:32 +09:00
Dactyloidae iOS initial commit
This commit is contained in:
parent
daa6179d22
commit
7154a0497e
2123 changed files with 197052 additions and 0 deletions
39
mobile/ios/UITests/NavigationDelegateTests.swift
Normal file
39
mobile/ios/UITests/NavigationDelegateTests.swift
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* 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 Foundation
|
||||
import EarlGrey
|
||||
@testable import Client
|
||||
|
||||
// WKWebView's WKNavigationDelegate is used for custom URL handling
|
||||
// such as telephone links, app store links, etc.
|
||||
|
||||
class NavigationDelegateTests: KIFTestCase {
|
||||
fileprivate var webRoot: String!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
webRoot = SimplePageServer.start()
|
||||
BrowserUtils.dismissFirstRunUI()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
BrowserUtils.resetToAboutHome(tester())
|
||||
BrowserUtils.clearPrivateData(tester: tester())
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func enterUrl(url: String) {
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityID("url")).perform(grey_tap())
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityID("address")).perform(grey_replaceText(url))
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityID("address")).perform(grey_typeText("\n"))
|
||||
}
|
||||
|
||||
func testAppStoreLinkShowsConfirmation() {
|
||||
let url = "\(webRoot!)/navigationDelegate.html"
|
||||
enterUrl(url: url)
|
||||
tester().tapWebViewElementWithAccessibilityLabel("link")
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityID("CancelOpenInAppStore")).perform(grey_tap())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue