feat: smoke test untuk menu profil kependudukan#1058
Open
lukman48 wants to merge 1 commit into
Open
Conversation
- Add Pest smoke tests for 6 submenus: Penduduk, Kesehatan, Pendidikan, Ketenagakerjaan, Penerima Bantuan, Kelembagaan - Add data-testid attributes to blade views for test selectors - Add MSW fixtures for new API endpoints - Register new API routes in MswSetup Issue: OpenSID#1057
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Smoke Test untuk Menu Profil Kependudukan
Deskripsi
Menambahkan smoke test otomatis menggunakan Pest + pest-plugin-browser (Playwright) untuk memastikan fungsionalitas inti halaman Profil Kependudukan berjalan dengan benar. Test menggunakan MSW (Mock Service Worker) yang sudah ada untuk mengintersep request API eksternal dan mengembalikan data fixture.
Perubahan yang dilakukan:
data-testiddi Blade templates untuk selector yang stabilAlasan perubahan:
Dampak perubahan:
✅ Smoke Test Coverage: 6 submenu Profil Kependudukan tercoverage oleh automated browser tests (21 test cases)
✅ Deterministic Testing: MSW mock memastikan test selalu menggunakan data yang konsisten
✅ data-testid Convention: Memperluas testing contract ke halaman Profil Kependudukan
Masalah Terkait (Related Issue)
Detail Perubahan File
Smoke Tests (New Files)
tests/Browser/SmokeProfilKependudukanTest.phpJSON Fixtures (New Files — 6 files)
data-penduduk.json/api/v1/pendudukdata-kesehatan.json/api/v1/data/kesehatandata-pendidikan.json/api/v1/pendidikandata-ketenagakerjaan.json/api/v1/ketenagakerjaandata-bantuan.json/api/v1/bantuandata-lembaga.json/api/v1/lembagaView Changes (data-testid additions)
resources/views/penduduk/index.blade.phpbtn-filter,btn-cetak,table-penduduk,dropdown-pilih-aksiresources/views/penduduk/filter_form.blade.phpbtn-filter-submitresources/views/data_pokok/kesehatan/index.blade.phpstatistik-golongan-darah,chart-golongan-darah,statistik-status-gizi,chart-status-gizi,table-kesehatanresources/views/data_pokok/pendidikan/index.blade.phpstatistik-partisipasi-sekolah,chart-partisipasi-sekolah,statistik-ijazah-tertinggi,chart-ijazah-tertinggi,table-pendidikanresources/views/data_pokok/ketenagakerjaan/index.blade.phpstatistik-jumlah-penghasilan,chart-jumlah-penghasilan,statistik-pelatihan,chart-pelatihan,table-ketenagakerjaanresources/views/bantuan/index.blade.phpbtn-filter,btn-cetak,btn-filter-submit,table-bantuan,btn-detailresources/views/lembaga/index.blade.phpbtn-filter,btn-filter-submit,table-lembagaresources/views/components/print-button.blade.phpbtn-cetakresources/views/components/excel-download-button.blade.phpbtn-excelConfiguration Changes
tests/Browser/MswSetup.phpLangkah untuk Mereproduksi (Steps to Reproduce)
Setup:
feat/smoketest-profil-kependudukancomposer install(akan otomatis menjalankanapply-patch.sh)npm install && npx msw init public/ --save.env.testingdari.envdan setAPP_ENV=testingMenjalankan Smoke Tests:
Semua smoke tests profil kependudukan
php vendor/bin/pest --filter=SmokeProfilKependudukan
Per submenu
php vendor/bin/pest --filter=SmokeProfilKependudukan --filter=penduduk
php vendor/bin/pest --filter=SmokeProfilKependudukan --filter=kesehatan
Hasil yang diharapkan:
Daftar Periksa (Checklist)
Testing
Automated Testing — Smoke Tests
Breaking Changes
Tidak ada breaking changes.
References