Skip to content

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

@tronstone

Description

@tronstone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions