@elliemae/ssf-host 2.26.0 → 2.28.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/dist/cjs/guest.js +8 -2
- package/dist/cjs/host.js +47 -9
- package/dist/cjs/tests/utils.js +2 -2
- package/dist/cjs/utils.js +10 -3
- package/dist/esm/guest.js +8 -2
- package/dist/esm/host.js +50 -10
- package/dist/esm/tests/utils.js +2 -2
- package/dist/esm/utils.js +10 -3
- package/dist/public/callchain-host.html +1 -1
- package/dist/public/callchain-intermediate.html +1 -1
- package/dist/public/e2e-host.html +1 -1
- package/dist/public/e2e-index.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfHost.c285de67388a3f6cc8f9.js +3 -0
- package/dist/public/js/emuiSsfHost.c285de67388a3f6cc8f9.js.br +0 -0
- package/dist/public/js/emuiSsfHost.c285de67388a3f6cc8f9.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.c285de67388a3f6cc8f9.js.map +1 -0
- package/dist/public/popup-focus-host.html +1 -1
- package/dist/public/v1-guest-v2-host.html +1 -1
- package/dist/public/v2-host-v1-guest.html +1 -1
- package/dist/types/lib/guest.d.ts +4 -0
- package/dist/types/lib/tests/guestCapabilities.test.d.ts +1 -0
- package/dist/types/lib/tests/utils.d.ts +1 -1
- package/dist/types/lib/types.d.ts +4 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/package.json +7 -7
- package/dist/public/js/emuiSsfHost.5bb7139d7e86c74f0b6d.js +0 -3
- package/dist/public/js/emuiSsfHost.5bb7139d7e86c74f0b6d.js.br +0 -0
- package/dist/public/js/emuiSsfHost.5bb7139d7e86c74f0b6d.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.5bb7139d7e86c74f0b6d.js.map +0 -1
package/dist/cjs/guest.js
CHANGED
|
@@ -77,6 +77,10 @@ class Guest {
|
|
|
77
77
|
* performance tracker for timing measurements
|
|
78
78
|
*/
|
|
79
79
|
#perfTracker;
|
|
80
|
+
/**
|
|
81
|
+
* one-time token for popup handshake when window.opener is unavailable
|
|
82
|
+
*/
|
|
83
|
+
#handshakeToken;
|
|
80
84
|
/**
|
|
81
85
|
* Create object representing guest application
|
|
82
86
|
* @param {GuestOption} option - options for creating a guest application
|
|
@@ -91,7 +95,8 @@ class Guest {
|
|
|
91
95
|
searchParams = {},
|
|
92
96
|
openMode = import_types.OpenMode.Embed,
|
|
93
97
|
remoting,
|
|
94
|
-
perfTracker
|
|
98
|
+
perfTracker,
|
|
99
|
+
handshakeToken
|
|
95
100
|
} = option;
|
|
96
101
|
this.id = guestId;
|
|
97
102
|
this.title = title;
|
|
@@ -104,6 +109,7 @@ class Guest {
|
|
|
104
109
|
this.capabilities = {};
|
|
105
110
|
this.#perfTracker = perfTracker;
|
|
106
111
|
this.#remoting = remoting;
|
|
112
|
+
this.#handshakeToken = handshakeToken;
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* clean up resources
|
|
@@ -164,7 +170,7 @@ class Guest {
|
|
|
164
170
|
targetWin: this.window,
|
|
165
171
|
targetOrigin: this.origin,
|
|
166
172
|
messageType: import_microfe_common.MessageType.HandShake,
|
|
167
|
-
messageBody: {}
|
|
173
|
+
messageBody: this.#handshakeToken ? { handshakeToken: this.#handshakeToken } : {}
|
|
168
174
|
});
|
|
169
175
|
handShakeCount += 1;
|
|
170
176
|
}
|
package/dist/cjs/host.js
CHANGED
|
@@ -721,6 +721,12 @@ class SSFHost {
|
|
|
721
721
|
this.#popupGuestMonitor = null;
|
|
722
722
|
}
|
|
723
723
|
};
|
|
724
|
+
#buildPopupUrl = (url) => {
|
|
725
|
+
const trusted = (0, import_utils.isTrustedDomain)(url);
|
|
726
|
+
const handshakeToken = trusted ? void 0 : (0, import_uuid.v4)();
|
|
727
|
+
const popupUrl = handshakeToken ? `${url}#hs=${handshakeToken}` : url;
|
|
728
|
+
return { popupUrl, handshakeToken, trusted };
|
|
729
|
+
};
|
|
724
730
|
#openPopupGuest = (param) => {
|
|
725
731
|
const {
|
|
726
732
|
url,
|
|
@@ -748,7 +754,12 @@ class SSFHost {
|
|
|
748
754
|
}
|
|
749
755
|
} else {
|
|
750
756
|
const windowFeatures = Object.entries({ width, height, top, left }).filter(([, v]) => v).map(([k, v]) => `${k}=${v}`).join(",");
|
|
751
|
-
const
|
|
757
|
+
const { popupUrl, handshakeToken, trusted } = this.#buildPopupUrl(url);
|
|
758
|
+
const guestWindow = window.open(
|
|
759
|
+
popupUrl,
|
|
760
|
+
title,
|
|
761
|
+
`popup, ${windowFeatures}`
|
|
762
|
+
);
|
|
752
763
|
if (!guestWindow) {
|
|
753
764
|
setTimeout(() => {
|
|
754
765
|
try {
|
|
@@ -771,7 +782,7 @@ class SSFHost {
|
|
|
771
782
|
}
|
|
772
783
|
}, 0);
|
|
773
784
|
}
|
|
774
|
-
if (!
|
|
785
|
+
if (!trusted) {
|
|
775
786
|
guestWindow.opener = null;
|
|
776
787
|
}
|
|
777
788
|
guest = this.#attachGuest({
|
|
@@ -780,7 +791,8 @@ class SSFHost {
|
|
|
780
791
|
title,
|
|
781
792
|
url,
|
|
782
793
|
searchParams,
|
|
783
|
-
openMode: import_types.OpenMode.Popup
|
|
794
|
+
openMode: import_types.OpenMode.Popup,
|
|
795
|
+
handshakeToken
|
|
784
796
|
});
|
|
785
797
|
this.#monitorPopupGuests();
|
|
786
798
|
}
|
|
@@ -997,6 +1009,30 @@ class SSFHost {
|
|
|
997
1009
|
`host is closed. hostId: ${this.hostId}, correlationId: ${this.#correlationId}`
|
|
998
1010
|
);
|
|
999
1011
|
};
|
|
1012
|
+
#dispatchEventToMatchingGuests = ({
|
|
1013
|
+
targetGuest,
|
|
1014
|
+
guestCapabilities,
|
|
1015
|
+
scriptingEventId,
|
|
1016
|
+
dispatchToGuest
|
|
1017
|
+
}) => {
|
|
1018
|
+
const tryDispatch = (guest) => {
|
|
1019
|
+
if ((0, import_microfe_common.hasFilterCriteria)(guestCapabilities) && !(0, import_microfe_common.matchesGuestCapabilities)(guest.capabilities, guestCapabilities)) {
|
|
1020
|
+
this.#logger.debug({
|
|
1021
|
+
message: "Event skipped \u2014 guest capabilities do not match eventOptions.guestCapabilities",
|
|
1022
|
+
scriptingEventId,
|
|
1023
|
+
guestCapabilities,
|
|
1024
|
+
...guest.getInfo()
|
|
1025
|
+
});
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
dispatchToGuest(guest);
|
|
1029
|
+
};
|
|
1030
|
+
if (targetGuest) {
|
|
1031
|
+
tryDispatch(targetGuest);
|
|
1032
|
+
} else {
|
|
1033
|
+
this.#guests.forEach(tryDispatch);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1000
1036
|
/**
|
|
1001
1037
|
* dispatch event to guest application(s)
|
|
1002
1038
|
* @param {EventDetail} params details of the event to be dispatched
|
|
@@ -1012,7 +1048,8 @@ class SSFHost {
|
|
|
1012
1048
|
eventHandler = null,
|
|
1013
1049
|
timeout = null,
|
|
1014
1050
|
window: targetWindow = null,
|
|
1015
|
-
guestId
|
|
1051
|
+
guestId,
|
|
1052
|
+
guestCapabilities
|
|
1016
1053
|
} = eventOptions;
|
|
1017
1054
|
const objectId = id.split(".")[0];
|
|
1018
1055
|
const guestIdorWnd = guestId || targetWindow;
|
|
@@ -1069,11 +1106,12 @@ class SSFHost {
|
|
|
1069
1106
|
});
|
|
1070
1107
|
}
|
|
1071
1108
|
};
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1109
|
+
this.#dispatchEventToMatchingGuests({
|
|
1110
|
+
targetGuest: targetGuest ?? null,
|
|
1111
|
+
guestCapabilities,
|
|
1112
|
+
scriptingEventId: id,
|
|
1113
|
+
dispatchToGuest
|
|
1114
|
+
});
|
|
1077
1115
|
return Promise.all(guestPromises).then((values) => {
|
|
1078
1116
|
this.#logger.debug({
|
|
1079
1117
|
message: "Event feedback received",
|
package/dist/cjs/tests/utils.js
CHANGED
|
@@ -59,14 +59,14 @@ const postMessage = ({
|
|
|
59
59
|
})
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
|
-
const initGuest = (guestId) => {
|
|
62
|
+
const initGuest = (guestId, capabilities = { eventFeedback: true }) => {
|
|
63
63
|
const { contentWindow: guestWindow } = document.getElementById(guestId) || {};
|
|
64
64
|
if (!guestWindow) throw new Error("Could not find guest window");
|
|
65
65
|
postMessage({
|
|
66
66
|
srcWindow: guestWindow,
|
|
67
67
|
targetWindow: guestWindow.parent,
|
|
68
68
|
message: {
|
|
69
|
-
body:
|
|
69
|
+
body: capabilities,
|
|
70
70
|
type: import_microfe_common.MessageType.GuestReady
|
|
71
71
|
}
|
|
72
72
|
});
|
package/dist/cjs/utils.js
CHANGED
|
@@ -40,12 +40,19 @@ function isFunction(value) {
|
|
|
40
40
|
}
|
|
41
41
|
const TRUSTED_DOMAIN_SUFFIXES = [".ice.com", ".elliemae.com", ".ellielabs.com"];
|
|
42
42
|
const TRUSTED_HOSTNAMES = ["localhost", "127.0.0.1"];
|
|
43
|
+
const getRootDomain = (hostname) => hostname.split(".").slice(-2).join(".");
|
|
44
|
+
const isKnownTrustedDomain = (hostname) => TRUSTED_HOSTNAMES.includes(hostname) || TRUSTED_DOMAIN_SUFFIXES.some(
|
|
45
|
+
(suffix) => hostname === suffix.slice(1) || hostname.endsWith(suffix)
|
|
46
|
+
);
|
|
47
|
+
const isSameDomainFamily = (hostname) => {
|
|
48
|
+
const hostRoot = getRootDomain(window.location.hostname);
|
|
49
|
+
const guestRoot = getRootDomain(hostname);
|
|
50
|
+
return hostRoot === guestRoot;
|
|
51
|
+
};
|
|
43
52
|
const isTrustedDomain = (url) => {
|
|
44
53
|
try {
|
|
45
54
|
const { hostname } = new URL(url, document.baseURI);
|
|
46
|
-
return
|
|
47
|
-
(suffix) => hostname === suffix.slice(1) || hostname.endsWith(suffix)
|
|
48
|
-
);
|
|
55
|
+
return isKnownTrustedDomain(hostname) || isSameDomainFamily(hostname);
|
|
49
56
|
} catch {
|
|
50
57
|
return false;
|
|
51
58
|
}
|
package/dist/esm/guest.js
CHANGED
|
@@ -54,6 +54,10 @@ class Guest {
|
|
|
54
54
|
* performance tracker for timing measurements
|
|
55
55
|
*/
|
|
56
56
|
#perfTracker;
|
|
57
|
+
/**
|
|
58
|
+
* one-time token for popup handshake when window.opener is unavailable
|
|
59
|
+
*/
|
|
60
|
+
#handshakeToken;
|
|
57
61
|
/**
|
|
58
62
|
* Create object representing guest application
|
|
59
63
|
* @param {GuestOption} option - options for creating a guest application
|
|
@@ -68,7 +72,8 @@ class Guest {
|
|
|
68
72
|
searchParams = {},
|
|
69
73
|
openMode = OpenMode.Embed,
|
|
70
74
|
remoting,
|
|
71
|
-
perfTracker
|
|
75
|
+
perfTracker,
|
|
76
|
+
handshakeToken
|
|
72
77
|
} = option;
|
|
73
78
|
this.id = guestId;
|
|
74
79
|
this.title = title;
|
|
@@ -81,6 +86,7 @@ class Guest {
|
|
|
81
86
|
this.capabilities = {};
|
|
82
87
|
this.#perfTracker = perfTracker;
|
|
83
88
|
this.#remoting = remoting;
|
|
89
|
+
this.#handshakeToken = handshakeToken;
|
|
84
90
|
}
|
|
85
91
|
/**
|
|
86
92
|
* clean up resources
|
|
@@ -141,7 +147,7 @@ class Guest {
|
|
|
141
147
|
targetWin: this.window,
|
|
142
148
|
targetOrigin: this.origin,
|
|
143
149
|
messageType: MessageType.HandShake,
|
|
144
|
-
messageBody: {}
|
|
150
|
+
messageBody: this.#handshakeToken ? { handshakeToken: this.#handshakeToken } : {}
|
|
145
151
|
});
|
|
146
152
|
handShakeCount += 1;
|
|
147
153
|
}
|
package/dist/esm/host.js
CHANGED
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
Event,
|
|
7
7
|
ScriptingObjectManager,
|
|
8
8
|
ProxyEvent,
|
|
9
|
-
isScriptingObjectProxy
|
|
9
|
+
isScriptingObjectProxy,
|
|
10
|
+
hasFilterCriteria,
|
|
11
|
+
matchesGuestCapabilities
|
|
10
12
|
} from "@elliemae/microfe-common";
|
|
11
13
|
import {
|
|
12
14
|
IFrameSandboxValues,
|
|
@@ -708,6 +710,12 @@ class SSFHost {
|
|
|
708
710
|
this.#popupGuestMonitor = null;
|
|
709
711
|
}
|
|
710
712
|
};
|
|
713
|
+
#buildPopupUrl = (url) => {
|
|
714
|
+
const trusted = isTrustedDomain(url);
|
|
715
|
+
const handshakeToken = trusted ? void 0 : uuidv4();
|
|
716
|
+
const popupUrl = handshakeToken ? `${url}#hs=${handshakeToken}` : url;
|
|
717
|
+
return { popupUrl, handshakeToken, trusted };
|
|
718
|
+
};
|
|
711
719
|
#openPopupGuest = (param) => {
|
|
712
720
|
const {
|
|
713
721
|
url,
|
|
@@ -735,7 +743,12 @@ class SSFHost {
|
|
|
735
743
|
}
|
|
736
744
|
} else {
|
|
737
745
|
const windowFeatures = Object.entries({ width, height, top, left }).filter(([, v]) => v).map(([k, v]) => `${k}=${v}`).join(",");
|
|
738
|
-
const
|
|
746
|
+
const { popupUrl, handshakeToken, trusted } = this.#buildPopupUrl(url);
|
|
747
|
+
const guestWindow = window.open(
|
|
748
|
+
popupUrl,
|
|
749
|
+
title,
|
|
750
|
+
`popup, ${windowFeatures}`
|
|
751
|
+
);
|
|
739
752
|
if (!guestWindow) {
|
|
740
753
|
setTimeout(() => {
|
|
741
754
|
try {
|
|
@@ -758,7 +771,7 @@ class SSFHost {
|
|
|
758
771
|
}
|
|
759
772
|
}, 0);
|
|
760
773
|
}
|
|
761
|
-
if (!
|
|
774
|
+
if (!trusted) {
|
|
762
775
|
guestWindow.opener = null;
|
|
763
776
|
}
|
|
764
777
|
guest = this.#attachGuest({
|
|
@@ -767,7 +780,8 @@ class SSFHost {
|
|
|
767
780
|
title,
|
|
768
781
|
url,
|
|
769
782
|
searchParams,
|
|
770
|
-
openMode: OpenMode.Popup
|
|
783
|
+
openMode: OpenMode.Popup,
|
|
784
|
+
handshakeToken
|
|
771
785
|
});
|
|
772
786
|
this.#monitorPopupGuests();
|
|
773
787
|
}
|
|
@@ -984,6 +998,30 @@ class SSFHost {
|
|
|
984
998
|
`host is closed. hostId: ${this.hostId}, correlationId: ${this.#correlationId}`
|
|
985
999
|
);
|
|
986
1000
|
};
|
|
1001
|
+
#dispatchEventToMatchingGuests = ({
|
|
1002
|
+
targetGuest,
|
|
1003
|
+
guestCapabilities,
|
|
1004
|
+
scriptingEventId,
|
|
1005
|
+
dispatchToGuest
|
|
1006
|
+
}) => {
|
|
1007
|
+
const tryDispatch = (guest) => {
|
|
1008
|
+
if (hasFilterCriteria(guestCapabilities) && !matchesGuestCapabilities(guest.capabilities, guestCapabilities)) {
|
|
1009
|
+
this.#logger.debug({
|
|
1010
|
+
message: "Event skipped \u2014 guest capabilities do not match eventOptions.guestCapabilities",
|
|
1011
|
+
scriptingEventId,
|
|
1012
|
+
guestCapabilities,
|
|
1013
|
+
...guest.getInfo()
|
|
1014
|
+
});
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
dispatchToGuest(guest);
|
|
1018
|
+
};
|
|
1019
|
+
if (targetGuest) {
|
|
1020
|
+
tryDispatch(targetGuest);
|
|
1021
|
+
} else {
|
|
1022
|
+
this.#guests.forEach(tryDispatch);
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
987
1025
|
/**
|
|
988
1026
|
* dispatch event to guest application(s)
|
|
989
1027
|
* @param {EventDetail} params details of the event to be dispatched
|
|
@@ -999,7 +1037,8 @@ class SSFHost {
|
|
|
999
1037
|
eventHandler = null,
|
|
1000
1038
|
timeout = null,
|
|
1001
1039
|
window: targetWindow = null,
|
|
1002
|
-
guestId
|
|
1040
|
+
guestId,
|
|
1041
|
+
guestCapabilities
|
|
1003
1042
|
} = eventOptions;
|
|
1004
1043
|
const objectId = id.split(".")[0];
|
|
1005
1044
|
const guestIdorWnd = guestId || targetWindow;
|
|
@@ -1056,11 +1095,12 @@ class SSFHost {
|
|
|
1056
1095
|
});
|
|
1057
1096
|
}
|
|
1058
1097
|
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1098
|
+
this.#dispatchEventToMatchingGuests({
|
|
1099
|
+
targetGuest: targetGuest ?? null,
|
|
1100
|
+
guestCapabilities,
|
|
1101
|
+
scriptingEventId: id,
|
|
1102
|
+
dispatchToGuest
|
|
1103
|
+
});
|
|
1064
1104
|
return Promise.all(guestPromises).then((values) => {
|
|
1065
1105
|
this.#logger.debug({
|
|
1066
1106
|
message: "Event feedback received",
|
package/dist/esm/tests/utils.js
CHANGED
|
@@ -33,14 +33,14 @@ const postMessage = ({
|
|
|
33
33
|
})
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
|
-
const initGuest = (guestId) => {
|
|
36
|
+
const initGuest = (guestId, capabilities = { eventFeedback: true }) => {
|
|
37
37
|
const { contentWindow: guestWindow } = document.getElementById(guestId) || {};
|
|
38
38
|
if (!guestWindow) throw new Error("Could not find guest window");
|
|
39
39
|
postMessage({
|
|
40
40
|
srcWindow: guestWindow,
|
|
41
41
|
targetWindow: guestWindow.parent,
|
|
42
42
|
message: {
|
|
43
|
-
body:
|
|
43
|
+
body: capabilities,
|
|
44
44
|
type: MessageType.GuestReady
|
|
45
45
|
}
|
|
46
46
|
});
|
package/dist/esm/utils.js
CHANGED
|
@@ -14,12 +14,19 @@ function isFunction(value) {
|
|
|
14
14
|
}
|
|
15
15
|
const TRUSTED_DOMAIN_SUFFIXES = [".ice.com", ".elliemae.com", ".ellielabs.com"];
|
|
16
16
|
const TRUSTED_HOSTNAMES = ["localhost", "127.0.0.1"];
|
|
17
|
+
const getRootDomain = (hostname) => hostname.split(".").slice(-2).join(".");
|
|
18
|
+
const isKnownTrustedDomain = (hostname) => TRUSTED_HOSTNAMES.includes(hostname) || TRUSTED_DOMAIN_SUFFIXES.some(
|
|
19
|
+
(suffix) => hostname === suffix.slice(1) || hostname.endsWith(suffix)
|
|
20
|
+
);
|
|
21
|
+
const isSameDomainFamily = (hostname) => {
|
|
22
|
+
const hostRoot = getRootDomain(window.location.hostname);
|
|
23
|
+
const guestRoot = getRootDomain(hostname);
|
|
24
|
+
return hostRoot === guestRoot;
|
|
25
|
+
};
|
|
17
26
|
const isTrustedDomain = (url) => {
|
|
18
27
|
try {
|
|
19
28
|
const { hostname } = new URL(url, document.baseURI);
|
|
20
|
-
return
|
|
21
|
-
(suffix) => hostname === suffix.slice(1) || hostname.endsWith(suffix)
|
|
22
|
-
);
|
|
29
|
+
return isKnownTrustedDomain(hostname) || isSameDomainFamily(hostname);
|
|
23
30
|
} catch {
|
|
24
31
|
return false;
|
|
25
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>CallChain E2E Test - Root Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>CallChain E2E Test - Root Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.c285de67388a3f6cc8f9.js"></script></head><body class="bg-gray-50"><header class="bg-indigo-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">CallChain E2E Test — Root Host (A)</h1><a href="./index.html" class="text-indigo-200 hover:text-white text-sm">← Back to main</a></header><main class="mx-auto max-w-7xl px-4 py-4"><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-2">Architecture</h2><pre class="text-xs text-blue-800 leading-relaxed">
|
|
2
2
|
Root Host (A) [localhost:4000]
|
|
3
3
|
├─ Exposes: <strong>TestService</strong> scripting object
|
|
4
4
|
├─ Loads guest <strong>"intermediateHost"</strong>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Intermediate Guest+Host (B)</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="http://localhost:4001/index.js"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Intermediate Guest+Host (B)</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="http://localhost:4001/index.js"></script><script defer="defer" src="js/emuiSsfHost.c285de67388a3f6cc8f9.js"></script></head><body class="bg-orange-50 p-2"><h2 class="text-sm font-semibold text-orange-800 mb-1">Intermediate (B) — Guest + Host</h2><div data-testid="intermediate-status" id="status" class="text-xs bg-orange-100 rounded p-2 mb-2 min-h-[30px]">Initializing...</div><div data-testid="grandchild-container" id="grandchild-container" class="border border-dashed border-orange-400 rounded h-[250px]"></div><script type="module">import{Analytics}from"./analytics-object-v2.js";import{getGuestBaseUrl,getHost}from"./utils.js";const statusEl=document.getElementById("status"),log=t=>{const e=(new Date).toLocaleTimeString();statusEl.innerHTML+=`<div>[${e}] ${t}</div>`};(async()=>{try{log("Connecting to Root Host (A) as V2 guest...");const t=new ice.guest.SSFGuest({logger:{index:"intermediate-guest",team:"ui platform",appName:"intermediate-b"},keepAlive:!1});await t.connect(),log("Connected to Root Host (A)");const e=await t.getObject("TestService");log("Got TestService proxy from Root Host (A)");const o=new Analytics,a=getHost(o);if(!a)return void log("ERROR: Failed to create intermediate SSFHost");log("Created intermediate SSFHost (B)");const n=a.cloneScriptingObject(e);a.addScriptingObject(n),log("Cloned TestService for grandchild guests");const i=await getGuestBaseUrl();a.loadGuest({id:"grandchildGuest",url:new URL("./callchain-grandchild.html",i).href,title:"Grandchild Guest (C)",targetElement:document.getElementById("grandchild-container"),metadata:{role:"validator",region:"US-East"},onLoad:()=>log("Grandchild guest (C) loaded"),onError:()=>log("ERROR: Grandchild guest (C) failed to load")}),log("Intermediate (B) ready")}catch(t){log(`ERROR: ${t.message}`)}})()</script></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.5bb7139d7e86c74f0b6d.js"></script></head><body class="bg-gray-50 text-sm"><header class="bg-indigo-700 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Comprehensive E2E Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">← Test Suite</a></header><main class="mx-auto max-w-7xl px-4 py-3"><div class="grid grid-cols-2 gap-3 mb-3"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 space-y-1 list-decimal list-inside"><li>Start the host dev server (port 4000) and guest dev server (port 4001).</li><li>Buttons in <strong>Column 1</strong> (left) execute host-side actions.</li><li><strong>Column 2</strong> (center) shows embedded guest iframes — interact with them to invoke methods, subscribe to events, etc.</li><li><strong>Column 3</strong> (right) shows live results: Event Log, callContext, dispatch results, and the guest list.</li><li>Work through the buttons <strong>top to bottom</strong> for the recommended flow. Each button is labelled with a test case ID (TC-xxx).</li></ol></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3"><h2 class="text-sm font-bold text-amber-900 mb-1">Recommended Flow</h2><ol class="text-xs text-amber-800 space-y-1 list-decimal list-inside"><li><strong>Load guests</strong>: TC-LOAD-01 (embed) → TC-LOAD-02 (popup) → TC-LOAD-04 (with params). Check Event Log for "loaded" messages.</li><li><strong>Scripting objects</strong>: TC-SO-01 (add Inventory). In the guest iframe, call <code>getObject("Inventory")</code> and invoke <code>getStock()</code>. Check return value and callContext.</li><li><strong>Events</strong>: In the guest, subscribe to <code>Loan.onPreSave</code>. Then click TC-EVT-01 on the host. Guest should receive the event.</li><li><strong>Lifecycle</strong>: TC-LIFE-01 (unload), TC-LIFE-03 (close host). Verify guests are removed and host is destroyed.</li></ol></div></div><div class="grid grid-cols-3 gap-3"><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Loading</h2><div class="space-y-2"><button data-testid="btn-load-embed" id="btnLoadEmbed" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-01: Load Embedded Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe appears in center column, log shows "loaded"</p><button data-testid="btn-load-popup" id="btnLoadPopup" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-02: Load Popup Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: new browser popup window opens</p><button data-testid="btn-load-multiple" id="btnLoadMultiple" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-03: loadGuests (3 instances)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: 3 guest iframes load, "List all guests" shows 3+ entries</p><button data-testid="btn-load-with-params" id="btnLoadWithParams" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-04: Load with searchParams</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest shows URL params in its "Params:" line</p><button data-testid="btn-load-with-metadata" id="btnLoadWithMetadata" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-META-01: Load with metadata</button><p class="text-[10px] text-gray-400 -mt-1">Expected: when guest invokes a method, callContext.callChain shows metadata</p><button data-testid="btn-load-bad-url" id="btnLoadBadUrl" class="w-full rounded bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-700">TC-LOAD-05: Load invalid URL (onError)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows "ERROR" or onError callback fires</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Scripting Object Management</h2><div class="space-y-2"><button data-testid="btn-add-so" id="btnAddSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-01: Add "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest can now <code>getObject("Inventory")</code> and invoke its methods</p><button data-testid="btn-add-guest-so" id="btnAddGuestSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-04: Add Guest-Scoped Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the target guest can access this object, others get "not available"</p><button data-testid="btn-remove-so" id="btnRemoveSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02: Remove "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest's <code>getObject("Inventory")</code> now fails</p><button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02b: Remove All Objects</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all getObject calls fail until objects are re-added</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Dispatching</h2><div class="space-y-2"><button data-testid="btn-dispatch-all" id="btnDispatchAll" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-01: Dispatch onPreSave to all</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests subscribed to onPreSave receive the event</p><button data-testid="btn-dispatch-targeted" id="btnDispatchTargeted" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-02: Dispatch to specific guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the targeted guest receives the event</p><button data-testid="btn-dispatch-feedback" id="btnDispatchFeedback" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-03: Dispatch with timeout (feedback)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Dispatch Results shows the guest's feedback return value</p><button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-04: Dispatch onAmountChanged (criteria)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only guests subscribed with matching criteria receive it</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Lifecycle</h2><div class="space-y-2"><button data-testid="btn-unload-guest" id="btnUnloadGuest" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-01: Unload first embedded guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe removed, "List all guests" count decreases</p><button data-testid="btn-register-close" id="btnRegisterClose" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-02: Register onGuestClose</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows callback registered; fires when guest calls close()</p><button data-testid="btn-list-guests" id="btnListGuests" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">List all guests</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Guest List panel shows all currently loaded guests</p><button data-testid="btn-set-loglevel" id="btnSetLogLevel" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">Set Log Level (Debug)</button> <button data-testid="btn-close-host" id="btnCloseHost" class="w-full rounded bg-red-700 px-3 py-1.5 text-xs text-white hover:bg-red-800">TC-LIFE-03: Close host</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests unloaded, host destroyed, further actions fail</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Configuration</h2><div class="space-y-2"><button data-testid="btn-sandbox-default" id="btnSandboxDefault" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-01: Default sandbox</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has standard sandbox attributes</p><button data-testid="btn-sandbox-custom" id="btnSandboxCustom" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-02: Custom sandbox values</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe sandbox attribute reflects custom permissions</p><button data-testid="btn-sandbox-disabled" id="btnSandboxDisabled" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-03: Sandbox disabled</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has no sandbox attribute (full permissions)</p></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Embedded Guests</h2><div data-testid="embed-container" id="embedContainer" class="border-2 border-dashed border-indigo-300 rounded min-h-[300px] space-y-2"></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Test Container</h2><div data-testid="sandbox-container" id="sandboxContainer" class="border-2 border-dashed border-teal-300 rounded min-h-[150px] space-y-2"></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Log</h2><div data-testid="event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[200px] max-h-[350px] overflow-y-auto font-mono"></div><button data-testid="btn-clear-log" id="btnClearLog" class="mt-1 text-xs text-gray-400 hover:text-gray-600">Clear</button></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">callContext (last invocation)</h2><div data-testid="callcontext-panel"><h3 class="text-xs text-gray-500">callContext.guest</h3><pre data-testid="callcontext-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.c285de67388a3f6cc8f9.js"></script></head><body class="bg-gray-50 text-sm"><header class="bg-indigo-700 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Comprehensive E2E Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">← Test Suite</a></header><main class="mx-auto max-w-7xl px-4 py-3"><div class="grid grid-cols-2 gap-3 mb-3"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 space-y-1 list-decimal list-inside"><li>Start the host dev server (port 4000) and guest dev server (port 4001).</li><li>Buttons in <strong>Column 1</strong> (left) execute host-side actions.</li><li><strong>Column 2</strong> (center) shows embedded guest iframes — interact with them to invoke methods, subscribe to events, etc.</li><li><strong>Column 3</strong> (right) shows live results: Event Log, callContext, dispatch results, and the guest list.</li><li>Work through the buttons <strong>top to bottom</strong> for the recommended flow. Each button is labelled with a test case ID (TC-xxx).</li></ol></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3"><h2 class="text-sm font-bold text-amber-900 mb-1">Recommended Flow</h2><ol class="text-xs text-amber-800 space-y-1 list-decimal list-inside"><li><strong>Load guests</strong>: TC-LOAD-01 (embed) → TC-LOAD-02 (popup) → TC-LOAD-04 (with params). Check Event Log for "loaded" messages.</li><li><strong>Scripting objects</strong>: TC-SO-01 (add Inventory). In the guest iframe, call <code>getObject("Inventory")</code> and invoke <code>getStock()</code>. Check return value and callContext.</li><li><strong>Events</strong>: In the guest, subscribe to <code>Loan.onPreSave</code>. Then click TC-EVT-01 on the host. Guest should receive the event.</li><li><strong>Lifecycle</strong>: TC-LIFE-01 (unload), TC-LIFE-03 (close host). Verify guests are removed and host is destroyed.</li></ol></div></div><div class="grid grid-cols-3 gap-3"><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Loading</h2><div class="space-y-2"><button data-testid="btn-load-embed" id="btnLoadEmbed" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-01: Load Embedded Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe appears in center column, log shows "loaded"</p><button data-testid="btn-load-popup" id="btnLoadPopup" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-02: Load Popup Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: new browser popup window opens</p><button data-testid="btn-load-multiple" id="btnLoadMultiple" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-03: loadGuests (3 instances)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: 3 guest iframes load, "List all guests" shows 3+ entries</p><button data-testid="btn-load-with-params" id="btnLoadWithParams" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-04: Load with searchParams</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest shows URL params in its "Params:" line</p><button data-testid="btn-load-with-metadata" id="btnLoadWithMetadata" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-META-01: Load with metadata</button><p class="text-[10px] text-gray-400 -mt-1">Expected: when guest invokes a method, callContext.callChain shows metadata</p><button data-testid="btn-load-bad-url" id="btnLoadBadUrl" class="w-full rounded bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-700">TC-LOAD-05: Load invalid URL (onError)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows "ERROR" or onError callback fires</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Scripting Object Management</h2><div class="space-y-2"><button data-testid="btn-add-so" id="btnAddSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-01: Add "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest can now <code>getObject("Inventory")</code> and invoke its methods</p><button data-testid="btn-add-guest-so" id="btnAddGuestSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-04: Add Guest-Scoped Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the target guest can access this object, others get "not available"</p><button data-testid="btn-remove-so" id="btnRemoveSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02: Remove "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest's <code>getObject("Inventory")</code> now fails</p><button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02b: Remove All Objects</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all getObject calls fail until objects are re-added</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Dispatching</h2><div class="space-y-2"><button data-testid="btn-dispatch-all" id="btnDispatchAll" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-01: Dispatch onPreSave to all</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests subscribed to onPreSave receive the event</p><button data-testid="btn-dispatch-targeted" id="btnDispatchTargeted" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-02: Dispatch to specific guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the targeted guest receives the event</p><button data-testid="btn-dispatch-feedback" id="btnDispatchFeedback" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-03: Dispatch with timeout (feedback)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Dispatch Results shows the guest's feedback return value</p><button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-04: Dispatch onAmountChanged (criteria)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only guests subscribed with matching criteria receive it</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Lifecycle</h2><div class="space-y-2"><button data-testid="btn-unload-guest" id="btnUnloadGuest" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-01: Unload first embedded guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe removed, "List all guests" count decreases</p><button data-testid="btn-register-close" id="btnRegisterClose" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-02: Register onGuestClose</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows callback registered; fires when guest calls close()</p><button data-testid="btn-list-guests" id="btnListGuests" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">List all guests</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Guest List panel shows all currently loaded guests</p><button data-testid="btn-set-loglevel" id="btnSetLogLevel" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">Set Log Level (Debug)</button> <button data-testid="btn-close-host" id="btnCloseHost" class="w-full rounded bg-red-700 px-3 py-1.5 text-xs text-white hover:bg-red-800">TC-LIFE-03: Close host</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests unloaded, host destroyed, further actions fail</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Configuration</h2><div class="space-y-2"><button data-testid="btn-sandbox-default" id="btnSandboxDefault" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-01: Default sandbox</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has standard sandbox attributes</p><button data-testid="btn-sandbox-custom" id="btnSandboxCustom" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-02: Custom sandbox values</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe sandbox attribute reflects custom permissions</p><button data-testid="btn-sandbox-disabled" id="btnSandboxDisabled" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-03: Sandbox disabled</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has no sandbox attribute (full permissions)</p></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Embedded Guests</h2><div data-testid="embed-container" id="embedContainer" class="border-2 border-dashed border-indigo-300 rounded min-h-[300px] space-y-2"></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Test Container</h2><div data-testid="sandbox-container" id="sandboxContainer" class="border-2 border-dashed border-teal-300 rounded min-h-[150px] space-y-2"></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Log</h2><div data-testid="event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[200px] max-h-[350px] overflow-y-auto font-mono"></div><button data-testid="btn-clear-log" id="btnClearLog" class="mt-1 text-xs text-gray-400 hover:text-gray-600">Clear</button></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">callContext (last invocation)</h2><div data-testid="callcontext-panel"><h3 class="text-xs text-gray-500">callContext.guest</h3><pre data-testid="callcontext-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
2
2
|
—</pre><h3 class="text-xs text-gray-500">callContext.callChain</h3><pre data-testid="callcontext-chain" id="callContextChain" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
3
3
|
—</pre></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Dispatch Results</h2><pre data-testid="dispatch-result" id="dispatchResult" class="text-xs bg-gray-100 rounded p-2 min-h-[60px] whitespace-pre-wrap">
|
|
4
4
|
—</pre></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest List</h2><pre data-testid="guest-list" id="guestList" class="text-xs bg-gray-100 rounded p-2 min-h-[60px] whitespace-pre-wrap">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfHost.c285de67388a3f6cc8f9.js"></script></head><body class="bg-gray-50"><header class="bg-gray-900 text-white px-6 py-4"><h1 class="text-xl font-bold">SSF End-to-End Test Suite</h1><p class="text-sm text-gray-400 mt-1">Comprehensive blackbox tests for SSF Host & Guest. Each page includes test steps, expected values, and a verification checklist.</p></header><main class="mx-auto max-w-5xl px-6 py-6"><section class="mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4"><h2 class="text-sm font-semibold text-yellow-800 mb-2">Setup Instructions</h2><ol class="text-xs text-yellow-700 list-decimal ml-4 space-y-1"><li>Install dependencies: <code class="bg-yellow-100 px-1 rounded">pnpm install</code></li><li>Start SSF Host dev server: <code class="bg-yellow-100 px-1 rounded">pnpm nx run ssf-host:start-server</code> (port 4000)</li><li>Start SSF Guest dev server: <code class="bg-yellow-100 px-1 rounded">pnpm nx run ssf-guest:start</code> (port 4001)</li><li>Open <code class="bg-yellow-100 px-1 rounded">http://localhost:4000/e2e-index.html</code> in the browser</li><li>Each test page has <code class="bg-yellow-100 px-1 rounded">data-testid</code> attributes for Playwright/Cypress selectors</li></ol></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">1. Core Host-Guest Communication</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./e2e-host.html" data-testid="link-e2e-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Comprehensive E2E Host</h3><p class="text-xs text-gray-500 mt-1">All host-guest scenarios: guest loading, scripting objects, events, lifecycle, metadata, sandbox, guest-scoped objects.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Guests load in iframes/popups. Scripting objects can be added/removed/invoked. Events reach subscribed guests. Unload/close cleans up properly. Sandbox attrs applied.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-LOAD-01..05 • TC-SO-01..08 • TC-EVT-01..04 • TC-LIFE-01..03 • TC-META-01 • TC-SB-01..03</div></a><a href="./index.html" data-testid="link-main-demo" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Main Demo App</h3><p class="text-xs text-gray-500 mt-1">Original Loan Application demo with embedded and popup guests, events, scripting objects.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Loan form data flows to guests. Events (onLoanAmountChanged, etc.) update guest UIs. Popup guests open and interact with the Loan object.</p></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">2. Call Chain & Metadata Propagation</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./callchain-host.html" data-testid="link-callchain" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Nested CallChain Test (A → B → C)</h3><p class="text-xs text-gray-500 mt-1">Root Host (A) → Intermediate Guest+Host (B) → Grandchild Guest (C). Verifies callContext.callChain and metadata propagation.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Click buttons in Grandchild C. Host A should show <code>callContext.guest</code> = B and <code>callChain</code> containing C and B with their metadata. Return values should flow back to C.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-CC-01..07</div></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">3. Popup Guest Behavior</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./popup-focus-host.html" data-testid="link-popup-focus" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Popup Focus & Lifecycle</h3><p class="text-xs text-gray-500 mt-1">Open, close, and refocus popup guests. Tests trusted vs untrusted domain behavior.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Trusted popups (localhost): re-open brings existing popup to front. Untrusted popups: opener is nulled, focus falls back to WindowProxy. Closed popup detection updates guest status.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-POP-01..11</div></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">4. V1 / V2 Interoperability</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./v2-host-v1-guest.html" data-testid="link-v2-host-v1-guest" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V2 Host → V1 Guest</h3><p class="text-xs text-gray-500 mt-1">V2 host loads V1 guest. Loan object, save flow, event feedback.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> V1 guest connects, gets objects, subscribes to events, and returns feedback correctly.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-INTEROP-01..04</div></a><a href="./v2-host-v1-guest.html?nestV1GuestV2Host=true" data-testid="link-v2-v1-v2-chain" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V2 Host → V1 Guest → V2 Host → V2 Guest</h3><p class="text-xs text-gray-500 mt-1">Full mixed-version chain. V1 guest acts as intermediate host for a V2 grandchild.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Scripting objects are cloned across V1/V2 boundary. Events flow through all layers.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-INTEROP-05..07</div></a></div><div class="grid grid-cols-1 md:grid-cols-2 gap-3 mt-3"><a href="./v1-host.html" data-testid="link-v1-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V1 Host → V1 Guest → V2 Host → V2 Guest</h3><p class="text-xs text-gray-500 mt-1">Starting from V1 host. Exercises the full V1-to-V2 upgrade path.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> V1 host initializes. V1 guest connects. V2 host/guest chain works through V1 intermediate.</p></a></div></section></main></body></html>
|
package/dist/public/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.c285de67388a3f6cc8f9.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center justify-between"><div class="px-2">ICE Mortgage Product</div><nav class="flex gap-3 px-2 text-xs"><a href="./e2e-index.html" data-testid="nav-e2e-suite" class="text-indigo-800 hover:text-indigo-950 underline font-bold">E2E Test Suite</a> <a href="./e2e-host.html" data-testid="nav-e2e-host" class="text-indigo-800 hover:text-indigo-950 underline">Comprehensive E2E</a> <a href="./callchain-host.html" data-testid="nav-callchain-test" class="text-indigo-800 hover:text-indigo-950 underline">CallChain</a> <a href="./popup-focus-host.html" data-testid="nav-popup-focus-test" class="text-indigo-800 hover:text-indigo-950 underline">Popup Focus</a> <a href="./v2-host-v1-guest.html" data-testid="nav-v1-interop" class="text-indigo-800 hover:text-indigo-950 underline">V1 Interop</a></nav></header><main class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"><div class="min-w-0 flex-1 mt-4"><h1 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Loan Application</h1></div><div id="successFeedback" class="hidden rounded-md bg-green-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg></div><div class="ml-3"><p class="text-sm font-medium text-green-800">Loan Saved Successfully</p></div></div></div><div id="errorFeedback" class="hidden rounded-md bg-red-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd"/></svg></div><div class="ml-3"><h3 class="text-sm font-medium text-red-800">Credit Score is not meeting the requirement</h3></div></div></div><div class="mt-2 sm:grid sm:grid-cols-2 sm:gap-2"><form class="px-2 py-2 space-y-8 divide-y divide-gray-200 bg-gray-50"><div class="space-y-8 divide-y divide-gray-200 sm:space-y-5"><div class="space-y-6 sm:space-y-5"><div><h3 class="text-lg font-medium leading-6 text-gray-900">Personal Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="firstName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">First name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="firstName" id="firstName" autocomplete="given-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="John" placeholder="John"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="lastName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Last name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="lastName" id="lastName" autocomplete="family-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="Doe" placeholder="Doe"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="ssn" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">SSN</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="ssn" id="ssn" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="123456789" placeholder="123456789"/></div></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Loan Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="amount" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Amount</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="amount" id="amount" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="500000" placeholder="500000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="Term" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Term (years)</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="term" id="term" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="30" placeholder="30"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="downPayment" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Down Payment</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="downPayment" id="downPayment" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="50000" placeholder="50000"/></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Order Services</h3></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><div class="mt-1 sm:mt-0"><button id="title" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M7.502 6h7.128A3.375 3.375 0 0118 9.375v9.375a3 3 0 003-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 00-.673-.05A3 3 0 0015 1.5h-1.5a3 3 0 00-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6zM13.5 3A1.5 1.5 0 0012 4.5h4.5A1.5 1.5 0 0015 3h-1.5z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 013 20.625V9.375zM6 12a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V12zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 15a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V15zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 18a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V18zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75z" clip-rule="evenodd"/></svg> Title</button></div><div class="mt-1 sm:mt-0"><button id="credit" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M2.25 13.5a8.25 8.25 0 018.25-8.25.75.75 0 01.75.75v6.75H18a.75.75 0 01.75.75 8.25 8.25 0 01-16.5 0z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12.75 3a.75.75 0 01.75-.75 8.25 8.25 0 018.25 8.25.75.75 0 01-.75.75h-7.5a.75.75 0 01-.75-.75V3z" clip-rule="evenodd"/></svg> Credit Score</button></div></div></div></div></div><div class="flex flex-col"><button id="saveLoan" type="button" class="rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Save</button></div></form><div id="aside-container" class="flex flex-col gap-4 items-start mt-4 border-2 p-2 rounded-lg border-dashed border-cyan-300 sm:mt-0"></div></div><div id="bottom-container" class="flex flex-col gap-4 items-start mt-4 p-2 sm:mt-0"></div></main><script src="./init.js" type="module"></script></body></html>
|