mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Dactyloidae iOS initial commit
This commit is contained in:
parent
daa6179d22
commit
7154a0497e
2123 changed files with 197052 additions and 0 deletions
56
mobile/ios/UITests/BrowserTests.swift
Normal file
56
mobile/ios/UITests/BrowserTests.swift
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/* 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 Storage
|
||||
import EarlGrey
|
||||
@testable import Client
|
||||
|
||||
class BrowserTests: KIFTestCase {
|
||||
|
||||
private 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()
|
||||
}
|
||||
|
||||
// Disabled with https://bugzilla.mozilla.org/show_bug.cgi?id=1409851
|
||||
func testDisplaySharesheetWhileJSPromptOccurs() {
|
||||
let url = "\(webRoot!)/JSPrompt.html"
|
||||
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"))
|
||||
tester().waitForWebViewElementWithAccessibilityLabel("JS Prompt")
|
||||
//EarlGrey.select(elementWithMatcher: grey_kindOfClass(NSClassFromString("_UIAlertControllerInterfaceActionGroupView")!))
|
||||
// .assert(grey_sufficientlyVisible())
|
||||
|
||||
// Show share sheet and wait for the JS prompt to fire
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("Share")).perform(grey_tap())
|
||||
|
||||
if BrowserUtils.iPad() {
|
||||
// iPad does not have cancel btn to close dialog
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("Share")).perform(grey_tap())
|
||||
} else {
|
||||
let matcher = grey_allOf([grey_accessibilityLabel("Cancel"),
|
||||
grey_accessibilityTrait(UIAccessibilityTraitButton),
|
||||
grey_sufficientlyVisible()])
|
||||
EarlGrey.select(elementWithMatcher: matcher).perform(grey_tap())
|
||||
}
|
||||
|
||||
// Check to see if the JS Prompt is dequeued and showing
|
||||
tester().waitForView(withAccessibilityLabel: "OK")
|
||||
EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("OK"))
|
||||
.inRoot(grey_kindOfClass(NSClassFromString("_UIAlertControllerActionView")!))
|
||||
.assert(grey_enabled())
|
||||
.perform((grey_tap()))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue