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

Provide an ability to add custom actions to the test controller #1535

Open
AlexanderMoskovkin opened this Issue Jun 14, 2017 · 2 comments

Comments

4 participants
@AlexanderMoskovkin
Copy link
Contributor

AlexanderMoskovkin commented Jun 14, 2017

Based on discussions:
https://testcafe-discuss.devexpress.com/t/use-custom-actions-on-test-controller/228
https://testcafe-discuss.devexpress.com/t/how-to-chain-pagemodel-methods/313

Are you requesting a feature or reporting a bug?

Feature

What is the expected behavior?

Provide an ability to add custom actions to the test controller or chain methods that contain a test controller chain

@stefanfisk

This comment has been minimized.

Copy link

stefanfisk commented Aug 19, 2018

Might a simpler alternative be to add a apply() action that takes a function as its argument, and then calls that function with the controller as its argument? Then there would be no risk of polluting the controller's API, and we could all factor out whatever we'd like into separate functions, at least provided we only want to do sync calls.

@stalniy

This comment has been minimized.

Copy link

stalniy commented Sep 9, 2018

It's already possible with function composition :) You can use smth like this:

test('can login', pipe(
  attemptsTo(login('email@example.com', '1234567')),
  expectsTo(see(Dashboard.container))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment