-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a Task
convenience function.
#74
Comments
From a usability standpoint it it would be nice if the beat was autogenerated with the option to override/customize it. LogInAsBasicUser = Task(
Eventually(Enter.the_text(BasicUser.USERNAME).into_the(USERNAME_FIELD)),
Enter.the_password(BasicUser.PASSWORD).into_the(PASSWORD_FIELD),
Click.on_the(LOGIN_BUTTON),
).called("LogInAsBasicUser") Then when it's logged :
or if the
Custom beat might look something like: Task(Action()).called("MyTask").using_beat("This is my custom beat msg") |
I think it'll be important to get Task to generate a specific classname the caller provides. |
LogInAsBasicUser = Task(
perform=(
Eventually(Enter.the_text(BasicUser.USERNAME).into_the(USERNAME_FIELD)),
Enter.the_password(BasicUser.PASSWORD).into_the(PASSWORD_FIELD),
Click.on_the(LOGIN_BUTTON),
),
description="Log in as a Basic User.",
blurt=True
) |
Is there another way to do it than this? >>> class Foo:
... pass
...
>>> f = Foo()
>>> Foo.__name__ = "Bar"
>>> f
<__main__.Foo object at 0x10060cb50>
>>> f.__class__.__name__
'Bar' I think we use |
When I envision DoCommonTask = Task(
Step1(),
Step2(),
Step3()
)
actor.will(DoCommonTask())
|
I don't think there's a way for the class built in the function/class/whatever we end up using for |
I'm also thinking about viewing these actions in the stack. It would be nice if the name of the objects were identifiable while debugging. |
As far as I know there isn't. I think it's going to be needed as a variable at the time of It would be cool if |
... maybe we can ask ChatGPT to summarize it. Haha. I think just calling the generated Task class |
Maybe the end result is |
Yes, i like that. Maybe then we just have Where should this live? Should we create a from screenpy.shortcuts import make_task
LogInAsABasicUser = make_task(
...
) |
Sometimes you make Tasks that just do a few Actions and don't need to be modified in any way, they just need a more descriptive
beat
to log. It's kind of a waste to have to have to make a whole file and class for what is essentially just abeat
wrapper around a handful of otherwise too-generic Actions.But if we had a
Task
function to entaskinate those Actions, that would be swell! Something we could use like this:Maybe you could even set
blurt
instead ofbeat
, or neither if you want this Task to be performed without a summary!The text was updated successfully, but these errors were encountered: