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

Testing #26

Open
stancl opened this issue Jan 24, 2021 · 0 comments
Open

Testing #26

stancl opened this issue Jan 24, 2021 · 0 comments

Comments

@stancl
Copy link
Member

stancl commented Jan 24, 2021

I'm thinking of ways to make testing easier.

First, low-level testing of fields and actions should definitely be documented.

Second, I'm thinking that it'd be nice to have some automated tests. You'd specify user interactions, like:

  1. Create Product, title: MacBook Pro 16", price: 1500, description: Foo. Assert no errors.
  2. Create a child Variant, title: Color, values: Space Gray and Silver. Assert no errors.
  3. Create a child Variant, title: Color, values whatever, Assert validation error variant title has to be unique
  4. Create Order with address ABC. Assert no errors.
  5. Create OrderProduct for order PWA #1, linking to the MacBook Pro 16" product. Quantity: 2 Assert no errors
  6. Assert total of OrderProduct
  7. Create OrderProduct again for MacBook Pro 16", assert error - unique rule
  8. Create Order with address DEF. Assert missing ZIP code
  9. Edit order PWA #1, change address to XYZ. Assert no errors.
  10. Go to order index, assert order PWA #1 total is a formatted string that looks like $11,120

This would test that your admin panel didn't start behaving in random ways when you made a minor change to some field definition (this was pretty common in Nova when I was using it) and it would make sure that no pages and actions show errors. This would be done on Livewire level, but we might have a version that does these things with Dusk too to make sure that everything works in the browser as well. That would of course be an optional extra feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant