Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 2, 2021

Unit test for Flutter: Best practice UI test, widget test, logic test

  1. Install Flutter Unit test: coverage Mac install: https://brewinstall.org/Install-lcov-on-Mac-with-Brew/ brew install lcov Unit test gồm những gì? Unit Test case : là 1 chuỗi code để đảm bảo rằng đoạn code được kiểm thử làm việc như mong đợi. Mỗi function sẽ có nhiều test case, ứng với mỗi trường hợp function chạy. Setup : Đây là hàm được chạy trước khi chạy các test case, thường dùng để chuẩn bị dữ liệu để chạy test. Teardown : Đây là hàm được chạy sau khi các test case chạy xong, thường dùng để xóa dữ liệu, giải phóng bộ nhớ. Mock : là một đối tượng ảo, mô phỏng các tính chất và hành vi giống hệt như đối tượng thực được truyền vào bên trong khối mã đang vận hành nhằm kiểm tra tính đúng đắn của các hoạt động bên trong. Giả sử chương trình của chúng ta được chia làm 2 module: A và B. Module A đã code xong, B thì chưa. Để test module A, ta dùng mock để làm giả module B, không cần phải đợi tới khi module B code xong mới test được. Test Suite  : Test suite là một tập các test case và

Setup CI/CD for Flutter: Auto upload build to Store use Codemagic.io

I. Create API key access Store  1. Create google service account and download file credentials    Step 1: In Google Play Console, navigate to Settings > API access.  Step 2: Click on the Create Service Account button. Step 3: Click on the link to Google API Console . Step 4: In Google API Console, click on the Create Service Account button. Step 5: Enter service acttount name and click CREATE Step 6: cick Select a role , select Service Account User and click CONTINUE Step 7: click CREATE KEY Choose JSON and click CRATE to download file credenticials Step 8: Back in Google Play Console, click Done to close the dialog. Click GRANT ACCESS Choose Role is Release manager and Add an app. Final click ADD USER  2. Create key store app android Create keystore keytool -genkey -v -keystore nameKey.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias name_alias_key Create file key.properties storePassword=password keyPassword=password keyAlias=name_alias_key storeFile=nameKey.ke