rrweb-browser-test 2.2.0 → 2.3.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.
- package/README.md +131 -30
- package/dist/index.cjs +845 -412
- package/dist/index.js +854 -429
- package/package.json +60 -36
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.claude/settings.local.json +0 -7
- package/.github/workflows/ci.yml +0 -29
- package/.prettierrc +0 -7
- package/CHANGELOG.md +0 -66
- package/example/index.js +0 -18
- package/src/appium/index.ts +0 -50
- package/src/core.ts +0 -43
- package/src/cypress/index.ts +0 -127
- package/src/detox/index.ts +0 -50
- package/src/espresso/index.ts +0 -61
- package/src/index.ts +0 -3
- package/src/mobile/shared.ts +0 -146
- package/src/playwright/index.ts +0 -131
- package/src/puppeteer/index.ts +0 -140
- package/src/selenium/index.ts +0 -136
- package/src/types.ts +0 -37
- package/src/utils.test.ts +0 -6
- package/src/utils.ts +0 -71
- package/src/xcuitest/index.ts +0 -58
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -9
package/src/xcuitest/index.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { eventWithTime } from '@rrweb/types';
|
|
2
|
-
import { indent } from '../utils';
|
|
3
|
-
import { extractMobileActions, type MobileLocator } from '../mobile/shared';
|
|
4
|
-
|
|
5
|
-
const esc = (s: string) => s.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
6
|
-
|
|
7
|
-
/** Swift XCUIElement query for a tap target. */
|
|
8
|
-
const tapTarget = (loc?: MobileLocator): string => {
|
|
9
|
-
if (!loc) return `app.buttons["TODO_add_accessibility_identifier"]`;
|
|
10
|
-
if (loc.strategy === 'text') return `app.staticTexts["${esc(loc.value)}"]`;
|
|
11
|
-
return `app.buttons["${esc(loc.value)}"]`;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const inputTarget = (loc?: MobileLocator): string => {
|
|
15
|
-
if (!loc) return `app.textFields["TODO_add_accessibility_identifier"]`;
|
|
16
|
-
return `app.textFields["${esc(loc.value)}"]`;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const swipeFn = (direction: 'up' | 'down' | 'left' | 'right') =>
|
|
20
|
-
({
|
|
21
|
-
up: 'swipeUp',
|
|
22
|
-
down: 'swipeDown',
|
|
23
|
-
left: 'swipeLeft',
|
|
24
|
-
right: 'swipeRight',
|
|
25
|
-
})[direction];
|
|
26
|
-
|
|
27
|
-
/** XCUITest (Swift) mobile test from a session recording. */
|
|
28
|
-
export const generateXcuiTests = (
|
|
29
|
-
events: Array<eventWithTime | string>,
|
|
30
|
-
): string => {
|
|
31
|
-
const actions = extractMobileActions(events);
|
|
32
|
-
let code = '';
|
|
33
|
-
|
|
34
|
-
code += `// XCUITest (Swift) — generated from a session recording\n`;
|
|
35
|
-
code += `func testReplaySession() {\n`;
|
|
36
|
-
code += `${indent(2)}let app = XCUIApplication()\n`;
|
|
37
|
-
code += `${indent(2)}app.launch()\n`;
|
|
38
|
-
|
|
39
|
-
actions.forEach((a) => {
|
|
40
|
-
switch (a.kind) {
|
|
41
|
-
case 'launch':
|
|
42
|
-
break; // already launched above
|
|
43
|
-
case 'tap':
|
|
44
|
-
code += `${indent(2)}${tapTarget(a.locator)}.tap()\n`;
|
|
45
|
-
break;
|
|
46
|
-
case 'input':
|
|
47
|
-
code += `${indent(2)}${inputTarget(a.locator)}.tap()\n`;
|
|
48
|
-
code += `${indent(2)}${inputTarget(a.locator)}.typeText("${esc(a.text)}")\n`;
|
|
49
|
-
break;
|
|
50
|
-
case 'swipe':
|
|
51
|
-
code += `${indent(2)}app.${swipeFn(a.direction)}()\n`;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
code += `}\n`;
|
|
57
|
-
return code;
|
|
58
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"esModuleInterop": true,
|
|
4
|
-
"skipLibCheck": true,
|
|
5
|
-
"target": "es2022",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"resolveJsonModule": true,
|
|
8
|
-
"moduleDetection": "force",
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"verbatimModuleSyntax": true,
|
|
11
|
-
|
|
12
|
-
"strict": true,
|
|
13
|
-
"noUncheckedIndexedAccess": true,
|
|
14
|
-
"noImplicitOverride": true,
|
|
15
|
-
|
|
16
|
-
"module": "Preserve",
|
|
17
|
-
"lib": ["es2022"],
|
|
18
|
-
"noEmit": true
|
|
19
|
-
}
|
|
20
|
-
}
|