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

Locator description display in report #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NightFox7
Copy link

Locator description should be displayed in report instead of key (#65)

based on (#68)

Locator description should be displayed in report instead of key (qmetry#65)

based on (qmetry#68)
@cjayswal cjayswal self-requested a review June 15, 2018 15:41
@@ -276,10 +276,11 @@ private String processArgs(String description, Object... actualArgs) {

private String getParam(String text) {
String result = getBundle().getSubstitutor().replace(text);
ParamType ptype = ParamType.getType(result);
String value = String.valueOf(getBundle().getObject(result));
Copy link
Member

Choose a reason for hiding this comment

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

@NightFox7, Thanks for the pull request
This possibly cause issues if

  • value may be null if property not exist! use default value to overcome that situation of possible NullPointerException
    • String value = getBundle().getString(result, result);
  • value with key exist but argument referenced is not a locator or not parameter
    • need to keep in mind that not all steps are element step, listener will be called by all steps. So possibly case where it points to string and not locator.

Copy link
Collaborator

@amitbhoraniya amitbhoraniya left a comment

Choose a reason for hiding this comment

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

Agree. We also need to consider below testcase also

<root>
    <user>
		<valid>
			<username>amit</username>
			<password>amitpwd</password>
		</valid>
	</user>
</root>

BDD

When user login with 'user.valid'
@QAFTestStep(description="user login with {key}")
public void login(String key){
	LoginBean bean = new LoginBean();
	bean.fillFromConfig(key);
        //To-Do
}

@cjayswal I think actual root cause of this problem is StringTestStep#81. If we remove that line that #65 should work and #64 will also be resolved.

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.

3 participants