← スキル一覧に戻る

test-file
by venturo-id
⭐ 0🍴 1📅 2025年12月4日
SKILL.md
name: test-file description: Use this skill every user want to create test file.
Test File
General Rules
- Do NOT generate / create any helper file, fixture file, and other, Always Remember that test file will execute on runner, So each test file must be independent; do not call helpers from other files (helpers must be inlined in the file).
- Do NOT use
waitForTimeoutalone when a request is triggered, MUST usepage.waitForLoadState('networkidle');followed bypage.waitForTimeout(500). - Add
page.waitForTimeout(500)after every click action to prevent race conditions. - Follow this test file template:
// Components :
// - You must add all "Component Path" from plan markdown
import { test, expect, type Page } from '@playwright/test';
const BASE_URL = process.env.BASE_URL || 'http://localhost:5173';
const AUTH_EMAIL = process.env.AUTH_EMAIL || 'tantowi@gmail.com';
const AUTH_PASSWORD = process.env.AUTH_PASSWORD || 'Bismillah1407*';
// @INFO Create function mockData() to generate dynamic mock for test data. Dont add any test data into environment.
function mockData() {
// @TODO generate mock test data here
const name = "wahyu" + Date.now();
return {
name: name
}
}
async function login(page: Page) {
await page.goto(`${BASE_URL}/auth/login`);
await page.waitForLoadState('networkidle');
// @TODO(verified): Change with real selector from playwright-e2e probe
await page.locator('input[name="email"]').fill(AUTH_EMAIL);
await page.locator('input[name="password"]').fill(AUTH_PASSWORD);
await page.locator('button[type="submit"]').click();
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
}
test.describe('SCN-1: User Management - View Users List', () => {
test('SCN-1: User Management - View Users List end-to-end', async ({ page }) => {
await login(page);
await test.step('should display users list with correct elements', async () => {
// @TODO Do any step and assertion
});
// @TODO fill with next step
})
})
Selector Rules
- Do NOT make assumptions about selectors, You must read codebase that relate with context / scenario
- Do NOT use
getByLabel. - Do NOT use
getByText. - Use semantic HTML elements such as
button,input,textarea,select,table,td,tr,thand etc. - Preferred selectors are
data-testidandgetByRole. - All selectors must come from your snapshot.
- Must re make sure selectors is exist using tool
evaluatefor assertion*.toBeVisible()
スコア
総合スコア
35/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です