Skip to content

Commit

Permalink
chore: fetch spec with removed third party (#36636)
Browse files Browse the repository at this point in the history
## 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: 3a3ab54
> <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 -->
  • Loading branch information
sagar-qa007 authored Oct 3, 2024
1 parent 177636d commit a01edff
Showing 1 changed file with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {
agHelper,
apiPage,
dataManager,
entityExplorer,
jsEditor,
propPane,
Expand Down Expand Up @@ -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");
});
});

0 comments on commit a01edff

Please sign in to comment.