21597: Use req.on('reply' instead of req.reply to workaround cypress bug 21597-cypress-reply-fix
authorStephen Smith <stephen@curii.com>
Fri, 15 Mar 2024 17:15:08 +0000 (13:15 -0400)
committerStephen Smith <stephen@curii.com>
Fri, 15 Mar 2024 17:15:08 +0000 (13:15 -0400)
https://github.com/cypress-io/cypress/issues/26248#issuecomment-1623005400

Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

services/workbench2/cypress/e2e/banner-tooltip.cy.js
services/workbench2/cypress/e2e/process.cy.js
services/workbench2/cypress/e2e/search.cy.js

index 1a93d83f3138057954ed79c650e8e24ac1a69d2c..0a0ac75164991c3d542e607ac536b75065be12f4 100644 (file)
@@ -60,7 +60,7 @@ describe('Banner / tooltip tests', function () {
                 .should('contain', 'tooltips.json');
 
             cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
-                req.reply((res) => {
+                req.on('response', (res) => {
                     res.body.Workbench.BannerUUID = collectionUUID;
                 });
             });
@@ -97,4 +97,4 @@ describe('Banner / tooltip tests', function () {
             expect(el._tippy).to.be.undefined;
         });
     });
-});
\ No newline at end of file
+});
index ca13e9f9e0b380313e849b5ee9560aa9526554ba..2a5a62927fd981f09132d1a9c5eb6a1db9205c2f 100644 (file)
@@ -148,7 +148,7 @@ describe("Process tests", function () {
 
             // Fake submitted by another user
             cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
-                req.reply(res => {
+                req.on('response', res => {
                     res.body.modified_by_user_uuid = "zzzzz-tpzed-000000000000000";
                 });
             });
@@ -219,7 +219,7 @@ describe("Process tests", function () {
             // Force container_count for testing
             let containerCount = 2;
             cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
-                req.reply(res => {
+                req.on('response', res => {
                     res.body.container_count = containerCount;
                 });
             });
@@ -349,7 +349,7 @@ describe("Process tests", function () {
             ) {
                 // Fake container uuid
                 cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
-                    req.reply(res => {
+                    req.on('response', res => {
                         res.body.output_uuid = fakeCrUuid;
                         res.body.priority = 500;
                         res.body.state = "Committed";
@@ -381,7 +381,7 @@ describe("Process tests", function () {
             ) {
                 // Fake container uuid
                 cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
-                    req.reply(res => {
+                    req.on('response', res => {
                         res.body.output_uuid = fakeCrLockedUuid;
                         res.body.priority = 500;
                         res.body.state = "Committed";
@@ -413,7 +413,7 @@ describe("Process tests", function () {
             ) {
                 // Fake container uuid
                 cy.intercept({ method: "GET", url: `**/arvados/v1/container_requests/${containerRequest.uuid}` }, req => {
-                    req.reply(res => {
+                    req.on('response', res => {
                         res.body.output_uuid = fakeCrOnHoldUuid;
                         res.body.priority = 0;
                         res.body.state = "Committed";
@@ -443,7 +443,7 @@ describe("Process tests", function () {
     describe("Logs panel", function () {
         it("shows live process logs", function () {
             cy.intercept({ method: "GET", url: "**/arvados/v1/containers/*" }, req => {
-                req.reply(res => {
+                req.on('response', res => {
                     res.body.state = ContainerState.RUNNING;
                 });
             });
@@ -1349,7 +1349,7 @@ describe("Process tests", function () {
             cy.getAll("@testOutputCollection").then(([testOutputCollection]) => {
                 // Add output uuid and inputs to container request
                 cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
-                    req.reply(res => {
+                    req.on('response', res => {
                         res.body.output_uuid = testOutputCollection.uuid;
                         res.body.mounts["/var/lib/cwl/cwl.input.json"] = {
                             content: testInputs.map(param => param.input).reduce((acc, val) => Object.assign(acc, val), {}),
@@ -1480,7 +1480,7 @@ describe("Process tests", function () {
 
             // Add output uuid and inputs to container request
             cy.intercept({ method: "GET", url: "**/arvados/v1/container_requests/*" }, req => {
-                req.reply(res => {
+                req.on('response', res => {
                     res.body.output_uuid = fakeOutputUUID;
                     res.body.mounts["/var/lib/cwl/cwl.input.json"] = {
                         content: {},
index 1bf2b5c3efb4b83a8bdd8324f751ffb67d7b53c5..ba9077ac2065a78c9a37ecf2a0ed73007112fde9 100644 (file)
@@ -169,7 +169,7 @@ describe("Search tests", function () {
 
         // Intercept config to insert remote cluster
         cy.intercept({ method: "GET", hostname: "127.0.0.1", url: "**/arvados/v1/config?nocache=*" }, req => {
-            req.reply(res => {
+            req.on('response', res => {
                 res.body.RemoteClusters = {
                     "*": res.body.RemoteClusters["*"],
                     xxxxx: {
@@ -249,7 +249,7 @@ describe("Search tests", function () {
 
             // Intercept search results to add federated result
             cy.intercept({ method: "GET", url: "**/arvados/v1/groups/contents?*" }, req => {
-                req.reply(res => {
+                req.on('response', res => {
                     res.body.items = [
                         res.body.items[0],
                         {