From b24d25482baa757398210aa384d40f63a8bc6d23 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Fri, 13 Sep 2024 12:43:50 -0400 Subject: [PATCH 1/7] Debug C8085776. --- test/functional/specs/Migration/C8085776.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/functional/specs/Migration/C8085776.js b/test/functional/specs/Migration/C8085776.js index 723a8265d..04077ffa1 100644 --- a/test/functional/specs/Migration/C8085776.js +++ b/test/functional/specs/Migration/C8085776.js @@ -56,12 +56,27 @@ test( "C8085776: At.js 2.x to Web SDK - Assert same session ID, edge cluster are used " + "for both of the requests interact and delivery API", async () => { + // Wait for a short period to allow for asynchronous requests + await t.wait(2000); + + const requestCount = await networkLogger.targetDeliveryEndpointLogs.count( + () => true, + ); + console.log(`Number of Target delivery requests: ${requestCount}`); + await t - .expect(networkLogger.targetDeliveryEndpointLogs.count(() => true)) - .eql(1); + .expect(requestCount) + .gte(1, "Expected at least one Target delivery request"); + // Get delivery API request const deliveryRequest = networkLogger.targetDeliveryEndpointLogs.requests[0]; + + if (!deliveryRequest) { + console.log("No Target delivery request found"); + await t.expect(false).ok("No Target delivery request was logged"); + } + await responseStatus(networkLogger.targetDeliveryEndpointLogs, [200, 207]); const { searchParams } = new URL(deliveryRequest.request.url); // Extract the session ID from the request query params From e8486e31ee948ef69e934852d6fb354a78c855f2 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Fri, 13 Sep 2024 12:54:44 -0400 Subject: [PATCH 2/7] Remove edge browser. --- .sauce/dev.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.sauce/dev.yml b/.sauce/dev.yml index a2fe3ef8c..9e363dcd6 100644 --- a/.sauce/dev.yml +++ b/.sauce/dev.yml @@ -26,19 +26,6 @@ npm: - "@adobe/reactor-cookie" - "@adobe/reactor-query-string" suites: - - name: "Edge" - browserName: "microsoftedge" - headless: true - browserVersion: "119" - src: - - "test/functional/specs/**/*.js" - platformName: "Windows 11" - excludedTestFiles: - [ - "test/functional/specs/Personalization/C782718.js", - "test/functional/specs/Privacy/C5594870.js", - "test/functional/specs/Personalization/C8631577.js", - ] - name: "Safari" browserName: "safari" headless: true From a0aadca5583670a32597c98e517e7ee1a736929a Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Fri, 13 Sep 2024 13:05:34 -0400 Subject: [PATCH 3/7] Remove edge and add additional time before assertion. --- test/functional/specs/Migration/C8085776.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/functional/specs/Migration/C8085776.js b/test/functional/specs/Migration/C8085776.js index 04077ffa1..b007ce24c 100644 --- a/test/functional/specs/Migration/C8085776.js +++ b/test/functional/specs/Migration/C8085776.js @@ -56,14 +56,18 @@ test( "C8085776: At.js 2.x to Web SDK - Assert same session ID, edge cluster are used " + "for both of the requests interact and delivery API", async () => { - // Wait for a short period to allow for asynchronous requests - await t.wait(2000); + // Increase wait time + await t.wait(5000); const requestCount = await networkLogger.targetDeliveryEndpointLogs.count( () => true, ); console.log(`Number of Target delivery requests: ${requestCount}`); + // Log the contents of the requests for debugging + const requests = networkLogger.targetDeliveryEndpointLogs.requests; + console.log("Target delivery requests:", JSON.stringify(requests, null, 2)); + await t .expect(requestCount) .gte(1, "Expected at least one Target delivery request"); From 3923878a9f6795705962e1a439bf39b94c1b24f0 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Wed, 18 Sep 2024 15:18:12 -0400 Subject: [PATCH 4/7] Debug unit test dev workflow. --- karma.saucelabs.conf.cjs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/karma.saucelabs.conf.cjs b/karma.saucelabs.conf.cjs index 205d13a2c..89f093940 100644 --- a/karma.saucelabs.conf.cjs +++ b/karma.saucelabs.conf.cjs @@ -19,29 +19,29 @@ module.exports = (config) => { base: "SauceLabs", browserName: "chrome", browserVersion: "latest", - platform: "Windows 11", + platformName: "Windows 11", + "sauce:options": { + headless: true, + }, }, sl_safariW3C: { base: "SauceLabs", browserName: "safari", browserVersion: "latest", - platform: "macOS 13", + platformName: "macOS 13", + "sauce:options": { + headless: true, + }, }, sl_firefoxW3C: { base: "SauceLabs", browserName: "firefox", - platformName: "Windows 11", browserVersion: "latest", + platformName: "Windows 11", "sauce:options": { - geckodriverVersion: "0.34.0", + headless: true, }, }, - sl_edgeW3C: { - base: "SauceLabs", - browserName: "microsoftedge", - browserVersion: "latest", - platform: "Windows 11", - }, }; config.set({ From 0388402af044dd4b5e9f7bce8ffc2335a953ea5e Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Thu, 19 Sep 2024 10:52:03 -0400 Subject: [PATCH 5/7] Debug unit test runner. --- .github/workflows/dev.yaml | 1 + karma.saucelabs.conf.cjs | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 09e86ed2b..af03becbf 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -9,6 +9,7 @@ env: SAUCE_CAPABILITIES_OVERRIDES_PATH: "sauceLabsCapabilities.json" EDGE_BASE_PATH: ee-pre-prd ALLOY_ENV: int + SAUCE_TUNNEL_ID: github-action-tunnel jobs: linting: diff --git a/karma.saucelabs.conf.cjs b/karma.saucelabs.conf.cjs index 89f093940..4929ebcaf 100644 --- a/karma.saucelabs.conf.cjs +++ b/karma.saucelabs.conf.cjs @@ -21,6 +21,7 @@ module.exports = (config) => { browserVersion: "latest", platformName: "Windows 11", "sauce:options": { + tunnelIdentifier: process.env.SAUCE_TUNNEL_ID, headless: true, }, }, @@ -30,6 +31,7 @@ module.exports = (config) => { browserVersion: "latest", platformName: "macOS 13", "sauce:options": { + tunnelIdentifier: process.env.SAUCE_TUNNEL_ID, headless: true, }, }, @@ -39,6 +41,7 @@ module.exports = (config) => { browserVersion: "latest", platformName: "Windows 11", "sauce:options": { + tunnelIdentifier: process.env.SAUCE_TUNNEL_ID, headless: true, }, }, @@ -50,9 +53,12 @@ module.exports = (config) => { concurrency: 10, colors: true, sauceLabs: { - screenResolution: "800x600", + testName: "Alloy Unit Tests", build: `GH #${process.env.BUILD_NUMBER} (${process.env.BUILD_ID})`, - tunnelIdentifier: process.env.JOB_NUMBER, + tunnelIdentifier: process.env.SAUCE_TUNNEL_ID, + screenResolution: "1280x1024", + recordVideo: false, + recordScreenshots: false, }, plugins: [ "karma-jasmine", From 389e22e338db1b9708f17bc3d8d0ce36d111e94d Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Thu, 19 Sep 2024 10:56:33 -0400 Subject: [PATCH 6/7] Increase timeout for functional tests. --- .sauce/dev.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.sauce/dev.yml b/.sauce/dev.yml index 9e363dcd6..946ad5ff5 100644 --- a/.sauce/dev.yml +++ b/.sauce/dev.yml @@ -14,7 +14,7 @@ testcafe: version: 3.6.0 nodeVersion: "22" speed: 1 -pageLoadTimeout: 3000 +pageLoadTimeout: 5000 disablePageCaching: true timeZone: New_York npm: @@ -28,7 +28,6 @@ npm: suites: - name: "Safari" browserName: "safari" - headless: true browserVersion: "latest" src: - "test/functional/specs/**/*.js" From 7549fb43b1fb6eeca1dc16c4babd3548e5fb4a11 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Thu, 19 Sep 2024 11:10:21 -0400 Subject: [PATCH 7/7] Remove debug logs from C8085776. --- test/functional/specs/Migration/C8085776.js | 23 ++------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/test/functional/specs/Migration/C8085776.js b/test/functional/specs/Migration/C8085776.js index b007ce24c..723a8265d 100644 --- a/test/functional/specs/Migration/C8085776.js +++ b/test/functional/specs/Migration/C8085776.js @@ -56,31 +56,12 @@ test( "C8085776: At.js 2.x to Web SDK - Assert same session ID, edge cluster are used " + "for both of the requests interact and delivery API", async () => { - // Increase wait time - await t.wait(5000); - - const requestCount = await networkLogger.targetDeliveryEndpointLogs.count( - () => true, - ); - console.log(`Number of Target delivery requests: ${requestCount}`); - - // Log the contents of the requests for debugging - const requests = networkLogger.targetDeliveryEndpointLogs.requests; - console.log("Target delivery requests:", JSON.stringify(requests, null, 2)); - await t - .expect(requestCount) - .gte(1, "Expected at least one Target delivery request"); - + .expect(networkLogger.targetDeliveryEndpointLogs.count(() => true)) + .eql(1); // Get delivery API request const deliveryRequest = networkLogger.targetDeliveryEndpointLogs.requests[0]; - - if (!deliveryRequest) { - console.log("No Target delivery request found"); - await t.expect(false).ok("No Target delivery request was logged"); - } - await responseStatus(networkLogger.targetDeliveryEndpointLogs, [200, 207]); const { searchParams } = new URL(deliveryRequest.request.url); // Extract the session ID from the request query params