원클릭으로
dokan-dev-cycle
// Run tests, linting, and quality checks for Dokan development. Use when running tests, fixing code style, building assets, or following the development workflow.
// Run tests, linting, and quality checks for Dokan development. Use when running tests, fixing code style, building assets, or following the development workflow.
Build, scaffold, and run the Dokan Lite/Pro Playwright suite. Use when the user asks to add tests for a feature, scaffold from test-cases.md, or run the automation suite (Lite Only / PR / Full). Knows the folderized format, tag system, Docker / wp-env preconditions, and the .env / license-key requirements for Pro runs.
Execute the Dokan Playwright test suite (E2E + API), locally or via GitHub Actions. Invoke when the user asks to run, kick off, trigger, re-run, debug, or inspect the automated test runs. Phrases such as "run the suite", "run e2e tests", "trigger CI", "execute the QA suite", or "check the failed run" should activate this skill.
Build new vendor dashboard DataViews list pages from scratch OR migrate legacy Filter/StatusFilter/DataViewTable components to the unified @wedevs/plugin-ui DataViews component. Covers fresh builds (types, hook, list, route, PHP nav) and legacy migration (Scenario A status tabs, Scenario B multi-list merge).
Review Dokan code changes and pull requests for coding standards, security, and architectural compliance. Use when reviewing PRs, performing code audits, or checking code quality.
Add or modify Dokan backend PHP code following project conventions. Use when creating new classes, methods, hooks, REST controllers, or modifying existing backend code. Invoke before writing PHP unit tests.
Add or modify Dokan frontend code (React, TypeScript, Vue, Tailwind). Use when creating components, hooks, stores, or modifying webpack configuration.
| name | dokan-dev-cycle |
| description | Run tests, linting, and quality checks for Dokan development. Use when running tests, fixing code style, building assets, or following the development workflow. |
This skill provides guidance for the Dokan Lite development workflow including building, testing, linting, and CI.
npm run start # Dev build with watch
npm run start:hot # Dev with HMR (port 8887)
npm run build # Production build
npm run makepot # Generate translation .pot file
npm run release # Full release build
composer phpcs # Check coding standards
composer phpcbf # Auto-fix coding standard violations
PHPCS config is in phpcs.xml.dist. It scans includes/ only (excludes assets/, src/, lib/, vendor/, tests/).
CI behavior: GitHub Actions runs PHPCS only on changed files in PRs (not the entire codebase).
npm run lint:js # ESLint (via @wordpress/scripts)
npm run lint:css # Stylelint
npm run format # Code formatting
npm run phpunit # Run tests (requires wp-env running)
npm run phpunit:coverage # Run with coverage report
npm run test:phpunit # Start env → run tests → stop env
npm run env:start # Start wp-env Docker environment
npm run env:stop # Stop wp-env
All tests extend DokanTestCase (tests/php/src/DokanTestCase.php):
namespace WeDevs\Dokan\Test\MyDomain;
use WeDevs\Dokan\Test\DokanTestCase;
class MyServiceTest extends DokanTestCase {
/**
* @group dokan-my-domain
*/
public function test_something() {
wp_set_current_user( $this->seller_id1 );
$response = $this->get_request( '/my-resource' );
$this->assertEquals( 200, $response->get_status() );
}
}
Pre-created users (from DokanTestCase):
$this->admin_id — WordPress admin$this->seller_id1, $this->seller_id2 — Vendor users$this->customer_id — Customer userREST request helpers:
$this->get_request( $route ) — GET$this->post_request( $route, $body ) — POST$this->put_request( $route, $body ) — PUT$this->delete_request( $route ) — DELETETest Factories (tests/php/src/Factories/):
$this->factory()->seller->create() — Create vendor$this->factory()->order->create() — Create order$this->factory()->product->create() — Create product$this->factory()->customer->create() — Create customer$this->factory()->coupon->create() — Create coupon$this->factory()->shipping->create() — Create shippingOrder helpers:
$this->create_multi_vendor_order() — Multi-vendor order$this->create_single_vendor_order() — Single-vendor orderCustom assertions (tests/php/src/CustomAssertion/):
DBAssertionTrait — Database assertionsNestedArrayAssertionTrait — Nested array comparisonsSet $is_unit_test = true to skip REST server and database setup:
class MyUnitTest extends DokanTestCase {
protected $is_unit_test = true;
// Uses Brain Monkey for mocking WordPress functions
}
Config: tests/pw/playwright.config.ts
# Run from tests/pw/ directory
npx playwright test
npx playwright test --grep @lite # Only lite tests
npx playwright test --grep @pro # Only pro tests
@lite — Lite plugin tests@liteOnly — Lite-only features@pro — Pro plugin tests@serial — Must run sequentially70+ page objects in tests/pw/pages/. Follow the POM pattern:
test('admin can set commission', { tag: ['@lite', '@admin'] }, async () => {
await admin.navigateToCommissionPage();
// assertions
});
tests/pw/utils/)apiUtils.ts — REST API clientdbUtils.ts — Direct database accesstestData.ts, payloads.ts — Test fixtureshelpers.ts — Common helperscomposer phpcs for PHP changesnpm run lint:js for JS/TS changesnpm run phpunit for unit testscomposer phpcbf, manual fixes)phpcs.yml — Runs on PRs: PHPCS on changed files + PHPUnite2e_api_tests.yml — Playwright E2E/API testsdeploy.yml — Release deployment