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

Application management functionality +semver: feature #42

Merged
merged 3 commits into from
May 10, 2024

Conversation

mialeska
Copy link
Contributor

No description provided.

@mialeska mialeska added the enhancement New feature or request label May 10, 2024
@mialeska mialeska self-assigned this May 10, 2024
Copy link

coderabbitai bot commented May 10, 2024

Walkthrough

The changes bring significant improvements to mobile application management capabilities in the codebase. This includes transitioning key classes to IMobileApplication, updating dependencies, refining localization for clarity across languages, and introducing robust methods for application state management, installation, and termination.

Changes

Files Affected Change Summary
pom.xml Updated aquality-selenium-core dependency version.
src/main/java/aquality/appium/mobile/application/* Transitioned classes to IMobileApplication, added new methods, and updated annotations.
src/main/java/aquality/appium/mobile/configuration/DriverSettings.java Enhanced handling of application path and bundle ID in capabilities.
src/main/resources/localization/*.json Updated application-related strings in various languages for better clarity and detail.
src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java Added a new test method for application management functionalities.

🐇✨
A hop, a skip, a code deploy,
We've updated paths the apps employ.
From strings that sing in tongues so wide,
To methods new, with class and pride.
Oh, how the code now smoothly glides!
🌟📱


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 07b837e and e964349.
Files selected for processing (17)
  • pom.xml (1 hunks)
  • src/main/java/aquality/appium/mobile/application/Application.java (5 hunks)
  • src/main/java/aquality/appium/mobile/application/AqualityServices.java (3 hunks)
  • src/main/java/aquality/appium/mobile/application/IApplicationFactory.java (1 hunks)
  • src/main/java/aquality/appium/mobile/application/IMobileApplication.java (1 hunks)
  • src/main/java/aquality/appium/mobile/application/LocalApplicationFactory.java (1 hunks)
  • src/main/java/aquality/appium/mobile/application/MobileModule.java (1 hunks)
  • src/main/java/aquality/appium/mobile/application/RemoteApplicationFactory.java (1 hunks)
  • src/main/java/aquality/appium/mobile/configuration/DriverSettings.java (3 hunks)
  • src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java (1 hunks)
  • src/main/java/aquality/appium/mobile/elements/Element.java (2 hunks)
  • src/main/resources/localization/be.json (2 hunks)
  • src/main/resources/localization/en.json (1 hunks)
  • src/main/resources/localization/pl.json (1 hunks)
  • src/main/resources/localization/ru.json (1 hunks)
  • src/main/resources/localization/uk.json (2 hunks)
  • src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java (2 hunks)
Files skipped from review due to trivial changes (2)
  • pom.xml
  • src/main/resources/localization/en.json
Additional comments not posted (39)
src/main/java/aquality/appium/mobile/application/IApplicationFactory.java (1)

5-5: Change to return type IMobileApplication aligns with enhanced mobile application management.

src/main/java/aquality/appium/mobile/application/RemoteApplicationFactory.java (1)

11-11: Ensure that the Application class implements IMobileApplication as expected by the return type of this method.

src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java (1)

22-27: Addition of getBundleId() method enhances mobile application configuration capabilities.

src/main/java/aquality/appium/mobile/application/LocalApplicationFactory.java (1)

14-14: Ensure that the Application class implements IMobileApplication as expected by the return type of this method.

src/main/java/aquality/appium/mobile/application/MobileModule.java (1)

18-20: Enhancements to the MobileModule class improve the framework's modularity and configurability.

src/main/resources/localization/be.json (1)

2-10: Localization updates enhance the user interface for Belarusian-speaking users and align with new functionalities.

src/main/resources/localization/ru.json (1)

2-10: Localization updates enhance the user interface for Russian-speaking users and align with new functionalities.

src/main/resources/localization/pl.json (1)

2-10: Localization updates enhance the user interface for Polish-speaking users and align with new functionalities.

src/main/resources/localization/uk.json (3)

2-10: Added new localization strings for application management functionalities.


25-28: Added new localization strings for combobox interactions.


31-32: Added new localization strings for error handling and UI elements.

src/main/java/aquality/appium/mobile/elements/Element.java (1)

35-35: Updated getApplication method to return IMobileApplication to align with the new interface requirements.

src/main/java/aquality/appium/mobile/configuration/DriverSettings.java (4)

41-41: Ensured the application path is set in the capabilities if available.


67-67: Updated the hasApplicationPath method to check for the application path in the settings or capabilities.


78-80: Refactored getApplicationPath to fetch the application path from settings or capabilities, handling it more robustly.


83-87: Added method to fetch the bundle ID based on the platform, enhancing flexibility in handling different platforms.

src/main/java/aquality/appium/mobile/application/IMobileApplication.java (6)

17-19: Added a method to get the default timeout for terminating applications, providing a standardized timeout management.


54-56: Added a default method to access app management functionalities from the driver, enhancing interface usability.


77-79: Added a convenience method to install the application using the path defined in settings, simplifying the installation process.


93-95: Added a method to send the application to the background indefinitely, mimicking pressing the "Home" button.


110-112: Added a method to remove the currently running application, simplifying the removal process by not requiring an appId.


146-148: Added a default method to terminate the application using the default timeout, standardizing the termination process.

src/main/java/aquality/appium/mobile/application/AqualityServices.java (3)

37-37: Updated getApplication to ensure it returns an instance of IMobileApplication, aligning with interface changes.


98-98: Refactored startApplication to use the updated application factory method, ensuring consistency in application startup.


107-108: Updated setApplication to accept an IMobileApplication instance, ensuring type safety and consistency.

src/main/java/aquality/appium/mobile/application/Application.java (13)

48-48: Ensured getDriver method correctly returns the AppiumDriver instance.


58-58: Ensured getDriverService method correctly returns the DriverService instance.


63-63: Implemented getPlatformName to return the platform name from the application profile.


76-76: Implemented quit method to properly quit the driver and stop the driver service, aligning with the lifecycle management.


94-97: Added a generic method to retry application actions, handling exceptions and retries in a centralized manner.


108-118: Implemented getId to fetch the application ID based on the platform, handling both Android and iOS platforms.


120-126: Implemented getState to fetch the application state, providing detailed logging and retry mechanisms.


128-132: Implemented install to install the application from a specified path, including retries and logging.


134-138: Implemented background to send the application to the background for a specified duration, including retries and logging.


140-144: Implemented remove to remove the application by its ID, including retries and logging.


146-150: Implemented activate to activate the application by its ID, including retries and logging.


152-162: Implemented activate with a timeout to activate the application by its ID, including retries and logging.


164-172: Implemented terminate with a timeout to terminate the application by its ID, including retries and logging.

src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java (1)

60-80: Added testApplicationManagement to comprehensively test new application management functionalities, including backgrounding, activating, terminating, and removing the application.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between e964349 and 0a7b366.
Files selected for processing (3)
  • src/main/java/aquality/appium/mobile/application/Application.java (5 hunks)
  • src/main/java/aquality/appium/mobile/configuration/DriverSettings.java (5 hunks)
  • src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/aquality/appium/mobile/configuration/DriverSettings.java
Additional comments not posted (17)
src/main/java/aquality/appium/mobile/application/Application.java (15)

22-22: Class now implements IMobileApplication.

This change aligns with the PR's objective to enhance mobile application interaction capabilities.


48-48: Method getDriver correctly returns the AppiumDriver.

This method is essential for interacting with the mobile application through Appium.


58-58: Method getDriverService correctly returns the DriverService.

This method is crucial for managing the driver service lifecycle.


63-63: Method getPlatformName correctly retrieves the platform name from the application profile.

This is necessary for platform-specific operations.


76-76: Method quit properly handles the quitting of the application and stopping the driver service.

Proper resource management is crucial for avoiding leaks and ensuring clean test teardowns.


94-97: Retry mechanism implemented for function execution with error handling.

This enhances the robustness of the application by handling transient issues during automation.


103-106: Retry mechanism implemented for runnable functions.

Similar to the previous comment, this addition improves the stability of operations that might face intermittent failures.


108-118: Method getId correctly handles platform-specific logic to retrieve the application ID.

This method is crucial for identifying the application across different platforms, which is often necessary in mobile testing environments.


120-126: Method getState correctly retrieves the state of the application.

This method is essential for state management and control in mobile application testing.


128-132: Method install correctly handles the installation of the application.

Ensuring that the application can be installed programmatically is vital for automated testing setups.


134-138: Method background correctly handles sending the application to the background.

This functionality is important for testing how the app behaves when it is not in the foreground.


140-144: Method remove correctly handles the removal of the application.

Proper removal of applications is crucial for cleanup in testing environments.


146-150: Method activate correctly handles the activation of the application.

This method is essential for bringing the application back to the foreground, which is a common scenario in mobile testing.


152-162: Method activate with timeout option correctly builds and passes the activation options.

The inclusion of a timeout is a good practice for operations that might hang or take longer than expected.


164-173: Method terminate with timeout option correctly builds and passes the termination options.

This method is crucial for forcibly stopping the application, with a timeout to prevent hanging operations.

src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java (2)

62-68: Retry mechanism for tests implemented.

This addition helps in handling flaky tests by retrying failed assertions, which is common in mobile testing due to the instability of environments.


70-90: New test method testApplicationManagement added to test the functionalities of IMobileApplication.

This test method is crucial for verifying the new application management functionalities introduced in the PR, ensuring they work as expected.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0a7b366 and 17ebbf4.
Files selected for processing (1)
  • src/main/java/aquality/appium/mobile/application/AqualityServices.java (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/aquality/appium/mobile/application/AqualityServices.java

@mialeska mialeska merged commit 3d6cc65 into master May 10, 2024
5 checks passed
@mialeska mialeska deleted the feature/app-management-methods branch May 10, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

1 participant