mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 00: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
65
mobile/ios/XCUITests/NoImageTests.swift
Normal file
65
mobile/ios/XCUITests/NoImageTests.swift
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/* 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 NoImageTests: BaseTestCase {
|
||||
|
||||
var navigator: Navigator!
|
||||
var app: XCUIApplication!
|
||||
static let NoImageButtonIdentifier = "menu-NoImageMode"
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
app = XCUIApplication()
|
||||
navigator = createScreenGraph(app).navigator(self)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
navigator = nil
|
||||
app = nil
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
private func showImages() {
|
||||
navigator.goto(BrowserTabMenu)
|
||||
app.tables["Context Menu"].cells["menu-NoImageMode"].tap()
|
||||
navigator.nowAt(BrowserTab)
|
||||
}
|
||||
|
||||
private func hideImages() {
|
||||
navigator.goto(BrowserTabMenu)
|
||||
app.tables["Context Menu"].cells["menu-NoImageMode"].tap()
|
||||
navigator.nowAt(BrowserTab)
|
||||
}
|
||||
|
||||
private func checkShowImages() {
|
||||
navigator.goto(BrowserTabMenu)
|
||||
waitforExistence(app.tables["Context Menu"].cells["menu-NoImageMode"])
|
||||
XCTAssertTrue(app.tables["Context Menu"].cells["menu-NoImageMode"].staticTexts["Show Images"].exists)
|
||||
navigator.goto(BrowserTab)
|
||||
}
|
||||
|
||||
private func checkHideImages() {
|
||||
navigator.goto(BrowserTabMenu)
|
||||
waitforExistence(app.tables["Context Menu"].cells["menu-NoImageMode"])
|
||||
XCTAssertTrue(app.tables["Context Menu"].cells["menu-NoImageMode"].staticTexts["Hide Images"].exists)
|
||||
navigator.goto(BrowserTab)
|
||||
}
|
||||
|
||||
// Functionality is tested by UITests/NoImageModeTests, here only the UI is updated properly
|
||||
func testImageOnOff() {
|
||||
// Go to a webpage, and select no images or hide images, check it's hidden or not
|
||||
navigator.openNewURL(urlString: "www.google.com")
|
||||
waitUntilPageLoad()
|
||||
|
||||
// Select hide images, and check the UI is updated
|
||||
hideImages()
|
||||
checkShowImages()
|
||||
|
||||
// Select show images, and check the UI is updated
|
||||
showImages()
|
||||
checkHideImages()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue