Преглед на файлове

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
Carola Nitz преди 6 години
родител
ревизия
2d0e66f722

+ 2 - 1
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -254,7 +254,8 @@ class VLCMediaCategoryViewController: UICollectionViewController, UICollectionVi
     }
     }
 
 
     func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
     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
     // MARK: - UICollectionViewDataSource

+ 1 - 0
Sources/MediaViewControllers/MediaViewController.swift

@@ -106,6 +106,7 @@ class VLCMediaViewController: VLCPagingViewController<VLCLabelCell>, MediaCatego
 
 
     override func configure(cell: VLCLabelCell, for indicatorInfo: IndicatorInfo) {
     override func configure(cell: VLCLabelCell, for indicatorInfo: IndicatorInfo) {
         cell.iconLabel.text = indicatorInfo.title
         cell.iconLabel.text = indicatorInfo.title
+        cell.accessibilityIdentifier = indicatorInfo.accessibilityIdentifier
     }
     }
 
 
     override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
     override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {

+ 3 - 1
Sources/VLCPagingViewController.swift

@@ -27,10 +27,12 @@ struct IndicatorInfo {
 
 
     var title: String?
     var title: String?
     var accessibilityLabel: String?
     var accessibilityLabel: String?
+    var accessibilityIdentifier: String?
 
 
-    init(title: String) {
+    init(title: String, accessibilityIdentifier: String? = nil) {
         self.title = title
         self.title = title
         self.accessibilityLabel = title
         self.accessibilityLabel = title
+        self.accessibilityIdentifier = accessibilityIdentifier
     }
     }
 }
 }
 
 

+ 1 - 0
VLC-iOS-UITests/Helpers/VLCAccessibilityIdentifier.swift

@@ -14,6 +14,7 @@ import Foundation
 @objc class VLCAccessibilityIdentifier: NSObject {
 @objc class VLCAccessibilityIdentifier: NSObject {
     static let video = "video"
     static let video = "video"
     static let audio = "audio"
     static let audio = "audio"
+    static let songs = "songs"
     @objc static let localNetwork = "localNetwork"
     @objc static let localNetwork = "localNetwork"
     static let playlist = "playlist"
     static let playlist = "playlist"
     @objc static let settings = "settings"
     @objc static let settings = "settings"

+ 5 - 22
VLC-iOS-UITests/Screenshot.swift

@@ -19,7 +19,9 @@ class Screenshot: XCTestCase {
 
 
     override func setUp() {
     override func setUp() {
         super.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
         XCUIDevice.shared.orientation = .portrait
         SDStatusBarManager.sharedInstance().enableOverrides()
         SDStatusBarManager.sharedInstance().enableOverrides()
         setupSnapshot(app)
         setupSnapshot(app)
@@ -33,15 +35,14 @@ class Screenshot: XCTestCase {
     }
     }
 
 
     func testCaptureVideoPlayback() {
     func testCaptureVideoPlayback() {
-        download(name: "http://jell.yfish.us/media/jellyfish-10-mbps-hd-h264.mkv")
         helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
         helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
-        app.collectionViews.cells.element(boundBy: 0).tap()
-
+        app.collectionViews.cells.element(boundBy: 3).tap()
         snapshot("playback")
         snapshot("playback")
     }
     }
 
 
     func testCaptureAudioTab() {
     func testCaptureAudioTab() {
         helper.tapTabBarItem(VLCAccessibilityIdentifier.audio)
         helper.tapTabBarItem(VLCAccessibilityIdentifier.audio)
+        app.cells[VLCAccessibilityIdentifier.songs].tap()
         snapshot("audio_tab")
         snapshot("audio_tab")
     }
     }
 
 
@@ -49,22 +50,4 @@ class Screenshot: XCTestCase {
         helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
         helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
         snapshot("video_tab")
         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")
-    }
 }
 }