PromucFlow_constructor/app/client/cypress/locators/ApiEditor.js
Sagar Khalasi 7f556268c3
fix: Fix test case for api (#36083)
## Description
RCA: Toggle button from log tab is not open always. Due to this next
element was not visible.
Fix: Have gone through the test case and found unnecessary steps for
verifying successful log. Update the only required code and fixed the
test case.

Fixes #`36082`  

## Automation

/ok-to-test tags="@tag.Datasource"

### 🔍 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/10714184973>
> Commit: bd850ca5d80f39c544b6953c85cddc43a3e723d0
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10714184973&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Datasource`
> Spec:
> <hr>Thu, 05 Sep 2024 05:42:15 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

## Summary by CodeRabbit

- **New Features**
- Enhanced API testing capabilities with updated test cases for various
HTTP methods.
	- Introduced new properties for improved API debugging in the UI.
	- Added a method to check the visibility of specific elements in tests.

- **Bug Fixes**
- Improved the `validateRequest` command to handle multiple API log
entries more effectively.

- **Chores**
- Updated the test specifications to focus on server-side API tests,
replacing outdated client-side entries.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-06 10:31:32 +05:30

39 lines
1.6 KiB
JavaScript

export default {
curlImportBtn: ".t--importBtn",
createBlankApiCard: ".t--createBlankApiCard",
eachProviderCard: ".t--eachProviderCard",
nameOfApi: ".t--nameOfApi",
ApiNameField: ".t--action-name-edit-field",
addToPageBtn: ".t--addToPageBtn",
ApiActionMenu: "[data-testid=\"more-action-trigger\"]",
ApiDeleteBtn: ".t--apiFormDeleteBtn",
ApiRunBtn: ".t--apiFormRunBtn",
addToPageBtnsId: ".t--addToPageButtons",
ApiHomePage: ".t--apiHomePage",
formActionButtons: ".t--formActionButtons",
dataSourceField: ".t--dataSourceField",
responseBody: ".CodeMirror-code span.cm-string.cm-property",
ApiVerb: ".t--apiFormHttpMethod div",
apiPaginationNextText: ".t--apiFormPaginationNext",
apiPaginationPrevText: ".t--apiFormPaginationPrev",
apiPaginationPrevTest: ".t--apiFormPaginationPrevTest",
apiPaginationNextTest: ".t--apiFormPaginationNextTest",
apiPaginationTab:
".t--apiFormPaginationType label:contains('Paginate with response URL') input",
apiTab: ".react-tabs__tab-list li",
bodyType: ".t--apiFormPostBodyType",
bodyTypeSelected: "[data-testid=\"t--api-body-tab-switch\"] .rc-select-selection-item",
bodyTab: "Body",
headersTab: "Header",
jsonResponseTab: "[data-value='JSON']",
tableResponseTab: "[data-value='TABLE']",
rawResponseTab: "[data-value='RAW']",
httpDropDownOptions: ".rc-select-item",
codeEditorWrapper: ".t--code-editor-wrapper",
apiSearchHint: ".datasource-hint",
slashCommandButton: ".commands-button",
apiResponseObject: ".object-key",
apiDebuggerLink: ".debugger-entity-link",
apiResponseTabsList : ".ads-v2-tabs__list"
};