@@ -18,33 +18,46 @@ - (void)setUp {
1818 [self .app launch ];
1919}
2020
21- - (void )testTabs {
21+ - (void )testPlayVideo {
2222 XCUIApplication* app = self.app ;
2323
2424 XCUIElement* remoteTab = [app.otherElements
2525 elementMatchingPredicate: [NSPredicate predicateWithFormat: @" selected == YES " ]];
26- if (![remoteTab waitForExistenceWithTimeout: 30.0 ]) {
27- os_log_error (OS_LOG_DEFAULT, " %@" , app.debugDescription );
28- XCTFail (@" Failed due to not able to find selected Remote tab" );
29- }
26+ XCTAssertTrue ([remoteTab waitForExistenceWithTimeout: 30.0 ]);
3027 XCTAssertTrue ([remoteTab.label containsString: @" Remote" ]);
3128
29+ XCUIElement* playButton = app.staticTexts [@" Play" ];
30+ XCTAssertTrue ([playButton waitForExistenceWithTimeout: 30.0 ]);
31+ [playButton tap ];
32+
33+ XCUIElement* chirpClosedCaption = app.staticTexts [@" [ Birds chirping ]" ];
34+ XCTAssertTrue ([chirpClosedCaption waitForExistenceWithTimeout: 30.0 ]);
35+
36+ XCUIElement* buzzClosedCaption = app.staticTexts [@" [ Buzzing ]" ];
37+ XCTAssertTrue ([buzzClosedCaption waitForExistenceWithTimeout: 30.0 ]);
38+
39+ XCUIElement* playbackSpeed1x = app.staticTexts [@" Playback speed\n 1.0x" ];
40+ XCTAssertTrue ([playbackSpeed1x waitForExistenceWithTimeout: 30.0 ]);
41+ [playbackSpeed1x tap ];
42+
43+ XCUIElement* playbackSpeed5xButton = app.buttons [@" 5.0x" ];
44+ XCTAssertTrue ([playbackSpeed5xButton waitForExistenceWithTimeout: 30.0 ]);
45+ [playbackSpeed5xButton tap ];
46+
47+ XCUIElement* playbackSpeed5x = app.staticTexts [@" Playback speed\n 5.0x" ];
48+ XCTAssertTrue ([playbackSpeed5x waitForExistenceWithTimeout: 30.0 ]);
49+
50+ // Cycle through tabs.
3251 for (NSString * tabName in @[ @" Asset" , @" List example" ]) {
3352 NSPredicate * predicate = [NSPredicate predicateWithFormat: @" label BEGINSWITH %@" , tabName];
3453 XCUIElement* unselectedTab = [app.staticTexts elementMatchingPredicate: predicate];
35- if (![unselectedTab waitForExistenceWithTimeout: 30.0 ]) {
36- os_log_error (OS_LOG_DEFAULT, " %@" , app.debugDescription );
37- XCTFail (@" Failed due to not able to find unselected %@ tab" , tabName);
38- }
54+ XCTAssertTrue ([unselectedTab waitForExistenceWithTimeout: 30.0 ]);
3955 XCTAssertFalse (unselectedTab.isSelected );
4056 [unselectedTab tap ];
4157
4258 XCUIElement* selectedTab = [app.otherElements
4359 elementMatchingPredicate: [NSPredicate predicateWithFormat: @" label BEGINSWITH %@" , tabName]];
44- if (![selectedTab waitForExistenceWithTimeout: 30.0 ]) {
45- os_log_error (OS_LOG_DEFAULT, " %@" , app.debugDescription );
46- XCTFail (@" Failed due to not able to find selected %@ tab" , tabName);
47- }
60+ XCTAssertTrue ([selectedTab waitForExistenceWithTimeout: 30.0 ]);
4861 XCTAssertTrue (selectedTab.isSelected );
4962 }
5063}
0 commit comments