TestHelper.swift 813 B

1234567891011121314151617181920212223242526272829
  1. /*****************************************************************************
  2. * TestHelper.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. struct TestHelper {
  15. let app: XCUIApplication
  16. init(_ app: XCUIApplication) {
  17. self.app = app
  18. }
  19. func tapTabBarItem(_ identifier: String) {
  20. XCTContext.runActivity(named: "Tap \"\(identifier)\" tab") { _ in
  21. app.tabBars.buttons[identifier].firstMatch.tap()
  22. }
  23. }
  24. }