抓娃娃版1127

OpenLiveUITests.m 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // OpenLiveUITests.m
  3. // OpenLiveUITests
  4. //
  5. // Created by GongYuhua on 2017/1/13.
  6. // Copyright © 2017年 Agora. All rights reserved.
  7. //
  8. #import <XCTest/XCTest.h>
  9. @interface OpenLiveUITests : XCTestCase
  10. @end
  11. @implementation OpenLiveUITests
  12. - (void)setUp {
  13. [super setUp];
  14. self.continueAfterFailure = NO;
  15. [[[XCUIApplication alloc] init] launch];
  16. }
  17. - (void)tearDown {
  18. [super tearDown];
  19. }
  20. - (void)testJoinAndLeaveChannel {
  21. XCUIApplication *app = [[XCUIApplication alloc] init];
  22. XCUIElement *inputNameOfLiveTextField = app.textFields[@"Input name of Live"];
  23. [inputNameOfLiveTextField tap];
  24. [inputNameOfLiveTextField typeText:@"uiTestChannel\n"];
  25. [app.sheets.buttons[@"Broadcaster"] tap];
  26. XCUIElement *closeButton = app.buttons[@"btn close"];
  27. [self expectationForPredicate:[NSPredicate predicateWithFormat:@"exists == 1"] evaluatedWithObject:closeButton handler:nil];
  28. [self waitForExpectationsWithTimeout:5 handler:nil];
  29. [closeButton tap];
  30. XCUIElement *textField = app.textFields[@"Input name of Live"];
  31. [self expectationForPredicate:[NSPredicate predicateWithFormat:@"exists == 1"] evaluatedWithObject:textField handler:nil];
  32. [self waitForExpectationsWithTimeout:5 handler:nil];
  33. }
  34. @end