From 5f1e4d1ba8fca10e959a856eac730e2fccca798c Mon Sep 17 00:00:00 2001
From: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com>
Date: Mon, 10 Apr 2023 17:41:14 +0530
Subject: [PATCH] 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
---
.github/workflows/integration-tests-command.yml | 13 ++++++++++++-
.../ClientSideTests/Linting/BasicLint_spec.ts | 1 +
.../Datasources/Firestore_Basic_Spec.ts | 14 +++++++++++---
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/integration-tests-command.yml b/.github/workflows/integration-tests-command.yml
index 492e0876f5..06ea450fca 100644
--- a/.github/workflows/integration-tests-command.yml
+++ b/.github/workflows/integration-tests-command.yml
@@ -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}}
- Identified Flaky tests
+ Identified Flaky tests
+
+ - 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
diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
index 3b72bbbba9..7f207e5d70 100644
--- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
+++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
@@ -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)
diff --git a/app/client/cypress/integration/Regression_TestSuite/ServerSideTests/Datasources/Firestore_Basic_Spec.ts b/app/client/cypress/integration/Regression_TestSuite/ServerSideTests/Datasources/Firestore_Basic_Spec.ts
index 5e44734652..3163d64073 100644
--- a/app/client/cypress/integration/Regression_TestSuite/ServerSideTests/Datasources/Firestore_Basic_Spec.ts
+++ b/app/client/cypress/integration/Regression_TestSuite/ServerSideTests/Datasources/Firestore_Basic_Spec.ts
@@ -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,