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

@Step templating not supports this object reference in inner classes #226

Open
tronstone opened this issue Jan 2, 2024 · 0 comments
Open
Labels

Comments

@tronstone
Copy link

Describe the bug
@Step annotation templating not supports this object reference in inner classes

Steps to Reproduce
Java Example:

public class A {
   // Some code

   public abstract class B {
      private final SelenideElement switcher;
      private final String switcherName;

      protected B(By switcherContainer, String switcherName) {
            switcher = $(switcherContainer).$(byClassName("MuiSwitch-switchBase"));
            this.switcherName = switcherName;
      }

      @Step("Enabling '**this.switcherName**'")
        public B enable() {
            if (switcher.has(not(cssClass("Mui-checked")))) {
                switcher.click(usingDefaultMethod()).shouldHave(cssClass("Mui-checked"));
                log.debug("Clicked on '{}' switcher", switcherName);
                log.info("'{}' was enabled", switcherName);
            }

            return this;
       }   
   }
}

Expected behavior
In this example the expected behavior will be correct naming for step with replaced value for this.switcherName

Actual behavior
In ReportPortal log showing like: Enabling 'this.switcherName' without replacing

Dependency versions
Report-Portal client version 5.1.20. I think the same for latest versions too.

@tronstone tronstone added the bug label Jan 2, 2024
@tronstone tronstone changed the title **@Step** templating not supports this object reference in inner classes @Step templating not supports this object reference in inner classes Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant