linkedin / linkedin/test-butler
TestButler should close system dialogs that are shown at the moment it is starting
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
We in our team have faced some problem: before our test have started(and testButler was initialised) google play services have have crashed - so _System Dialog_ appeared and test did not pass
Is there any instrument which allows testButler to close already opened dialogs?
Should it be used when testButler is starting?
**P.S.** We have made a solution based on `uiautomator` - but I am not sure it is the best one:
```
UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
UiObject crashMessageView = uiDevice.findObject(new UiSelector().resourceId(("android:id/message")));
if (crashMessageView != null) {
try {
TestLog.w("Crash alert is found = " + crashMessageView.getText());
uiDevice.findObject(new UiSelector().resourceId(("android:id/button1"))).click();
} catch (UiObjectNotFoundException e) {
TestLog.w("Could not click on crash dialog\n " + e);
}
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing TestButler initialization and the startup path where system dialogs could be handled. Compare that path with the issue's UiDevice and UiSelector approach for the crash dialog. Done means an already-open system dialog no longer prevents the test from starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100