mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-01 11:19:05 +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) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
// Modify the response body directly
|
||||
res.body.data.appConfig.featureFlags.showBrowseV2 = isOn;
|
||||
// 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 = () => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
businessAttributeEntityEnabled =
|
||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||
return res;
|
||||
|
||||
@ -12,7 +12,8 @@ describe("businessAttribute", () => {
|
||||
const setBusinessAttributeFeatureFlag = () => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
businessAttributeEntityEnabled =
|
||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||
return res;
|
||||
|
||||
@ -12,7 +12,8 @@ describe("home", () => {
|
||||
const setBusinessAttributeFeatureFlag = () => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
businessAttributeEntityEnabled =
|
||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||
return res;
|
||||
|
||||
@ -14,7 +14,8 @@ describe("add remove domain", () => {
|
||||
const setDomainsFeatureFlag = (isOn) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
res.body.data.appConfig.featureFlags.nestedDomainsEnabled = isOn;
|
||||
});
|
||||
}
|
||||
|
||||
@ -12,7 +12,8 @@ describe("mutations", () => {
|
||||
const setBusinessAttributeFeatureFlag = () => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
businessAttributeEntityEnabled =
|
||||
res.body.data.appConfig.featureFlags.businessAttributeEntityEnabled;
|
||||
return res;
|
||||
|
||||
@ -10,7 +10,8 @@ describe("search", () => {
|
||||
const setSearchFiltersFeatureFlag = (isOn) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
// Modify the response body directly
|
||||
res.body.data.appConfig.featureFlags.showSearchFiltersV2 = isOn;
|
||||
});
|
||||
|
||||
@ -12,7 +12,8 @@ describe("manage access tokens", () => {
|
||||
const setTokenAuthEnabledFlag = (isOn) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
req.alias = "gqlappConfigQuery";
|
||||
req.on("response", (res) => {
|
||||
res.body.data.appConfig.authConfig.tokenAuthEnabled = isOn;
|
||||
});
|
||||
}
|
||||
|
||||
@ -12,7 +12,8 @@ describe("manage access tokens", () => {
|
||||
const setTokenAuthEnabledFlag = (isOn) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
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.featureFlags.themeV2Enabled = true;
|
||||
res.body.data.appConfig.featureFlags.themeV2Default = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user