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

TestNG template project with allure report #24

Merged
merged 11 commits into from
May 14, 2024
Merged

Conversation

mialeska
Copy link
Contributor

@mialeska mialeska commented Apr 22, 2024

Summary by CodeRabbit

  • New Features
    • Introduced login functionality with error handling for invalid credentials.
    • Added utility classes for managing screen views and alert messages.
    • Implemented data-driven testing using JSON data files.
  • Enhancements
    • Updated dependency management to dynamically handle versioning.
    • Enhanced test reporting by incorporating platform-specific descriptions.
  • Bug Fixes
    • Fixed issue with incorrect file paths in configuration settings.
  • Documentation
    • Updated documentation to reflect new features and enhancements.

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

coderabbitai bot commented Apr 22, 2024

Walkthrough

The updates bring improvements for test execution and reporting in aquality-appium-mobile-template. Enhancements include better Allure report integration, refined Android screen interactions, and updated file paths for increased flexibility and efficiency in running tests.

Changes

Files Change Summary
aquality-appium-mobile-template/pom.xml Excluded com.google.inject:guice in dependencies and updated io.qameta.allure:allure-cucumber5-jvm version to ${allure.version}.
.../screens/chooseview/AndroidChooseViewScreen.java Added IButton interface, waitBtn button, and updated openView method for element display wait handling.
.../screens/chooseview/ChooseViewScreen.java Added getChooseViewLabel method to retrieve and click on labels in openView method.
.../resources/settings.json Updated application paths to use relative paths, increased timeout values for Android installation and ADB execution.

Among lines of code, where changes play,
Buttons and labels now pave the way.
Allure reports and paths refined,
Tests in harmony, a peaceful bind.
Screens await with patience anew,
Ensuring apps shine through and through.
🖥️🔧🐇


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

Out of diff range and nitpick comments (1)
aquality-appium-mobile-template/src/main/java/aquality/appium/mobile/template/utilities/AllureListener.java (1)

10-21: Well-implemented method to enhance test result reporting with platform information. Consider adding error handling for potential issues when accessing the platform name.

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: 1

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 42159c1 and 194a835.
Files selected for processing (3)
  • aquality-appium-mobile-template-cucumber/src/test/java/aquality/appium/mobile/template/cucumber/hooks/ApplicationHooks.java (1 hunks)
  • aquality-appium-mobile-template-testng/src/test/java/aquality/appium/mobile/template/testng/tests/BaseTest.java (1 hunks)
  • pom.xml (1 hunks)
Additional comments not posted (5)
aquality-appium-mobile-template-cucumber/src/test/java/aquality/appium/mobile/template/cucumber/hooks/ApplicationHooks.java (1)

13-14: Consider whether both terminate() and quit() are necessary, as they might be redundant.

Verification successful

Both terminate() and quit() methods are used consistently across different parts of the testing framework, indicating that their use is likely intentional and potentially necessary for proper application lifecycle management. Without further details on their specific implementations or internal documentation, it's reasonable to conclude that their concurrent usage is justified.

  • aquality-appium-mobile-template-testng/src/test/java/aquality/appium/mobile/template/testng/tests/BaseTest.java
  • aquality-appium-mobile-template-cucumber/src/test/java/aquality/appium/mobile/template/cucumber/hooks/ApplicationHooks.java
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the definitions and effects of `terminate()` and `quit()` methods in the application lifecycle management.

# Test: Search for the method implementations. Expect: Clear distinction or recommendation on usage.
ast-grep --lang java --pattern $'class $_ {
  $$$
  void terminate() {
    $$$
  }
  void quit() {
    $$$
  }
  $$$
}'

Length of output: 120



Script:

#!/bin/bash
# Description: Search for usages of `terminate()` and `quit()` methods across Java files to understand their roles and implementations.

# Search for usages of `terminate()` method
rg --glob '*.java' 'terminate\(\)' 

# Search for usages of `quit()` method
rg --glob '*.java' 'quit\(\)'

Length of output: 688

aquality-appium-mobile-template-testng/src/test/java/aquality/appium/mobile/template/testng/tests/BaseTest.java (1)

52-53: Consider whether both terminate() and quit() are necessary in the cleanup process, as they might be redundant.

pom.xml (3)

23-23: The addition of the aquality-appium-mobile-template-testng module is correctly implemented.


27-28: Updated aspectj and allure versions are correctly implemented to manage dependencies better.


43-47: The addition of the allure-java-commons dependency is correctly implemented, enhancing integration with Allure.

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: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 194a835 and 771453c.
Files selected for processing (1)
  • .github/workflows/test-with-allure-report.yml (6 hunks)
Additional comments not posted (5)
.github/workflows/test-with-allure-report.yml (5)

27-28: Updated environment variables for Allure results are correctly set for both Cucumber and TestNG templates.


38-38: Update to macos-12 is appropriate for ensuring compatibility with the latest macOS features and tools.


66-69: Adding a step to copy TestNG Allure results to the Cucumber Allure results directory enhances report consolidation. Ensure the directories exist and are accessible.


79-80: Environment variables for iOS Allure results are correctly set, mirroring the Android configuration.


87-87: Consistency in using macos-12 for both Android and iOS testing ensures uniformity and reduces potential platform-specific issues.

.github/workflows/test-with-allure-report.yml Outdated Show resolved Hide resolved
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 771453c and 82b4a08.
Files selected for processing (3)
  • .github/workflows/test-with-allure-report.yml (6 hunks)
  • aquality-appium-mobile-template/src/main/java/aquality/appium/mobile/template/screens/chooseview/AndroidChooseViewScreen.java (1 hunks)
  • aquality-appium-mobile-template/src/main/java/aquality/appium/mobile/template/screens/chooseview/ChooseViewScreen.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test-with-allure-report.yml
Additional comments not posted (4)
aquality-appium-mobile-template/src/main/java/aquality/appium/mobile/template/screens/chooseview/ChooseViewScreen.java (2)

17-18: The openView method correctly delegates the label retrieval to getChooseViewLabel. This improves code readability and maintainability.


20-21: The getChooseViewLabel method is well-implemented, using accessibilityId and format to create a descriptive label. This enhances accessibility and debugging.

aquality-appium-mobile-template/src/main/java/aquality/appium/mobile/template/screens/chooseview/AndroidChooseViewScreen.java (2)

12-12: The waitBtn button is correctly initialized using getElementFactory().getButton with an appropriate ID and description.


18-25: The overridden openView method includes logic for waiting for an element to be displayed before proceeding. This ensures the view is ready before interacting with it, improving reliability.

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 82b4a08 and e75c1b5.
Files selected for processing (2)
  • aquality-appium-mobile-template-cucumber/pom.xml (3 hunks)
  • aquality-appium-mobile-template/src/main/resources/settings.json (3 hunks)
Additional comments not posted (6)
aquality-appium-mobile-template/src/main/resources/settings.json (3)

10-10: Ensure the application path is correct and the file exists.

Verify that the application file exists at the specified path to avoid runtime errors.


23-23: Ensure the application path is correct and the file exists.

Verify that the application file exists at the specified path to avoid runtime errors.


51-51: The retry settings look good.

aquality-appium-mobile-template-cucumber/pom.xml (3)

36-39: Excluding guava and guice dependencies is appropriate if they are not needed.


52-55: Excluding guava and guice dependencies is appropriate if they are not needed.


74-74: Ensure the allure version is defined in the properties section.

Verify that the ${allure.version} property is defined in the properties section to avoid build issues.

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 e75c1b5 and 5cec732.
Files selected for processing (1)
  • aquality-appium-mobile-template/src/main/resources/settings.json (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • aquality-appium-mobile-template/src/main/resources/settings.json

@mialeska mialeska merged commit 876420d into master May 14, 2024
9 checks passed
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
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant