From 5e8c93cf716610a395f8107b632effae1c1bcacd Mon Sep 17 00:00:00 2001 From: baljesingh Date: Thu, 5 Dec 2024 15:22:49 -0800 Subject: [PATCH 1/3] Update nestedAppAuth.json to include E2E tests --- .../e2e-test-data/nestedAppAuth.json | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json index f306ee32e2..0bc76e5311 100644 --- a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json +++ b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json @@ -2,6 +2,7 @@ "name": "nestedAppAuth", "platforms": "*", "version": ">=2.22.0", + "cypressTopWindowReplacement": true, "testCases": [ { "title": "nestedAppAuth isNAAChannelRecommended API Call - Success", @@ -28,6 +29,64 @@ "ios": ">=6.0.0" }, "expectedTestAppValue": "NAA deeply nested auth is supported" + }, + { + "title": "nestedAppAuth - Send NAA message to NAA bridge from parent window", + "type": "callResponse", + "boxSelector": "#box_sendMessageToNestedAppAuthBridge", + "inputValue": { + "messageType": "NestedAppAuthRequest", + "method": "GetToken", + "sendTime": 1732269811006, + "clientLibrary": "MetaOS", + "clientLibraryVersion": "1.0.0", + "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", + "tokenParams": { "correlationId": "39dc85fe-9054-11ed-a1eb-0242ac120002" } + }, + "expectedAlertValue": "nestedAppAuth.execute called with payload: ##JSON_INPUT_VALUE##, origin: https://localhost:4000/, isTrustedOrigin: true", + "expectedTestAppValue": { + "messageType": "NestedAppAuthResponse", + "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", + "success": true, + "initContext": { + "sdkName": "OfficeAuth", + "sdkVersion": "16.0.18015.15000", + "capabilities": { "queryAccount": false }, + "accountContext": { + "homeAccountId": "bb5r835b-0e7b", + "environment": "login.windows.net", + "tenantId": "2855cd1be" + } + } + } + }, + { + "title": "nestedAppAuth - Send NAA message to top window from parent window", + "type": "callResponse", + "boxSelector": "#box_sendMessageToTopWindow", + "platformsExcluded": ["iOS"], + "inputValue": { + "id": "2", + "func": "nestedAppAuth.execute", + "args": [], + "data": "{\"messageType\":\"NestedAppAuthRequest\",\"method\":\"GetToken\",\"sendTime\":1732269811006,\"clientLibrary\":\"MetaOS\",\"clientLibraryVersion\":\"1.0.0\",\"requestId\":\"684352c2-7ab7-4def-b7e1-56a386c02a0a\",\"tokenParams\":{\"correlationId\":\"39dc85fe-9054-11ed-a1eb-0242ac120002\"}}" + }, + "expectedAlertValue": "nestedAppAuth.execute called with payload: {\"messageType\":\"NestedAppAuthRequest\",\"method\":\"GetToken\",\"sendTime\":1732269811006,\"clientLibrary\":\"MetaOS\",\"clientLibraryVersion\":\"1.0.0\",\"requestId\":\"684352c2-7ab7-4def-b7e1-56a386c02a0a\",\"tokenParams\":{\"correlationId\":\"39dc85fe-9054-11ed-a1eb-0242ac120002\"}}, origin: https://localhost:4000/, isTrustedOrigin: true", + "expectedTestAppValue": { + "messageType": "NestdedAppAuthResponse", + "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", + "success": true, + "initContext": { + "sdkName": "OfficeAuth", + "sdkVersion": "16.0.18015.15000", + "capabilities": { "queryAccount": false }, + "accountContext": { + "homeAccountId": "bb5r835b-0e7b", + "environment": "login.windows.net", + "tenantId": "2855cd1be" + } + } + } } ] } From 35c650821c3c4a720d928e12ef1697dce85d5841 Mon Sep 17 00:00:00 2001 From: baljesingh Date: Fri, 6 Dec 2024 05:59:44 -0800 Subject: [PATCH 2/3] Update nestedAppAuth.json --- .../e2e-test-data/nestedAppAuth.json | 49 ++----------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json index 0bc76e5311..908d364e79 100644 --- a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json +++ b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json @@ -32,6 +32,7 @@ }, { "title": "nestedAppAuth - Send NAA message to NAA bridge from parent window", + "title": "nestedAppAuth - send message to NAA bridge from parent window", "type": "callResponse", "boxSelector": "#box_sendMessageToNestedAppAuthBridge", "inputValue": { @@ -40,53 +41,11 @@ "sendTime": 1732269811006, "clientLibrary": "MetaOS", "clientLibraryVersion": "1.0.0", - "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", - "tokenParams": { "correlationId": "39dc85fe-9054-11ed-a1eb-0242ac120002" } + "requestId": "684352c2-7ab7-4def-b7e1-XXXXXXXXXXX", + "tokenParams": { "correlationId": "39dc85fe-9054-11ed-a1eb-XXXXXXXXXXX" } }, "expectedAlertValue": "nestedAppAuth.execute called with payload: ##JSON_INPUT_VALUE##, origin: https://localhost:4000/, isTrustedOrigin: true", - "expectedTestAppValue": { - "messageType": "NestedAppAuthResponse", - "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", - "success": true, - "initContext": { - "sdkName": "OfficeAuth", - "sdkVersion": "16.0.18015.15000", - "capabilities": { "queryAccount": false }, - "accountContext": { - "homeAccountId": "bb5r835b-0e7b", - "environment": "login.windows.net", - "tenantId": "2855cd1be" - } - } - } - }, - { - "title": "nestedAppAuth - Send NAA message to top window from parent window", - "type": "callResponse", - "boxSelector": "#box_sendMessageToTopWindow", - "platformsExcluded": ["iOS"], - "inputValue": { - "id": "2", - "func": "nestedAppAuth.execute", - "args": [], - "data": "{\"messageType\":\"NestedAppAuthRequest\",\"method\":\"GetToken\",\"sendTime\":1732269811006,\"clientLibrary\":\"MetaOS\",\"clientLibraryVersion\":\"1.0.0\",\"requestId\":\"684352c2-7ab7-4def-b7e1-56a386c02a0a\",\"tokenParams\":{\"correlationId\":\"39dc85fe-9054-11ed-a1eb-0242ac120002\"}}" - }, - "expectedAlertValue": "nestedAppAuth.execute called with payload: {\"messageType\":\"NestedAppAuthRequest\",\"method\":\"GetToken\",\"sendTime\":1732269811006,\"clientLibrary\":\"MetaOS\",\"clientLibraryVersion\":\"1.0.0\",\"requestId\":\"684352c2-7ab7-4def-b7e1-56a386c02a0a\",\"tokenParams\":{\"correlationId\":\"39dc85fe-9054-11ed-a1eb-0242ac120002\"}}, origin: https://localhost:4000/, isTrustedOrigin: true", - "expectedTestAppValue": { - "messageType": "NestdedAppAuthResponse", - "requestId": "684352c2-7ab7-4def-b7e1-56a386c02a0a", - "success": true, - "initContext": { - "sdkName": "OfficeAuth", - "sdkVersion": "16.0.18015.15000", - "capabilities": { "queryAccount": false }, - "accountContext": { - "homeAccountId": "bb5r835b-0e7b", - "environment": "login.windows.net", - "tenantId": "2855cd1be" - } - } - } + "expectedTestAppValue": "\"{\\\"messageType\\\":\\\"NestedAppAuthResponse\\\",\\\"requestId\\\":\\\"684352c2-7ab7-4def-b7e1-XXXXXXXXXXX\\\",\\\"success\\\":true,\\\"initContext\\\":{\\\"sdkName\\\":\\\"OfficeAuth\\\",\\\"sdkVersion\\\":\\\"16.0.18015.15000\\\",\\\"capabilities\\\":{\\\"queryAccount\\\":false},\\\"accountContext\\\":{\\\"homeAccountId\\\":\\\"bb5r835b-XXXX\\\",\\\"environment\\\":\\\"login.windows.net\\\",\\\"tenantId\\\":\\\"2855cd1be\\\"}}}\"" } ] } From c1180da3d1276dbd685f5607eba6a9ac5cd6ea63 Mon Sep 17 00:00:00 2001 From: baljesingh Date: Tue, 8 Apr 2025 11:35:57 -0700 Subject: [PATCH 3/3] Update nestedAppAuth.json --- apps/teams-test-app/e2e-test-data/nestedAppAuth.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json index 908d364e79..69974c7ce1 100644 --- a/apps/teams-test-app/e2e-test-data/nestedAppAuth.json +++ b/apps/teams-test-app/e2e-test-data/nestedAppAuth.json @@ -31,7 +31,6 @@ "expectedTestAppValue": "NAA deeply nested auth is supported" }, { - "title": "nestedAppAuth - Send NAA message to NAA bridge from parent window", "title": "nestedAppAuth - send message to NAA bridge from parent window", "type": "callResponse", "boxSelector": "#box_sendMessageToNestedAppAuthBridge",