FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.04k stars 1.35k forks source link

feat: add UI tests to `create fuels` template #3104

Closed Dhaiwat10 closed 2 months ago

Dhaiwat10 commented 2 months ago

Release notes

In this release, we:

Summary

After this PR, the create fuels template app will ship with a baked-in UI testing setup.

While adding this setup, I spotted a possible improvement in our current UI tests for the create fuels template that we run in the CI so I made some improvements there as well.

Checklist

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 6:06pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 6:06pm
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **create-fuels-counter-example** | ⬜️ Ignored ([Inspect](https://vercel.com/fuel-labs/create-fuels-counter-example/FiCmXvdBg8FQDLq2bN4MKaR3Nhhy)) | | | Sep 11, 2024 6:06pm |
danielbate commented 2 months ago

I wonder if we should add a simple bash script to generate those files for the templates so that one doesn't need to manually update it everywhere each time.

This is a great point @maschad , been thinking more around template generation recently rather than copy pasta, will spin an issue up @Dhaiwat10.

arboleya commented 2 months ago

@danielbate @maschad On one hand, I agree, and this is similar to what I did here — you can see there's a template and a shell script that duplicates things, etc.:

Did I like it? Partially, although it is very DRY, it adds a substantial amount of abstraction that can become hard to maintain. I'm not saying it is or isn't a good path to walk, but I am sharing again this idea that abstractions are always a double-edged sword. We must ponder them carefully.

danielbate commented 2 months ago

Mentioned here but I think extending the playwright web server config may be a good move here so we aren't growing the ui script too much, and unecessarily.

github-actions[bot] commented 2 months ago

Coverage Report:

Lines Branches Functions Statements
78.87%(+0%) 71.64%(-0.11%) 77.19%(+0%) 78.95%(+0%)
Changed Files: | Ok | File (✨=New File) | Lines | Branches | Functions | Statements | | -- | ------------------------------------------------------------------------------------------ | --------------- | ----------- | --------------- | --------------- | | 🔴 | ✨ apps/create-fuels-counter-guide/playwright.config.ts | 100%
(+100%) | 0%
(+0%) | 100%
(+100%) | 100%
(+100%) |