Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ISSUE-723 # Add support for loading scenarios from relative path.#727

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pratyushkumar211 wants to merge3 commits intoauthorjapps:master
base:master
Choose a base branch
Loading
frompratyushkumar211:add-relative-path-feature-issue-723

Conversation

@pratyushkumar211
Copy link

Fixed Which Issue?

PR Branch
https://github.com/pratyushkumar211/zerocode/tree/add-relative-path-feature-issue-723

Motivation and Context

This PR extends the scenario loading logic to support relative paths based on the present working directory (PWD), while retaining the default classpath loading. This addresses user requests for more flexible file loading outside the classpath, as discussed in Issue#723. The changes are incore/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java.

Checklist:

  • 1. New Unit tests were added

    • 1.1 Covered in existing Unit tests
  • 2. Integration tests were added

    • 2.1 Covered in existing Integration tests
  • 3. Test names are meaningful

  • 3.1 Feature manually tested and outcome is successful

  • Tested locally: Ranmvn test -Dtest=JustHelloWorldTest fromhttp-testing-examples/ with relative paths; confirmed file loads from file system, not just classpath.

  • 4. PR doesn't break any of the earlier features for end users

    • 4.1 WARNING! This might break one or more earlier earlier features, hence left a comment tagging all reviewrs
  • 5. PR doesn't break the HTML report features directly

    • 5.1 Yes! I've manually run it locally and seen the HTML reports are generated perfectly fine
    • 5.2 Yes! I've opened the generated HTML reports from the/target folder and they look fine
  • 6. PR doesn't break any HTML report features indirectly

    • 6.1 I have not added or amended any dependencies in this PR
    • 6.2 I have double checked, the new dependency added or removed has not affected the report generation indirectly
    • 6.3 Yes! I've seen the Sample report screenshotshere, and HTML report of the current PR looks simillar.
  • 7. Branch build passed in CI

  • 8. No 'package.*' in the imports

  • 9. Relevant DOcumentation page added or updated with clear instructions and examples for the end user

    • 9.1 Not applicable. This was only a code refactor change, no functional or behaviourial changes were introduced
  • 10. Http test added tohttp-testing-examples module(if applicable) ?

    • 10.1 Not applicable. The changes did not affect HTTP automation flow
  • 11. Kafka test added tokafka-testing-examples module(if applicable) ?

    • 11.1 Not applicable. The changes did not affect Kafka automation flow


publicstaticStringreadJsonAsString(StringscenarioFile) {
try {
Stringpwd =System.getProperty("user.dir");
Copy link
Collaborator

Choose a reason for hiding this comment

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

@pratyushkumar211 ,
Unit tests and Integration tests missing for this feature you just added.
Can you add them now?
then we can run the CI

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you able to see it now@pratyushkumar211 ?

Choose a reason for hiding this comment

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

Thanks@nirmalchandra ! I can see the comment now.
I have added a unit test for the feature, I also moved it into a separate function resolveRelativePath() so I can test just this added feature through a unit test.

I'm not sure how to add an integration test. Can you share more information on how this could be added or point me to an example test that would be relevant?

Thank you

@nirmalchandra
Copy link
Collaborator

Thanks@nirmalchandra ! I can see the comment now. I have added a unit test for the feature, I also moved it into a separate function resolveRelativePath() so I can test just this added feature through a unit test.

I'm not sure how to add an integration test. Can you share more information on how this could be added or point me to an example test that would be relevant?

Thank you

Please have a lookhere@pratyushkumar211 and follow the existing ones.

… already handled, update unit and integration tests.
@pratyushkumar211
Copy link
Author

Thanks@nirmalchandra !
While I was working on the integration test , I discovered that the relative path are also already handled. The JavaPaths.get() function that was used in theisValidAbsolutePath() andreadFile() function in theSmartUtils script already handle relative path. Given this, my added feature was redundant.

But I believe it could still be useful to have unit & integration tests to verify that relative paths can be handled. So I've updated my unit test and also added an integration test to this PR to test the relative path feature. Can you take a look and let me know if we're ready to run the CI?

nirmalchandra reacted with heart emojinirmalchandra reacted with eyes emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nirmalchandranirmalchandranirmalchandra requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@pratyushkumar211@nirmalchandra

[8]ページ先頭

©2009-2025 Movatter.jp