Skip to content
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

More Playwright tests for custom forms page #303

Open
dantownsend opened this issue Apr 26, 2023 · 6 comments
Open

More Playwright tests for custom forms page #303

dantownsend opened this issue Apr 26, 2023 · 6 comments
Labels
testing Requires additional tests
Projects

Comments

@dantownsend
Copy link
Member

Related to #298

We could do with a mega form with all of the possible fields, and testing it with Playwright.

@dantownsend dantownsend added the testing Requires additional tests label Apr 26, 2023
@dantownsend dantownsend added this to To do in Testing via automation Apr 26, 2023
@sinisaos
Copy link
Member

@dantownsend Now that the array fields work, basically all fields work as expected (except the datetime field, but that can easily be solved by adding v-bind:format="property.format" to the NewForm.vue InputField to get a datetime picker work in custom forms). By 'all possible fields' do you mean all Pydantic fields or Piccolo Admin InputFields?
Is this form enough?

class CustomFormlModel(BaseModel):
    boolean_field: bool
    float_field: float
    integer_field: int
    string_field: str
    list_field: t.List[str]
    tuple_field: t.Tuple[str]
    time_field: datetime.time
    date_field: datetime.date
    datetime_field: datetime.datetime

@dantownsend
Copy link
Member Author

@sinisaos Yeah, all possible fields is probably unrealistic as Pydantic potentially has so many different field types. I think the ones you've defined are OK, but I'd add timedelta.

@sinisaos
Copy link
Member

@dantownsend Interesting, if we add v-bind:format="property.format" to the NewForm.vue InputField FlatPickr widget (datetime) and DurationWidget (timedelta) works on port 3000 but not on port 8000 (for PlayWright tests)?

@dantownsend
Copy link
Member Author

@sinisaos On port 8000 it serves the compiled assets - so you'll have to run npm run build in the admin_ui folder.

@sinisaos
Copy link
Member

@dantownsend Yes you are right. I forgot to build after the admin UI changes. Thanks. I can make PR if you want?

@dantownsend
Copy link
Member Author

@sinisaos Yes, that would be good - thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Requires additional tests
Projects
Testing
To do
Development

No branches or pull requests

2 participants