cyperful 0.1.3 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,120 @@
1
+ (() => {
2
+ const f = console.log, d = (...t) => f("[Cyperful Agent]", ...t);
3
+ d("Loading...");
4
+ const { CYPERFUL_ORIGIN: u } = __CYPERFUL_CONFIG__;
5
+ if (window.location.origin === u) {
6
+ d("Ignoring parent frame (Why are we here?)");
7
+ return;
8
+ }
9
+ let y = 0;
10
+ const i = (t, n, e = null) => {
11
+ let s = null;
12
+ try {
13
+ const r = Date.now(), c = `${r}-${y++}`;
14
+ if ("url" in n && n.url != null)
15
+ try {
16
+ const o = new URL(n.url, window.location.origin);
17
+ if (o.origin === u)
18
+ return null;
19
+ o.origin === window.location.origin && (n.url = o.pathname + o.search + o.hash);
20
+ } catch {
21
+ }
22
+ s = {
23
+ type: t,
24
+ data: n,
25
+ id: c,
26
+ timestamp: r,
27
+ start_id: e ? e.id : void 0
28
+ }, window.parent.postMessage(s, u);
29
+ } catch {
30
+ }
31
+ return s;
32
+ };
33
+ for (const t of [
34
+ "log",
35
+ "error",
36
+ "warn",
37
+ "info",
38
+ "dir",
39
+ "debug"
40
+ ]) {
41
+ const n = console[t];
42
+ n && (console[t] = (...e) => {
43
+ n.apply(console, e), i("log", { level: t, args: e });
44
+ });
45
+ }
46
+ window.addEventListener("error", (t) => {
47
+ i("global_error", { message: t.error.toString() });
48
+ }), window.addEventListener("unhandledrejection", (t) => {
49
+ i("unhandledrejection", { message: t.reason.toString() });
50
+ });
51
+ function w(t) {
52
+ try {
53
+ if (typeof t == "string")
54
+ return JSON.parse(t);
55
+ } catch {
56
+ return t;
57
+ }
58
+ }
59
+ function g(t) {
60
+ const n = {};
61
+ for (const [e, s] of t.entries())
62
+ n[e] = s.toString();
63
+ return n;
64
+ }
65
+ const _ = window.XMLHttpRequest;
66
+ function m() {
67
+ const t = new _(), n = t.open;
68
+ return t.open = (...e) => {
69
+ const [s, r, c] = e, o = i("xhr", {
70
+ method: s,
71
+ url: r
72
+ // body,
73
+ });
74
+ return t.addEventListener("load", () => {
75
+ o && i(
76
+ "xhr:finished",
77
+ { status: t.status, response: t.response },
78
+ o
79
+ );
80
+ }), n.apply(this, e);
81
+ }, t;
82
+ }
83
+ window.XMLHttpRequest = m;
84
+ const L = window.fetch;
85
+ window.fetch = (...t) => {
86
+ const [n, e = {}] = typeof t[0] == "string" || t[0] instanceof URL ? [t[0], t[1]] : [t[0].url, t[0]], s = e.method ?? "GET", r = e.body, c = e.headers || {}, o = c["content-type"] || c["Content-Type"] || void 0, v = r instanceof FormData ? g(r) : o != null && o.includes("application/json") ? w(r) : r, p = i("fetch", {
87
+ method: s,
88
+ url: n.toString(),
89
+ body: v,
90
+ bodyType: o
91
+ }), h = L(...t);
92
+ return h.then(async (a) => {
93
+ const l = a.headers.get("content-type") || "", b = l.includes("application/json") ? await a.clone().json() : l.includes("text/") ? await a.clone().text() : `[[ Unhandled content-type: ${l || "<empty>"} ]]`;
94
+ p && i(
95
+ "fetch:finished",
96
+ {
97
+ status: a.status,
98
+ responseType: l || void 0,
99
+ response: b
100
+ },
101
+ p
102
+ );
103
+ }).catch(() => {
104
+ }), h;
105
+ };
106
+ const S = history.pushState;
107
+ history.pushState = (...t) => {
108
+ S.apply(history, t), i("client_navigate", {
109
+ url: location.href,
110
+ replace: !1
111
+ });
112
+ };
113
+ const R = history.replaceState;
114
+ history.replaceState = (...t) => {
115
+ R.apply(history, t), i("client_navigate", {
116
+ url: location.href,
117
+ replace: !0
118
+ });
119
+ }, d("Loaded.");
120
+ })();
data/public/index.html CHANGED
@@ -3,12 +3,10 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
-
7
-
8
- <link rel="icon" href="/assets/favicon-9f6bc28c.ico" />
6
+ <link rel="icon" href="/assets/favicon-DMdBZQlK.ico" />
9
7
  <title>Cyperful</title>
10
- <script type="module" crossorigin src="/assets/index-722e2568.js"></script>
11
- <link rel="stylesheet" href="/assets/index-fb0f529b.css">
8
+ <script type="module" crossorigin src="/assets/index-DMlaSnZ7.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-CDElGKtz.css">
12
10
  </head>
13
11
  <body>
14
12
  <div id="root"></div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyperful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wyatt Ades
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-23 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -59,16 +59,16 @@ extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
61
  - lib/cyperful.rb
62
+ - lib/cyperful/commands.rb
62
63
  - lib/cyperful/driver.rb
63
64
  - lib/cyperful/framework_injections.rb
64
65
  - lib/cyperful/test_parser.rb
65
66
  - lib/cyperful/ui_server.rb
66
- - public/assets/favicon-9f6bc28c.ico
67
- - public/assets/index-722e2568.js
68
- - public/assets/index-fb0f529b.css
69
- - public/assets/logo-169f5e20.svg
67
+ - public/assets/favicon-DMdBZQlK.ico
68
+ - public/assets/index-CDElGKtz.css
69
+ - public/assets/index-DMlaSnZ7.js
70
+ - public/frame-agent.js
70
71
  - public/index.html
71
- - watcher.js
72
72
  homepage: https://github.com/stepful/cyperful
73
73
  licenses:
74
74
  - MIT
@@ -88,8 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
- rubygems_version: 3.4.19
91
+ rubygems_version: 3.5.6
92
92
  signing_key:
93
93
  specification_version: 4
94
- summary: Cypress-esque testing for Capybara tests
94
+ summary: Interactive test debugger for Capybara tests
95
95
  test_files: []