Java インターフェイスで Cucumber テスト ステップ定義を定義したいと考えています。
public interface ITestSteps {
@Before
public void setUpLocal() throws Throwable;
@When("^Landing screen is visible$")
public void Landing_Screen_is_visible() throws Throwable;
}
他の 2 つのクラスがこのインターフェイスを実装します。
public class AppleTestSteps implements ITestSteps { ... }
public class AndroidTestSteps implements ITestSteps { ... }
環境名 (Android または Apple) のプロパティを取得し、オブジェクトを初期化する TestFactory クラスがあります。
ITestSteps steps = TestFactory(platformName);
問題: Cucumber は、オブジェクトを参照せずに、名前ごとに必要なステップを実行します。かかりLanding_Screen_is_visible()
ませんsteps.Landing_Screen_is_visible()
Cucumber が必要なステップを名前で見つけようとする前に、インターフェースを実装することは可能ですか? 静的にしますか?
または、キュウリのステップを実装する別の方法があるのでしょうか? (手順は同じですが、実装が異なります)