Skip to content

Instantly share code, notes, and snippets.

View minhphong306's full-sized avatar
😄
Don't watch the clock. Do what it does! Keep going!

Phong Do minhphong306

😄
Don't watch the clock. Do what it does! Keep going!
View GitHub Profile
@minhphong306
minhphong306 / code.ts
Created November 28, 2025 01:11
code.ts
const { chromium } = require('playwright');
const fs = require('fs');
const path = require('path');
async function downloadAndCheckFile() {
const downloadPath = path.join(__dirname, 'downloads');
// Create downloads directory if it doesn't exist
if (!fs.existsSync(downloadPath)) {
fs.mkdirSync(downloadPath, { recursive: true });
@minhphong306
minhphong306 / guide.md
Created November 5, 2025 06:07
guide.md

There are several ways to compile Python code to an executable (.exe) file. Here are the most popular methods:

PyInstaller (Most Popular)

PyInstaller is the most widely used tool and works well for most projects:

# Install
pip install pyinstaller

Mock API là gì? Tại sao phải Mock API và cách thực hiện

Mock API là gì?

Mock API (API giả lập) là một phiên bản giả của API thực, được tạo ra để mô phỏng hành vi và phản hồi của API thật mà không cần kết nối đến server backend thực tế. Mock API trả về dữ liệu mẫu đã được định nghĩa trước thay vì dữ liệu thực từ database hay các service khác.

Ví dụ thực tế:

Giả sử bạn đang phát triển một ứng dụng quản lý sản phẩm:

API thực:

@minhphong306
minhphong306 / q1.md
Last active September 15, 2025 03:29

Câu Hỏi Phỏng Vấn Selenium Java - Từ Cơ Bản Đến Nâng Cao

PHẦN 1: CÂU HỎI CƠ BẢN

1. Selenium WebDriver là gì?

Trả lời: Selenium WebDriver là một công cụ automation testing mã nguồn mở, cho phép tương tác trực tiếp với trình duyệt web thông qua các API native của browser. WebDriver hỗ trợ nhiều ngôn ngữ lập trình như Java, Python, C#, Ruby và JavaScript.

Ví dụ code Java:

@minhphong306
minhphong306 / middle-golang-interview-questions.md
Created September 11, 2025 06:22
middle-golang-interview-questions.md

Core Golang Concepts

1. Goroutines & Concurrency

  • Goroutines là gì, khác gì với thread
  • Channel (buffered vs unbuffered)
  • Select statement
  • WaitGroup, Mutex, RWMutex
  • Race condition và cách xử lý
  • Context package và cách sử dụng
@minhphong306
minhphong306 / structure.md
Created September 8, 2025 17:18
structure.md

Playwright Framework Structure

playwright-framework/
├── .github/
│   └── workflows/
│       ├── ci.yml
│       ├── nightly.yml
│       └── release.yml
├── config/
import { test, expect, Page } from '@playwright/test';
import { faker } from '@faker-js/faker';
import path from 'path';
test.describe('Lesson 02 - Ex 01', async () => {
const baseUrl = 'https://material.playwrightvn.com/';
const registerData = {
username: faker.person.fullName(),
email: faker.internet.email(),
@minhphong306
minhphong306 / playwright-snowflake.md
Last active August 19, 2025 10:30
playwright-snowflake.md

1. Cài đặt dependencies

npm install @playwright/test playwright
npm install snowflake-sdk
npm install dotenv
npm install --save-dev @types/snowflake-sdk @types/node typescript

2. Kết nối Snowflake với snowflake-sdk

@minhphong306
minhphong306 / code.ts
Created June 29, 2025 07:50
Code need help
import { test } from '@playwright/test';
test("Register", async ({ page }) => {
await page.goto('https://material.playwrightvn.com/');
await page.click('//a[@href="01-xpath-register-page.html"]');
await page.locator('//input[@id="username"]').fill('Trangdt98');
await page.locator('//input[@id="email"]').fill('doantranghn98@gmail.com');
await page.locator('//input[@id="female"]').check();
await page.locator('//input[@id="traveling"]').check();
await page.locator('//select[@id="country"]').selectOption({ value: "usa" });
await page.locator('//input[@id="profile"]').setInputFiles("D:/pw-course (1)/Data/165522424_10225222190398060_7591752606277882188_n.jpg");
@minhphong306
minhphong306 / prompt.md
Created June 8, 2025 03:53
Playwright Prompt Template

Playwright Testing Standards and Best Practices

Testing Architecture

  • Follow the Page Object Model pattern strictly
  • Separate locators and actions in page object files
  • Maintain directory structure that mirrors business logic
  • Page objects should be independent from one another when possible
  • Reuse existing page objects and utilities before creating new ones