Is BDD really applicable at the UI layer?

后端 未结 3 433
情深已故
情深已故 2021-01-30 07:25

BDD is an \"outside-in\" methodology, which as I understand it, means you start with what you know. You write your stories and scenarios, and then implement th

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-30 08:00

    I'm new to BDD myself, but I found the cuke4ninja site to help in this regard. What they suggest (my interpretation) is you have your step definitions which are high level and UI agnostic, that calls into a "workflow" class which groups the details like "click this button", "populate this field" into a method that captures the workflow under test, which calls into a "screen driver" class that handles the UI automation for that particular screen. That way all the UI automation code is abstracted away from the step definitions and are in a single location, and if the UI change, you just have to change the code in the "screen driver" instead of all multiple tests. Here is the relevant page where it is discussed.

提交回复
热议问题