Understanding Screenplay (part #4)
Previously, we extracted our a simple implementation of the screenplay pattern from some existing Cucumber automation code, turning this:
Given('{word} has created an account', function (name) {
this.createAccount({ name })
})
…into this:
Given('{actor} has created an account',
actor => actor.attemptsTo(CreateAccount.forThemselves)
)
We’re going to continue this refactoring, looking at how we can compose granular interactions into tasks that model higher-level concepts in our problem domain.