-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deck options test #17550
base: main
Are you sure you want to change the base?
Deck options test #17550
Conversation
I also remove `OnPageFinishedCallback` because I don't really see the point in this list in Kotlin. I keep the interface as it's used in AbstractFlashcardViewer.
The names were far from clear
`bridgeCommand` is the general process by which Anki's webview send command to the webview's owner. In Anki, it's interpreted by Python. In AnkiDroid it must be interpreted by Kotlin. Currently, the only `bridgeCommand` we listen to are in CongratsPage. And I'm really thankful `@BrayanDSO` for creating this first usage! When anki 24.10 beta 2 is used in ankidroid, the DeckOptions will also send `bridgeCommand`. And, I expect that when we'll use more webview, more `bridgeCommand` will arrive. So, I decided to generalize Brayan's code and ensure that there is a simple map that any PageFragment can override that would allow to declare its `bridgeCommand` without needing to add copy `CongratsPage`'s code. I tested this manually, and the CongratsPage's button still works.
This use a recent change introduced upstream. Unit test can't run the webview. So it has to be replaced by instrumented tests. Test fails on CI while working locally, so I have to assume it's not CI.
80d2f9b
to
69ed7ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to tap on the "Deck options" entry of the context menu opened by long pressing a deck
Those views are in a dialog so you need to scope the Espresso search to the dialog's window. Example from the HelpDialogTest class:
onView(withText(R.string.help_title_community)).inRoot(isDialog()).perform(click())
@@ -43,6 +43,8 @@ androidxSqlite = "2.4.0" | |||
androidxSwipeRefreshLayout = "1.1.0" | |||
# https://developer.android.com/jetpack/androidx/releases/test | |||
androidxTest = "1.6.1" | |||
# https://developer.android.com/training/testing/espresso/web | |||
androidxTestEspressoWeb = "3.6.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed we already have the espresso version number(all espresso artifacts use the same version).
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
This PR contains #17315 plus one commit for tests.
I've no idea why those tests used to pass when I created the PR for the first time, but now they fail. I'd appreciate some help if anyone has any idea how to tap on the "Deck options" entry of the context menu opened by long pressing a deck