chore: fetch spec with removed third party (#36636)
## Description Updated third party URLs. Fixes #`36437` ## Automation /ok-to-test tags="@tag.JS" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11157028440> > Commit: 3a3ab548300e8e8a7338b93491dab0ce36c33fda > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11157028440&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.JS` > Spec: > <hr>Thu, 03 Oct 2024 07:04:14 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced fetch functionality with improved error handling and updated button interactions. - Introduced delay mechanism for fetch calls to ensure functionality after a timeout. - **Bug Fixes** - Updated button label and fetch endpoint to correctly retrieve and display user names. - **Documentation** - Updated test specifications to focus on server-side JavaScript function execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
177636d43a
commit
a01edffbc3
|
|
@ -1,5 +1,7 @@
|
|||
import {
|
||||
agHelper,
|
||||
apiPage,
|
||||
dataManager,
|
||||
entityExplorer,
|
||||
jsEditor,
|
||||
propPane,
|
||||
|
|
@ -76,18 +78,25 @@ describe("Tests fetch calls", { tags: ["@tag.JS"] }, () => {
|
|||
});
|
||||
|
||||
it("3. Tests if fetch works with store value", function () {
|
||||
apiPage.CreateAndFillApi(
|
||||
dataManager.dsValues[dataManager.defaultEnviorment].mockGenderAge +
|
||||
`{{this.params.person}}`,
|
||||
"Gender_Age",
|
||||
);
|
||||
apiPage.RunAPI();
|
||||
entityExplorer.DragDropWidgetNVerify("buttonwidget", 500, 200);
|
||||
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
|
||||
propPane.TypeTextIntoField("Label", "getUserID");
|
||||
propPane.TypeTextIntoField("Label", "getUserName");
|
||||
propPane.EnterJSContext(
|
||||
"onClick",
|
||||
`{{fetch('https://jsonplaceholder.typicode.com/todos/1')
|
||||
.then(res => res.json())
|
||||
.then(json => storeValue('userId', json.userId))
|
||||
.then(() => showAlert("UserId: " + appsmith.store.userId))}}`,
|
||||
`{{(async function(){
|
||||
const gender = await Gender_Age.run({ person: "sagar" });
|
||||
storeValue("Gender", gender);
|
||||
showAlert("Your name is " + appsmith.store.Gender.name);
|
||||
})()}}`,
|
||||
);
|
||||
agHelper.Sleep(2000);
|
||||
agHelper.ClickButton("getUserID");
|
||||
agHelper.AssertContains("UserId: 1", "exist");
|
||||
|
||||
agHelper.ClickButton("getUserName");
|
||||
agHelper.AssertContains("Your name is sagar", "exist");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user