Skip to content
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

TECH: added bluetooth's switcher #684

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ersanin
Copy link
Collaborator

@ersanin ersanin commented Nov 19, 2024

No description provided.

Copy link
Collaborator

@Nikitae57 Nikitae57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changeBluetoothStateUsingAdbServer method needs attention. Everything else either minor or LGTM

logger.i("Bluetooth is not supported")
return
}
logger.i("${if (enable) "En" else "Dis"}able bluetooth")
Copy link
Collaborator

@Nikitae57 Nikitae57 Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, make two separate calls to the logger. Concatenating log strings make them almost imposible to find in the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

throw AdbServerException("Failed to change Bluetooth state using ABD")
}
} catch (e: AdbServerException) {
false
Copy link
Collaborator

@Nikitae57 Nikitae57 Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching AdbServerException here may lead to the missing the fact that adb server is down or broken. Please, check that the test crashes when the adb server is disabled. I would throw an exception in the toggleBluetooth method if bluetooth state didn't change since we failed to set the test to the desired state

Copy link
Collaborator Author

@ersanin ersanin Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the test fail if the adb server is disabled? In this case we can still try to switch bluetooth via quick access settings.

val height = targetContext.resources.displayMetrics.heightPixels
val width = targetContext.resources.displayMetrics.widthPixels

UiSystem {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plesae, leave a comment on what's going on here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants