sela-core 1.0.0 → 1.0.2
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.
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +36 -12
- package/dist/cli/index.js +43 -1
- package/dist/fixtures/expectProxy.d.ts.map +1 -1
- package/dist/fixtures/expectProxy.js +10 -0
- package/dist/fixtures/index.d.ts +2 -0
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/index.js +24 -1
- package/dist/fixtures/moduleExpect.d.ts.map +1 -1
- package/dist/fixtures/moduleExpect.js +2 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -10
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQnD"}
|
|
@@ -36,7 +36,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.registerInit = registerInit;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
-
const
|
|
39
|
+
const PACKAGE_NAME = 'sela-core';
|
|
40
|
+
const CONFIG_TEMPLATE_TS = `import { defineConfig } from '${PACKAGE_NAME}';
|
|
40
41
|
|
|
41
42
|
export default defineConfig({
|
|
42
43
|
healingPolicy: 'balanced',
|
|
@@ -45,7 +46,7 @@ export default defineConfig({
|
|
|
45
46
|
dnaStoragePath: 'sela-snapshots',
|
|
46
47
|
});
|
|
47
48
|
`;
|
|
48
|
-
const CONFIG_TEMPLATE_JS = `const { defineConfig } = require('
|
|
49
|
+
const CONFIG_TEMPLATE_JS = `const { defineConfig } = require('${PACKAGE_NAME}');
|
|
49
50
|
|
|
50
51
|
module.exports = defineConfig({
|
|
51
52
|
healingPolicy: 'balanced',
|
|
@@ -59,7 +60,7 @@ function registerInit(program) {
|
|
|
59
60
|
program
|
|
60
61
|
.command('init')
|
|
61
62
|
.description('Initialize Sela in the current project')
|
|
62
|
-
.option('--update-imports', '
|
|
63
|
+
.option('--no-update-imports', 'Skip swapping @playwright/test imports to sela-core')
|
|
63
64
|
.action(async (opts) => {
|
|
64
65
|
await runInit(opts);
|
|
65
66
|
});
|
|
@@ -81,6 +82,7 @@ async function runInit(opts) {
|
|
|
81
82
|
console.error(`✅ Created ${configFile}`);
|
|
82
83
|
}
|
|
83
84
|
// ── Environment variables ────────────────────────────────────────
|
|
85
|
+
loadDotEnv(cwd);
|
|
84
86
|
const missing = REQUIRED_ENV_VARS.filter((k) => !process.env[k]);
|
|
85
87
|
if (missing.length > 0) {
|
|
86
88
|
console.error(`\n⚠️ Missing environment variables:`);
|
|
@@ -91,19 +93,38 @@ async function runInit(opts) {
|
|
|
91
93
|
else {
|
|
92
94
|
console.error(`✅ Environment variables OK`);
|
|
93
95
|
}
|
|
94
|
-
// ──
|
|
95
|
-
if (opts.updateImports) {
|
|
96
|
+
// ── Import swap (default ON; opt out with --no-update-imports) ──
|
|
97
|
+
if (opts.updateImports !== false) {
|
|
96
98
|
const swapped = swapImports(cwd, isTs);
|
|
97
|
-
|
|
99
|
+
if (swapped > 0) {
|
|
100
|
+
console.error(`✅ Updated imports in ${swapped} spec file(s) → '${PACKAGE_NAME}'`);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.error(`ℹ️ No @playwright/test imports to swap`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
console.error(`\n📖 Spec files should import from:`);
|
|
107
|
+
console.error(` import { test, expect } from '${PACKAGE_NAME}'\n`);
|
|
108
|
+
}
|
|
109
|
+
function loadDotEnv(cwd) {
|
|
110
|
+
const envPath = path.join(cwd, '.env');
|
|
111
|
+
if (!fs.existsSync(envPath))
|
|
112
|
+
return;
|
|
113
|
+
try {
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
115
|
+
const dotenv = require('dotenv');
|
|
116
|
+
dotenv.config({ path: envPath });
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// dotenv missing — skip silently
|
|
98
120
|
}
|
|
99
|
-
console.error(`\n📖 Replace imports in your spec files:`);
|
|
100
|
-
console.error(` from: import { test, expect } from '@playwright/test'`);
|
|
101
|
-
console.error(` to: import { test, expect } from 'sela'\n`);
|
|
102
121
|
}
|
|
103
122
|
function walkDir(dir, exts) {
|
|
104
123
|
const results = [];
|
|
105
|
-
const ignore = new Set(['node_modules', 'dist', '.git']);
|
|
124
|
+
const ignore = new Set(['node_modules', 'dist', '.git', 'sela-snapshots', 'fixwright-snapshots', 'test-results', 'playwright-report']);
|
|
106
125
|
function walk(current) {
|
|
126
|
+
if (!fs.existsSync(current))
|
|
127
|
+
return;
|
|
107
128
|
for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
|
|
108
129
|
if (entry.isDirectory()) {
|
|
109
130
|
if (!ignore.has(entry.name))
|
|
@@ -118,12 +139,15 @@ function walkDir(dir, exts) {
|
|
|
118
139
|
return results;
|
|
119
140
|
}
|
|
120
141
|
function swapImports(cwd, isTs) {
|
|
121
|
-
const exts = isTs
|
|
142
|
+
const exts = isTs
|
|
143
|
+
? ['.spec.ts', '.test.ts', '.spec.js', '.test.js']
|
|
144
|
+
: ['.spec.js', '.test.js'];
|
|
122
145
|
const files = walkDir(cwd, exts);
|
|
123
146
|
let swapped = 0;
|
|
147
|
+
const importRegex = /(from\s+|require\s*\(\s*)(['"])@playwright\/test\2/g;
|
|
124
148
|
for (const filePath of files) {
|
|
125
149
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
126
|
-
const updated = content.replace(
|
|
150
|
+
const updated = content.replace(importRegex, (_m, prefix, quote) => `${prefix}${quote}${PACKAGE_NAME}${quote}`);
|
|
127
151
|
if (updated !== content) {
|
|
128
152
|
fs.writeFileSync(filePath, updated, 'utf8');
|
|
129
153
|
swapped++;
|
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
// Load .env from CWD before anything else reads process.env
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
try {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
40
|
+
require('dotenv').config({ path: path.join(process.cwd(), '.env') });
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// dotenv missing or .env absent — continue silently
|
|
44
|
+
}
|
|
3
45
|
const commander_1 = require("commander");
|
|
4
46
|
const ErrorHandler_js_1 = require("./ErrorHandler.js");
|
|
5
47
|
const init_js_1 = require("./commands/init.js");
|
|
@@ -16,7 +58,7 @@ const program = new commander_1.Command();
|
|
|
16
58
|
program
|
|
17
59
|
.name('sela')
|
|
18
60
|
.description('Sela CLI — proactive DNA management for Fixwright')
|
|
19
|
-
.version('1.0.
|
|
61
|
+
.version('1.0.2')
|
|
20
62
|
.exitOverride(ErrorHandler_js_1.handleError)
|
|
21
63
|
.configureOutput({ outputError: () => { } });
|
|
22
64
|
// ── sela init ────────────────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectProxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/expectProxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAER,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"expectProxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/expectProxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAER,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAgO5D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,OAAO,kBAAkB,EAAE,IAAI,EACrC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EAAE,6CAA6C;AAClE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,GAChD,CAAC,cAAc,EAAE,OAAO,KAAK,GAAG,CAiElC"}
|
|
@@ -29,6 +29,11 @@ function isRealLocator(value) {
|
|
|
29
29
|
return false;
|
|
30
30
|
if (typeof value !== "object")
|
|
31
31
|
return false;
|
|
32
|
+
// Fixwright locator proxies expose `_fixwrightSelector`. The proxy forwards
|
|
33
|
+
// `_frame` via Reflect.get so `hasFrame` would lie — explicitly reject them
|
|
34
|
+
// here. Callers should unwrap via `resolveProxy` first.
|
|
35
|
+
if (value._fixwrightSelector !== undefined)
|
|
36
|
+
return false;
|
|
32
37
|
const hasFrame = value._frame !== undefined ||
|
|
33
38
|
value._impl?._frame !== undefined;
|
|
34
39
|
const isFrameLocator = value._frameSelector !== undefined ||
|
|
@@ -206,6 +211,11 @@ resolveProxy) {
|
|
|
206
211
|
resolved = unwrapped;
|
|
207
212
|
}
|
|
208
213
|
const base = (0, test_1.expect)(resolved);
|
|
214
|
+
// Defensive: if for any reason `base` is not an object, return it as-is
|
|
215
|
+
// rather than crashing inside `new Proxy(...)`.
|
|
216
|
+
if (base === null || typeof base !== "object") {
|
|
217
|
+
return base;
|
|
218
|
+
}
|
|
209
219
|
// Step 2 — only wrap matchers for genuine page-level Locator objects.
|
|
210
220
|
if (!isRealLocator(resolved)) {
|
|
211
221
|
return base;
|
package/dist/fixtures/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Locator } from "@playwright/test";
|
|
1
2
|
import { createHealingExpect } from "./expectProxy";
|
|
3
|
+
export declare function resolveFixwrightProxy(value: unknown): Locator | null;
|
|
2
4
|
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
|
3
5
|
expect: ReturnType<typeof createHealingExpect>;
|
|
4
6
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAER,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAWpD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAIpE;AA02BD,eAAO,MAAM,IAAI;YACP,UAAU,CAAC,OAAO,mBAAmB,CAAC;wGA+F9C,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/fixtures/index.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createHealingExpect = exports.test = void 0;
|
|
37
|
+
exports.resolveFixwrightProxy = resolveFixwrightProxy;
|
|
37
38
|
const test_1 = require("@playwright/test");
|
|
38
39
|
const StackUtils_1 = require("../utils/StackUtils");
|
|
39
40
|
const HealingRegistry_1 = require("../engine/HealingRegistry");
|
|
@@ -43,6 +44,15 @@ const fs = __importStar(require("fs"));
|
|
|
43
44
|
const path = __importStar(require("path"));
|
|
44
45
|
const registry = HealingRegistry_1.HealingRegistry.getInstance();
|
|
45
46
|
const proxyToActiveLocator = new WeakMap();
|
|
47
|
+
// Module-level resolver — moduleExpect.ts uses this to unwrap a Fixwright
|
|
48
|
+
// locator proxy back to its live underlying Playwright Locator without
|
|
49
|
+
// needing access to the WeakMap directly.
|
|
50
|
+
function resolveFixwrightProxy(value) {
|
|
51
|
+
if (!value || typeof value !== "object")
|
|
52
|
+
return null;
|
|
53
|
+
const getActive = proxyToActiveLocator.get(value);
|
|
54
|
+
return getActive ? getActive() : null;
|
|
55
|
+
}
|
|
46
56
|
// ─── Action classification (identical to original) ────────────────
|
|
47
57
|
const INTERCEPTED_ACTIONS = [
|
|
48
58
|
"click",
|
|
@@ -461,6 +471,12 @@ function createFrameLocatorProxy(rawFrameLocator, frameSelector, rawPage, testTi
|
|
|
461
471
|
// 3. Exposes _fixwrightUnsubscribe so the fixture can clean up.
|
|
462
472
|
// ─────────────────────────────────────────────────────────────────
|
|
463
473
|
function createLocatorProxy(rawLocator, selector, rawPage, testTitle, actionCounter, elementSelectorOnly) {
|
|
474
|
+
// Defensive: Proxy ctor throws "Cannot create proxy with a non-object as target"
|
|
475
|
+
// when downstream callers (e.g. chained traps) pass a non-Locator return value.
|
|
476
|
+
// Returning the raw value lets the caller see it unchanged instead of crashing.
|
|
477
|
+
if (rawLocator === null || rawLocator === undefined || typeof rawLocator !== "object") {
|
|
478
|
+
return rawLocator;
|
|
479
|
+
}
|
|
464
480
|
// ── Resolve immediately (handles post-heal proxy creation) ────
|
|
465
481
|
const initialResolved = registry.resolveSelector(selector);
|
|
466
482
|
let currentFullSelector = initialResolved;
|
|
@@ -517,9 +533,13 @@ function createLocatorProxy(rawLocator, selector, rawPage, testTitle, actionCoun
|
|
|
517
533
|
// ── getBy* ───────────────────────────────────────────────
|
|
518
534
|
if (prop in GET_BY_METHODS) {
|
|
519
535
|
return (...args) => {
|
|
536
|
+
const nextLocator = activeLocator[prop](...args);
|
|
537
|
+
if (nextLocator === null || nextLocator === undefined || typeof nextLocator !== "object") {
|
|
538
|
+
return nextLocator;
|
|
539
|
+
}
|
|
520
540
|
const semanticSelector = GET_BY_METHODS[prop](args);
|
|
521
541
|
const childFullSelector = `${currentFullSelector} >> ${semanticSelector}`;
|
|
522
|
-
return createLocatorProxy(
|
|
542
|
+
return createLocatorProxy(nextLocator, childFullSelector, rawPage, testTitle, actionCounter, semanticSelector);
|
|
523
543
|
};
|
|
524
544
|
}
|
|
525
545
|
// ── Chainable methods ────────────────────────────────────
|
|
@@ -527,6 +547,9 @@ function createLocatorProxy(rawLocator, selector, rawPage, testTitle, actionCoun
|
|
|
527
547
|
if (chainables.includes(prop)) {
|
|
528
548
|
return (...args) => {
|
|
529
549
|
const nextLocator = activeLocator[prop](...args);
|
|
550
|
+
if (nextLocator === null || nextLocator === undefined || typeof nextLocator !== "object") {
|
|
551
|
+
return nextLocator;
|
|
552
|
+
}
|
|
530
553
|
let nextFull = currentFullSelector;
|
|
531
554
|
let nextElement = currentElementSelector;
|
|
532
555
|
if (prop === "locator") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleExpect.d.ts","sourceRoot":"","sources":["../../src/fixtures/moduleExpect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moduleExpect.d.ts","sourceRoot":"","sources":["../../src/fixtures/moduleExpect.ts"],"names":[],"mappings":"AAuCA,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAa1C"}
|
|
@@ -7,6 +7,7 @@ exports.expect = expect;
|
|
|
7
7
|
const test_1 = require("@playwright/test");
|
|
8
8
|
const singleton_js_1 = require("../engine/singleton.js");
|
|
9
9
|
const expectProxy_js_1 = require("./expectProxy.js");
|
|
10
|
+
const index_js_1 = require("./index.js");
|
|
10
11
|
function extractPage(value) {
|
|
11
12
|
if (!value || typeof value !== 'object')
|
|
12
13
|
return null;
|
|
@@ -40,7 +41,7 @@ function expect(value) {
|
|
|
40
41
|
const page = extractPage(value);
|
|
41
42
|
if (page) {
|
|
42
43
|
const filePath = getCallerFile();
|
|
43
|
-
return (0, expectProxy_js_1.createHealingExpect)(singleton_js_1.sharedEngine, page, filePath, 0)(value);
|
|
44
|
+
return (0, expectProxy_js_1.createHealingExpect)(singleton_js_1.sharedEngine, page, filePath, 0, index_js_1.resolveFixwrightProxy)(value);
|
|
44
45
|
}
|
|
45
46
|
return (0, test_1.expect)(value);
|
|
46
47
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export { defineConfig } from './config/defineConfig.js';
|
|
2
|
+
export type { SelaConfig, ResolvedConfig } from './config/SelaConfig.js';
|
|
1
3
|
export type * from '@playwright/test';
|
|
2
4
|
export { chromium, firefox, webkit, devices, selectors } from '@playwright/test';
|
|
3
5
|
export { test } from './fixtures/index.js';
|
|
4
6
|
export { expect } from './fixtures/moduleExpect.js';
|
|
5
|
-
export { defineConfig } from './config/defineConfig.js';
|
|
6
|
-
export type { SelaConfig, ResolvedConfig } from './config/SelaConfig.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGzE,mBAAmB,kBAAkB,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIjF,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAI3C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
2
|
+
// sela-core — AI self-healing Playwright wrapper
|
|
3
3
|
//
|
|
4
4
|
// Drop-in replacement for @playwright/test:
|
|
5
|
-
// import { test, expect } from 'sela'
|
|
6
|
-
//
|
|
7
|
-
// All Playwright primitives are re-exported. Only `test` and `expect`
|
|
8
|
-
// are overridden with Sela's healing versions.
|
|
5
|
+
// import { test, expect } from 'sela-core'
|
|
9
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
7
|
+
exports.expect = exports.test = exports.selectors = exports.devices = exports.webkit = exports.firefox = exports.chromium = exports.defineConfig = void 0;
|
|
8
|
+
// Config DSL exported FIRST so `sela.config.ts` can `import { defineConfig }`
|
|
9
|
+
// without triggering the heavier fixtures/engine graph during config load.
|
|
10
|
+
var defineConfig_js_1 = require("./config/defineConfig.js");
|
|
11
|
+
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_js_1.defineConfig; } });
|
|
11
12
|
// Playwright value exports (launchers, devices, etc.)
|
|
12
13
|
var test_1 = require("@playwright/test");
|
|
13
14
|
Object.defineProperty(exports, "chromium", { enumerable: true, get: function () { return test_1.chromium; } });
|
|
@@ -19,10 +20,7 @@ Object.defineProperty(exports, "selectors", { enumerable: true, get: function ()
|
|
|
19
20
|
// locator proxy, and fixture-scoped healing expect
|
|
20
21
|
var index_js_1 = require("./fixtures/index.js");
|
|
21
22
|
Object.defineProperty(exports, "test", { enumerable: true, get: function () { return index_js_1.test; } });
|
|
22
|
-
// Sela's healing expect — works standalone (import { expect } from 'sela')
|
|
23
|
+
// Sela's healing expect — works standalone (import { expect } from 'sela-core')
|
|
23
24
|
// Detects page from locator, falls back to raw PW expect for non-locators
|
|
24
25
|
var moduleExpect_js_1 = require("./fixtures/moduleExpect.js");
|
|
25
26
|
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return moduleExpect_js_1.expect; } });
|
|
26
|
-
// Config DSL — defineConfig() provides TypeScript inference for sela.config.ts
|
|
27
|
-
var defineConfig_js_1 = require("./config/defineConfig.js");
|
|
28
|
-
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_js_1.defineConfig; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sela-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "AI self-healing Playwright wrapper — drop-in replacement for @playwright/test",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@playwright/test": "^1.58.2",
|
|
59
59
|
"@types/jest": "^30.0.0",
|
|
60
|
-
"@types/node": "^25.6.
|
|
60
|
+
"@types/node": "^25.6.2",
|
|
61
61
|
"jest": "^30.3.0",
|
|
62
62
|
"jsdom": "^29.0.1",
|
|
63
63
|
"ts-jest": "^29.4.6",
|