Commit 2d0e66f7 authored by Carola Nitz's avatar Carola Nitz

Snapshots: Better curated snapshot content

Instead of downloading data we point to appdata on device to use
We switch to the song tab in Audio
parent 02b7d6b6
......@@ -254,7 +254,8 @@ class VLCMediaCategoryViewController: UICollectionViewController, UICollectionVi
}
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return IndicatorInfo(title:model.indicatorName)
let uiTestAccessibilityIdentifier = model is TrackModel ? VLCAccessibilityIdentifier.songs : nil
return IndicatorInfo(title: model.indicatorName, accessibilityIdentifier: uiTestAccessibilityIdentifier)
}
// MARK: - UICollectionViewDataSource
......
......@@ -106,6 +106,7 @@ class VLCMediaViewController: VLCPagingViewController<VLCLabelCell>, MediaCatego
override func configure(cell: VLCLabelCell, for indicatorInfo: IndicatorInfo) {
cell.iconLabel.text = indicatorInfo.title
cell.accessibilityIdentifier = indicatorInfo.accessibilityIdentifier
}
override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
......
......@@ -27,10 +27,12 @@ struct IndicatorInfo {
var title: String?
var accessibilityLabel: String?
var accessibilityIdentifier: String?
init(title: String) {
init(title: String, accessibilityIdentifier: String? = nil) {
self.title = title
self.accessibilityLabel = title
self.accessibilityIdentifier = accessibilityIdentifier
}
}
......
......@@ -14,6 +14,7 @@ import Foundation
@objc class VLCAccessibilityIdentifier: NSObject {
static let video = "video"
static let audio = "audio"
static let songs = "songs"
@objc static let localNetwork = "localNetwork"
static let playlist = "playlist"
@objc static let settings = "settings"
......
......@@ -19,7 +19,9 @@ class Screenshot: XCTestCase {
override func setUp() {
super.setUp()
app.launchEnvironment = [
"HOME" : "/Users/caro/Documents/Projects/vlc-ios/AppStoreData28June.xcappdata/AppData",
"CFFIXED_USER_HOME" : "/Users/caro/Documents/Projects/vlc-ios/AppStoreData28June.xcappdata/AppData"]
XCUIDevice.shared.orientation = .portrait
SDStatusBarManager.sharedInstance().enableOverrides()
setupSnapshot(app)
......@@ -33,15 +35,14 @@ class Screenshot: XCTestCase {
}
func testCaptureVideoPlayback() {
download(name: "http://jell.yfish.us/media/jellyfish-10-mbps-hd-h264.mkv")
helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
app.collectionViews.cells.element(boundBy: 0).tap()
app.collectionViews.cells.element(boundBy: 3).tap()
snapshot("playback")
}
func testCaptureAudioTab() {
helper.tapTabBarItem(VLCAccessibilityIdentifier.audio)
app.cells[VLCAccessibilityIdentifier.songs].tap()
snapshot("audio_tab")
}
......@@ -49,22 +50,4 @@ class Screenshot: XCTestCase {
helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
snapshot("video_tab")
}
func download(name fileName: String) {
helper.tapTabBarItem(VLCAccessibilityIdentifier.localNetwork)
app.cells[VLCAccessibilityIdentifier.downloads].tap()
let downloadTextfield = app.textFields["http://myserver.com/file.mkv"].firstMatch
downloadTextfield.clearAndEnter(text: fileName)
app.buttons["Download"].firstMatch.tap()
XCTContext.runActivity(named: "Wait for download to complete") { _ in
let cancelDownloadButton = app.buttons["flatDeleteButton"]
let predicate = NSPredicate(format: "exists == 0")
let downloadCompleted = expectation(for: predicate, evaluatedWith: cancelDownloadButton, handler: nil)
wait(for: [downloadCompleted], timeout: 20.0)
}
downloadTextfield.typeText("\n")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment