Screenshot.swift 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*****************************************************************************
  2. * Screenshot.swift
  3. * VLC for iOSUITests
  4. *****************************************************************************
  5. * Copyright (c) 2018 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Mike JS. Choi <mkchoi212 # icloud.com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import Foundation
  13. import XCTest
  14. class Screenshot: XCTestCase {
  15. let app = XCUIApplication()
  16. var helper: TestHelper!
  17. override func setUp() {
  18. super.setUp()
  19. app.launchEnvironment = [
  20. "HOME" : "/Users/caro/Documents/Projects/vlc-ios/AppStoreData28June.xcappdata/AppData",
  21. "CFFIXED_USER_HOME" : "/Users/caro/Documents/Projects/vlc-ios/AppStoreData28June.xcappdata/AppData"]
  22. XCUIDevice.shared.orientation = .portrait
  23. SDStatusBarManager.sharedInstance().enableOverrides()
  24. setupSnapshot(app)
  25. helper = TestHelper(app)
  26. app.launch()
  27. }
  28. override func tearDown() {
  29. SDStatusBarManager.sharedInstance().disableOverrides()
  30. }
  31. func testCaptureVideoPlayback() {
  32. helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
  33. app.collectionViews.cells.element(boundBy: 3).tap()
  34. snapshot("playback")
  35. }
  36. func testCaptureAudioTab() {
  37. helper.tapTabBarItem(VLCAccessibilityIdentifier.audio)
  38. app.cells[VLCAccessibilityIdentifier.songs].tap()
  39. snapshot("audio_tab")
  40. }
  41. func testCaptureVideoTab() {
  42. helper.tapTabBarItem(VLCAccessibilityIdentifier.video)
  43. snapshot("video_tab")
  44. }
  45. }