test: Cypress - flaky fix + Git comment improve (#22169)

## Description

- This fixes the Firestore spec that fails sometimes in CI due to all
runs accessing the same cloud collection for validation.
- This PR also adds comments to PR - if all cypress cases passed, right
now there is no comment

## Type of change

- Script update

## How Has This Been Tested?

- Cypress CI runs


## Checklist:
### QA activity:
- [X] Added Test Plan Approved label after reviewing all Cypress test
This commit is contained in:
Aishwarya-U-R 2023-04-10 17:41:14 +05:30 committed by GitHub
parent bf3cb2e804
commit 5f1e4d1ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 4 deletions

View File

@ -168,7 +168,18 @@ jobs:
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Commit: `${{ github.event.client_payload.slash_command.args.named.sha }}`.
The following are new failures, please fix them before merging the PR: ${{env.new_failed_spec_env}}
<a href="#" onclick='window.open("https://app.appsmith.com/applications/613868bedd7786286ddd4a6a/pages/63ec710e8e503f763651791a");return false;'>Identified Flaky tests</a>
<a href="https://app.appsmith.com/applications/613868bedd7786286ddd4a6a/pages/63ec710e8e503f763651791a" target="_blank">Identified Flaky tests</a>
- name: Add a comment on the PR when ci-test is success
if: needs.ci-test.result == 'success'
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.client_payload.pull_request.number }}
body: |
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Commit: `${{ github.event.client_payload.slash_command.args.named.sha }}`.
All cypress tests have passed 🎉
# Update check run called "ci-test-result"
- name: Mark ci-test-result job as complete

View File

@ -35,6 +35,7 @@ const clickButtonAndAssertLintError = (
//Reload and Check for presence/ absence of lint error
agHelper.RefreshPage();
agHelper.AssertElementVisible(locator._visibleTextDiv("Explorer"));
ee.SelectEntityByName("Button1", "Widgets");
shouldExist
? agHelper.AssertElementExist(locator._lintErrorElement)

View File

@ -1,6 +1,6 @@
import * as _ from "../../../../support/Objects/ObjectsCore";
let dsName: any, cities: any, losAngelesPath: any, insertedRecordId: any;
let dsName: any, cities: any, losAngelesPath: any;
describe("Validate Firestore DS", () => {
before("Create a new Firestore DS", () => {
_.dataSources.CreateDataSource("Firestore");
@ -28,6 +28,14 @@ describe("Validate Firestore DS", () => {
directInput: false,
inputFieldName: "Collection Name",
});
_.agHelper.TypeDynamicInputValueNValidate(
"name",
_.dataSources._nestedWhereClauseKey(0),
);
_.agHelper.TypeDynamicInputValueNValidate(
"San Francisco",
_.dataSources._nestedWhereClauseValue(0),
);
_.dataSources.RunQuery();
cy.get("@postExecute").then((resObj: any) => {
cities = JSON.parse(JSON.stringify(resObj.response.body.data.body));
@ -35,9 +43,10 @@ describe("Validate Firestore DS", () => {
cy.wrap(cities)
.should("be.an", "array")
.its(0)
.should("have.property", "name", "San Francisco"); //making sure inserted record is returned
.should("have.property", "name", "San Francisco"); //making sure already inserted record is returned
});
_.agHelper.GetNClick(_.dataSources._whereDelete(0)); //removign where clause, add new
_.agHelper.TypeDynamicInputValueNValidate(
"capital",
_.dataSources._nestedWhereClauseKey(0),
@ -201,7 +210,6 @@ describe("Validate Firestore DS", () => {
directInput: false,
inputFieldName: "Collection Name",
});
_.agHelper.EnterValue('["population"]', {
propFieldName: "",
directInput: false,