Action onPageLoad test fix (#2581)

This commit is contained in:
Hetu Nandu 2021-01-15 11:08:53 +05:30 committed by GitHub
parent 2b8bae158c
commit 11766c0e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 33 deletions

View File

@ -91,7 +91,7 @@
},
{
"isVisible": true,
"defaultText": "This is the initial <b>content</b> of the editor",
"defaultText": "",
"isDisabled": false,
"widgetName": "RichTextEditor1",
"isDefaultClickDisabled": true,

View File

@ -30,28 +30,10 @@ describe("API Panel Test Functionality", function() {
);
});
it("Will not crash the app for failure", function() {
cy.SearchEntityandOpen("PageLoadApi");
cy.get("li:contains('Settings')").click({ force: true });
cy.get("[data-cy='actionConfiguration.timeoutInMillisecond']")
.find(".bp3-input")
.type("{backspace}{backspace}{backspace}");
cy.NavigateToAPI_Panel();
cy.CreateAPI("NormalApi");
cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
cy.WaitAutoSave();
cy.reload();
cy.wait("@postExecute");
cy.RunAPI();
cy.ResponseStatusCheck("200 OK");
});
it("Shows which action failed on action fail.", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("PageLoadApi2");
cy.enterDatasourceAndPath("https://abc.com/", "users");
cy.enterDatasourceAndPath("https://abc.com", "users");
cy.WaitAutoSave();
cy.get("li:contains('Settings')").click({ force: true });
cy.get("[data-cy=executeOnLoad]")

View File

@ -739,16 +739,15 @@ function* executePageLoadAction(pageAction: PageAction) {
yield take(ReduxActionTypes.SET_EVALUATED_TREE);
}
} catch (e) {
console.error(e);
yield put(
executeActionError({
actionId: pageAction.id,
isPageLoad: true,
error: "",
show: false,
error: {
message: `The action "${pageAction.name}" has failed.`,
},
}),
);
throw new Error(`The action "${pageAction.name}" has failed.`);
}
}
@ -773,7 +772,7 @@ function* executePageLoadActionsSaga(action: ReduxAction<PageAction[][]>) {
log.error(e);
Toaster.show({
text: _.get(e, "message", "Failed to load onPageLoad actions"),
text: "Failed to load onPageLoad actions",
variant: Variant.danger,
});
}

View File

@ -6948,6 +6948,11 @@ commander@^4.0.1, commander@^4.1.1:
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
common-tags@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937"
@ -7606,10 +7611,10 @@ cypress-xpath@^1.4.0:
resolved "https://registry.yarnpkg.com/cypress-xpath/-/cypress-xpath-1.6.0.tgz#e96a8554ef2e3693ee5f282d66e88462c3e2a10c"
integrity sha512-JEe6jJo3fhi+PRwoVazLXo0n1VwWXkBCUicgJoFYHzMMX/gfb2lMn1at32cISX8/wXHaGz8aQxIP5YPiwgIMZw==
cypress@5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-5.3.0.tgz#91122219ae66ab910058970dbf36619ab0fbde6c"
integrity sha512-XgebyqL7Th6/8YenE1ddb7+d4EiCG2Jvg/5c8+HPfFFY/gXnOVhoCVUU3KW8qg3JL7g0B+iJbHd5hxuCqbd1RQ==
cypress@6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-6.2.1.tgz#27d5fbcf008c698c390fdb0c03441804176d06c4"
integrity sha512-OYkSgzA4J4Q7eMjZvNf5qWpBLR4RXrkqjL3UZ1UzGGLAskO0nFTi/RomNTG6TKvL3Zp4tw4zFY1gp5MtmkCZrA==
dependencies:
"@cypress/listr-verbose-renderer" "^0.4.1"
"@cypress/request" "^2.88.5"
@ -7623,7 +7628,7 @@ cypress@5.3.0:
chalk "^4.1.0"
check-more-types "^2.24.0"
cli-table3 "~0.6.0"
commander "^4.1.1"
commander "^5.1.0"
common-tags "^1.8.0"
debug "^4.1.1"
eventemitter2 "^6.4.2"
@ -7641,10 +7646,10 @@ cypress@5.3.0:
minimist "^1.2.5"
moment "^2.27.0"
ospath "^1.2.2"
pretty-bytes "^5.3.0"
pretty-bytes "^5.4.1"
ramda "~0.26.1"
request-progress "^3.0.0"
supports-color "^7.1.0"
supports-color "^7.2.0"
tmp "~0.2.1"
untildify "^4.0.0"
url "^0.11.0"
@ -14998,6 +15003,11 @@ pretty-bytes@^5.3.0:
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.4.1.tgz#cd89f79bbcef21e3d21eb0da68ffe93f803e884b"
integrity sha512-s1Iam6Gwz3JI5Hweaz4GoCD1WUNUIyzePFy5+Js2hjwGVt2Z79wNN+ZKOZ2vB6C+Xs6njyB84Z1IthQg8d9LxA==
pretty-bytes@^5.4.1:
version "5.5.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.5.0.tgz#0cecda50a74a941589498011cf23275aa82b339e"
integrity sha512-p+T744ZyjjiaFlMUZZv6YPC5JrkNj8maRmPaQCWFJFplUAzpIUTRaTcS+7wmZtUoFXHtESJb23ISliaWyz3SHA==
pretty-error@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
@ -17994,7 +18004,7 @@ supports-color@^6.1.0:
dependencies:
has-flag "^3.0.0"
supports-color@^7.0.0, supports-color@^7.1.0:
supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==