create-react-adam 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,94 @@
1
+ # E2E Testing
2
+
3
+ This project uses [Playwright](https://playwright.dev/) for end-to-end testing.
4
+
5
+ ## Setup
6
+
7
+ Install Playwright and dependencies:
8
+
9
+ ```bash
10
+ npx playwright install
11
+ ```
12
+
13
+ Add these scripts to your `package.json`:
14
+
15
+ ```json
16
+ "scripts": {
17
+ "test:e2e": "playwright test",
18
+ "test:e2e:ui": "playwright test --ui",
19
+ "test:e2e:report": "allure generate ./allure-results --clean && allure open"
20
+ }
21
+ ```
22
+
23
+ ## Running Tests
24
+
25
+ **Run all tests (headless):**
26
+
27
+ ```bash
28
+ npm run test:e2e
29
+ ```
30
+
31
+ **Run with UI mode (interactive):**
32
+
33
+ ```bash
34
+ npm run test:e2e:ui
35
+ ```
36
+
37
+ **Run in headed mode (see browser):**
38
+
39
+ ```bash
40
+ npm run test:e2e -- --headed
41
+ ```
42
+
43
+ **Run specific test file:**
44
+
45
+ ```bash
46
+ npm run test:e2e -- example.spec.ts
47
+ ```
48
+
49
+ **Debug mode:**
50
+
51
+ ```bash
52
+ npm run test:e2e -- --debug
53
+ ```
54
+
55
+ ## View Reports
56
+
57
+ **HTML report (generated after test run):**
58
+
59
+ ```bash
60
+ npx playwright show-report
61
+ ```
62
+
63
+ **Allure report:**
64
+
65
+ ```bash
66
+ npm run test:e2e:report
67
+ ```
68
+
69
+ ## Writing Tests
70
+
71
+ Tests are located in the `e2e/` directory. See `example.spec.ts` for a basic example.
72
+
73
+ ```typescript
74
+ import { test, expect } from "@playwright/test";
75
+
76
+ test("my test", async ({ page }) => {
77
+ await page.goto("/");
78
+ await expect(page.getByRole("heading")).toBeVisible();
79
+ });
80
+ ```
81
+
82
+ ## Configuration
83
+
84
+ The test configuration is in `playwright.config.ts`:
85
+
86
+ - Dev server automatically starts before tests
87
+ - Tests run on `http://localhost:5173`
88
+ - Chromium browser is used by default
89
+
90
+ To add more browsers, edit `playwright.config.ts` and install them:
91
+
92
+ ```bash
93
+ npx playwright install firefox webkit
94
+ ```
@@ -0,0 +1,14 @@
1
+ import { expect, test } from "@playwright/test";
2
+
3
+ test("basic navigation works", async ({ page }) => {
4
+ await page.goto("/");
5
+
6
+ await expect(page.getByRole("heading", { name: /welcome/i })).toBeVisible();
7
+
8
+ await page.getByRole("link", { name: /about/i }).click();
9
+ await expect(page).toHaveURL("/about");
10
+ await expect(page.getByRole("heading", { name: /about/i })).toBeVisible();
11
+
12
+ await page.getByRole("link", { name: /home/i }).click();
13
+ await expect(page).toHaveURL("/");
14
+ });
@@ -0,0 +1,54 @@
1
+ import eslint from "@eslint/js";
2
+ import prettier from "eslint-config-prettier";
3
+ import deMorgan from "eslint-plugin-de-morgan";
4
+ import importPlugin from "eslint-plugin-import";
5
+ import jsxA11y from "eslint-plugin-jsx-a11y";
6
+ import promisePlugin from "eslint-plugin-promise";
7
+ import reactHooks from "eslint-plugin-react-hooks";
8
+ import reactRefresh from "eslint-plugin-react-refresh";
9
+ import unicorn from "eslint-plugin-unicorn";
10
+ import tseslint from "typescript-eslint";
11
+
12
+ export default tseslint.config({
13
+ extends: [
14
+ eslint.configs.recommended,
15
+ ...tseslint.configs.recommended,
16
+ ...tseslint.configs.strict,
17
+ prettier,
18
+ promisePlugin.configs["flat/recommended"],
19
+ importPlugin.flatConfigs.recommended,
20
+ importPlugin.flatConfigs.typescript,
21
+ unicorn.configs["unopinionated"],
22
+ deMorgan.configs.recommended,
23
+ ],
24
+ plugins: {
25
+ "jsx-a11y": jsxA11y,
26
+ "react-hooks": reactHooks,
27
+ "react-refresh": reactRefresh,
28
+ },
29
+ languageOptions: {
30
+ parserOptions: {
31
+ ecmaFeatures: {
32
+ jsx: true,
33
+ },
34
+ },
35
+ },
36
+ rules: {
37
+ "@typescript-eslint/no-unused-vars": [
38
+ "error",
39
+ {
40
+ argsIgnorePattern: "^_",
41
+ varsIgnorePattern: "^_",
42
+ caughtErrorsIgnorePattern: "^_",
43
+ },
44
+ ],
45
+ ...jsxA11y.flatConfigs.strict.rules,
46
+ ...reactHooks.configs.recommended.rules,
47
+ "react-refresh/only-export-components": [
48
+ "warn",
49
+ { allowConstantExport: true },
50
+ ],
51
+ },
52
+ files: ["**/*.{ts,tsx}"],
53
+ ignores: ["dist"],
54
+ });
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>__PROJECT_NAME__</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>