Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 87b00ba

Browse files
author
Chris Yang
committed
also check for old accessiblity value
1 parent d65a0e6 commit 87b00ba

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/video_player/video_player_avfoundation/example/ios/RunnerUITests/VideoPlayerUITests.m

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,34 @@ - (void)testPlayVideo {
3131
[playButton tap];
3232

3333
XCUIElement *playbackSpeed1x = app.staticTexts[@"1.0x\nPlayback speed"];
34-
XCTAssertTrue([playbackSpeed1x waitForExistenceWithTimeout:30.0]);
34+
BOOL foundPlaybackSpeed1x = [playbackSpeed1x waitForExistenceWithTimeout:30.0];
35+
if (!foundPlaybackSpeed1x) {
36+
// Some old flutter version uses a different accessibility value for tooltips.
37+
// We try to find the button if the old accessibility value is used.
38+
// TODO(cyanglaz): Remove this when the new accessibility value is supported on flutter/stable
39+
// https://github.com/flutter/flutter/issues/102771
40+
playbackSpeed1x = app.staticTexts[@"Playback speed\n1.0x\n"];
41+
foundPlaybackSpeed1x = [playbackSpeed1x waitForExistenceWithTimeout:30.0];
42+
}
43+
XCTAssertTrue(foundPlaybackSpeed1x);
3544
[playbackSpeed1x tap];
3645

3746
XCUIElement *playbackSpeed5xButton = app.buttons[@"5.0x"];
3847
XCTAssertTrue([playbackSpeed5xButton waitForExistenceWithTimeout:30.0]);
3948
[playbackSpeed5xButton tap];
4049

4150
XCUIElement *playbackSpeed5x = app.staticTexts[@"5.0x\nPlayback speed"];
42-
XCTAssertTrue([playbackSpeed5x waitForExistenceWithTimeout:30.0]);
51+
BOOL foundPlaybackSpeed5x = [playbackSpeed5x waitForExistenceWithTimeout:30.0];
52+
if (!foundPlaybackSpeed5x) {
53+
// Some old flutter version uses a different accessibility value for tooltips.
54+
// We try to find the button if the old accessibility value is used.
55+
// TODO(cyanglaz): Remove this when the new accessibility value is supported on flutter/stable
56+
// https://github.com/flutter/flutter/issues/102771
57+
playbackSpeed5x = app.staticTexts[@"Playback speed\n5.0x\n"];
58+
foundPlaybackSpeed5x = [playbackSpeed5x waitForExistenceWithTimeout:30.0];
59+
}
60+
XCTAssertTrue(foundPlaybackSpeed5x);
61+
[playbackSpeed5x tap];
4362

4463
// Cycle through tabs.
4564
for (NSString *tabName in @[ @"Asset", @"Remote" ]) {

0 commit comments

Comments
 (0)