-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Functionality to the BottomSheet with TestCases: Enable/Disable…
… Swipe Down Dismiss with more intuitive accessibility controls (#490) * BottomSheet added functionality to not get dismissed when swiped down * added semantics check * To run test on pipeline * applied enableSwipeDismiss check on dismiss * Improved semantics for talkback actions * Added option for accesibility users to have a way to bring bottomSheet in case it's hidden * localized some string constants * moved string under UI labels * typo --------- Co-authored-by: Anubhav Agrawal <[email protected]>
- Loading branch information
Showing
7 changed files
with
152 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...Demo/src/androidTest/java/com/microsoft/fluentuidemo/demos/V2BottomSheetActivityUITest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.microsoft.fluentuidemo.demos | ||
|
||
import androidx.compose.ui.test.onNodeWithTag | ||
import org.junit.Before | ||
import com.microsoft.fluentuidemo.BaseTest | ||
import androidx.compose.ui.test.performClick | ||
import androidx.compose.ui.test.performTouchInput | ||
import androidx.compose.ui.test.swipeDown | ||
import com.microsoft.fluentui.tokenized.bottomsheet.BOTTOMSHEET_CONTENT_TAG | ||
import com.microsoft.fluentui.tokenized.bottomsheet.BOTTOMSHEET_HANDLE_TAG | ||
import com.microsoft.fluentui.tokenized.bottomsheet.BOTTOMSHEET_SCRIM_TAG | ||
import org.junit.Test | ||
|
||
|
||
class V2BottomSheetActivityUITest(): BaseTest(){ | ||
@Before | ||
fun initialize() { | ||
BaseTest().launchActivity(V2BottomSheetActivity::class.java) | ||
} | ||
//Tag use for testing | ||
private val bottomSheetHandle = composeTestRule.onNodeWithTag(BOTTOMSHEET_HANDLE_TAG, useUnmergedTree = true) | ||
private val bottomSheetContent = composeTestRule.onNodeWithTag(BOTTOMSHEET_CONTENT_TAG, useUnmergedTree = true) | ||
private val bottomSheetScrim = composeTestRule.onNodeWithTag(BOTTOMSHEET_SCRIM_TAG, useUnmergedTree = true) | ||
|
||
private fun openCheckForBottomSheet() { | ||
composeTestRule.waitForIdle() | ||
bottomSheetHandle.assertExists() | ||
bottomSheetScrim.assertExists() | ||
bottomSheetContent.assertExists() | ||
} | ||
@Test | ||
fun testBottomSheetDismissDisabledSwipeDown() { | ||
composeTestRule.onNodeWithTag(BOTTOM_SHEET_ENABLE_SWIPE_DISMISS_TEST_TAG, useUnmergedTree = true).performClick() | ||
//SwipeDown on bottomSheetContent should close it. | ||
bottomSheetContent.performTouchInput { | ||
swipeDown() | ||
} | ||
bottomSheetHandle.performTouchInput { | ||
swipeDown() | ||
} | ||
openCheckForBottomSheet() | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters