mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-06 22:04:16 +00:00
fix(cypress) Fix occasional socket closed exception in cypress (#13312)
This commit is contained in:
parent
050d003169
commit
fb4c505800
@ -10,7 +10,8 @@ describe("search", () => {
|
|||||||
const setBrowseFeatureFlag = (isOn) => {
|
const setBrowseFeatureFlag = (isOn) => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
// Modify the response body directly
|
// Modify the response body directly
|
||||||
res.body.data.appConfig.featureFlags.showBrowseV2 = isOn;
|
res.body.data.appConfig.featureFlags.showBrowseV2 = isOn;
|
||||||
// search and browse both need to be on for browse to show
|
// search and browse both need to be on for browse to show
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("attribute list adding tags and terms", () => {
|
|||||||
const setBusinessAttributeFeatureFlag = () => {
|
const setBusinessAttributeFeatureFlag = () => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
businessAttributeEntityEnabled =
|
businessAttributeEntityEnabled =
|
||||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("businessAttribute", () => {
|
|||||||
const setBusinessAttributeFeatureFlag = () => {
|
const setBusinessAttributeFeatureFlag = () => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
businessAttributeEntityEnabled =
|
businessAttributeEntityEnabled =
|
||||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("home", () => {
|
|||||||
const setBusinessAttributeFeatureFlag = () => {
|
const setBusinessAttributeFeatureFlag = () => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
businessAttributeEntityEnabled =
|
businessAttributeEntityEnabled =
|
||||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -14,7 +14,8 @@ describe("add remove domain", () => {
|
|||||||
const setDomainsFeatureFlag = (isOn) => {
|
const setDomainsFeatureFlag = (isOn) => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
res.body.data.appConfig.featureFlags.nestedDomainsEnabled = isOn;
|
res.body.data.appConfig.featureFlags.nestedDomainsEnabled = isOn;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("mutations", () => {
|
|||||||
const setBusinessAttributeFeatureFlag = () => {
|
const setBusinessAttributeFeatureFlag = () => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
businessAttributeEntityEnabled =
|
businessAttributeEntityEnabled =
|
||||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -10,7 +10,8 @@ describe("search", () => {
|
|||||||
const setSearchFiltersFeatureFlag = (isOn) => {
|
const setSearchFiltersFeatureFlag = (isOn) => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
// Modify the response body directly
|
// Modify the response body directly
|
||||||
res.body.data.appConfig.featureFlags.showSearchFiltersV2 = isOn;
|
res.body.data.appConfig.featureFlags.showSearchFiltersV2 = isOn;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("manage access tokens", () => {
|
|||||||
const setTokenAuthEnabledFlag = (isOn) => {
|
const setTokenAuthEnabledFlag = (isOn) => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
res.body.data.appConfig.authConfig.tokenAuthEnabled = isOn;
|
res.body.data.appConfig.authConfig.tokenAuthEnabled = isOn;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,8 @@ describe("manage access tokens", () => {
|
|||||||
const setTokenAuthEnabledFlag = (isOn) => {
|
const setTokenAuthEnabledFlag = (isOn) => {
|
||||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||||
if (hasOperationName(req, "appConfig")) {
|
if (hasOperationName(req, "appConfig")) {
|
||||||
req.reply((res) => {
|
req.alias = "gqlappConfigQuery";
|
||||||
|
req.on("response", (res) => {
|
||||||
res.body.data.appConfig.authConfig.tokenAuthEnabled = isOn;
|
res.body.data.appConfig.authConfig.tokenAuthEnabled = isOn;
|
||||||
res.body.data.appConfig.featureFlags.themeV2Enabled = true;
|
res.body.data.appConfig.featureFlags.themeV2Enabled = true;
|
||||||
res.body.data.appConfig.featureFlags.themeV2Default = true;
|
res.body.data.appConfig.featureFlags.themeV2Default = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user