VLC_for_iOS_UITests.swift 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*****************************************************************************
  2. * VLC_for_iOS_UITests.swift
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import XCTest
  13. class VLC_for_iOS_UITests: XCTestCase {
  14. override func setUp() {
  15. super.setUp()
  16. // Put setup code here. This method is called before the invocation of each test method in the class.
  17. // In UI tests it is usually best to stop immediately when a failure occurs.
  18. continueAfterFailure = true
  19. // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
  20. XCUIApplication().launch()
  21. // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
  22. }
  23. override func tearDown() {
  24. // Put teardown code here. This method is called after the invocation of each test method in the class.
  25. super.tearDown()
  26. }
  27. func testExample() {
  28. for _ in 0...15 {
  29. let app = XCUIApplication()
  30. let collectionViewsQuery = app.collectionViews
  31. collectionViewsQuery.cells.otherElements.childrenMatchingType(.Image).elementBoundByIndex(1).tap()
  32. let okButton = app.alerts["Codec not supported"].collectionViews.buttons["OK"]
  33. okButton.tap()
  34. okButton.tap()
  35. sleep(4)
  36. app.tap()
  37. let titleNavigationBar = app.navigationBars["Title"]
  38. let minimizePlaybackButton = titleNavigationBar.buttons["Minimize playback"]
  39. minimizePlaybackButton.tap()
  40. let element = app.childrenMatchingType(.Window).elementBoundByIndex(0).childrenMatchingType(.Other).element.childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other).element.childrenMatchingType(.Other).element.childrenMatchingType(.Other).element
  41. element.tap()
  42. minimizePlaybackButton.tap()
  43. element.tap()
  44. titleNavigationBar.buttons["Done"].tap()
  45. }
  46. }
  47. }