mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 15:57: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
52
mobile/ios/XCUITests/SiteLoadTest.swift
Normal file
52
mobile/ios/XCUITests/SiteLoadTest.swift
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* 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
|
||||
|
||||
// NOTE: This test should be DISABLED on XCUITEST/UITEST scheme. This test should be run in conjunction with
|
||||
// XCode Profiler to measure the memory/CPU load
|
||||
class SiteLoadTest: BaseTestCase {
|
||||
|
||||
var navigator: Navigator!
|
||||
var app: XCUIApplication!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
app = XCUIApplication()
|
||||
navigator = createScreenGraph(app).navigator(self)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testLoadSite() {
|
||||
|
||||
let site = ["http://www.forbes.com", "http://www.amazon.com", "http://theguardian.com", "http://www.reddit.com", "http://cnn.com"]
|
||||
let durationInHrs = 1
|
||||
let futureDate = Date().addingTimeInterval(TimeInterval(60 * 60 * durationInHrs))
|
||||
var counter = 0
|
||||
while Date() < futureDate {
|
||||
navigator.goto(URLBarOpen)
|
||||
navigator.openURL(urlString: site[counter % 5])
|
||||
sleep(5)
|
||||
|
||||
navigator.nowAt(BrowserTab)
|
||||
navigator.goto(TabTray)
|
||||
|
||||
navigator.closeAllTabs()
|
||||
navigator.goto(BrowserTab)
|
||||
waitforNoExistence(app.staticTexts["1 tab(s) closed"])
|
||||
|
||||
// clear the cache
|
||||
navigator.goto(ClearPrivateDataSettings)
|
||||
app.tables.staticTexts["Clear Private Data"].tap()
|
||||
waitforExistence(app.alerts.buttons["OK"])
|
||||
app.alerts.buttons["OK"].tap()
|
||||
navigator.goto(BrowserTab)
|
||||
waitforExistence(app.textFields["url"])
|
||||
counter += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue