From 5312ee11f3a4cb02f61e46d779822473d5588a75 Mon Sep 17 00:00:00 2001 From: Saroj <43822041+sarojsarab@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:37:02 +0530 Subject: [PATCH] test: Fix gsheet tests (#27146) ## Description - Fix gsheet tests - Fix workflows to not upload the result file in case of success #### Type of change - spec file changes - Workflow file changes ## Testing > #### How Has This Been Tested? - [x] Cypress ## Checklist: #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --- .github/workflows/ci-test-custom-script.yml | 4 ++-- .github/workflows/ci-test-hosted.yml | 6 +++--- .github/workflows/ci-test-limited.yml | 4 ++-- app/client/cypress/e2e/GSheet/AllAccess_Spec.ts | 2 +- app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts | 2 +- app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts | 2 +- app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-test-custom-script.yml b/.github/workflows/ci-test-custom-script.yml index 78537268dd..7fde0c71ae 100644 --- a/.github/workflows/ci-test-custom-script.yml +++ b/.github/workflows/ci-test-custom-script.yml @@ -475,13 +475,13 @@ jobs: path: ~/dockerlogs - name: Rename reports - if: always() + if: failure() && env.failed_spec_env != '' run: | mkdir -p ~/results mv ${{ github.workspace }}/app/client/results ~/results/${{ matrix.job }} - name: Upload cypress report - if: always() + if: failure() && env.failed_spec_env != '' uses: actions/upload-artifact@v3 with: name: results-${{github.run_attempt}} diff --git a/.github/workflows/ci-test-hosted.yml b/.github/workflows/ci-test-hosted.yml index b147f7b999..c992b963eb 100644 --- a/.github/workflows/ci-test-hosted.yml +++ b/.github/workflows/ci-test-hosted.yml @@ -122,7 +122,7 @@ jobs: fi done fi - done < ~/failed_spec_ci/failed_spec_ci-${{ matrix.job }} + done < ~/failed_spec_ci/failed_spec_ci failed_spec_env=${failed_spec_env#,} echo "failed_spec_env=$failed_spec_env" >> $GITHUB_ENV @@ -395,13 +395,13 @@ jobs: env: "NODE_ENV=development" - name: Rename reports - if: always() + if: failure() && env.failed_spec_env != '' run: | mkdir -p ~/results mv ${{ github.workspace }}/app/client/results ~/results/${{ matrix.job }} - name: Upload cypress report - if: always() + if: failure() && env.failed_spec_env != '' uses: actions/upload-artifact@v3 with: name: results-${{github.run_attempt}} diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index 2be864f7e7..9cf58b3e0d 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -527,13 +527,13 @@ jobs: path: ~/dockerlogs - name: Rename reports - if: always() + if: failure() && env.failed_spec_env != '' run: | mkdir -p ~/results mv ${{ github.workspace }}/app/client/results ~/results/${{ matrix.job }} - name: Upload cypress report - if: always() + if: failure() && env.failed_spec_env != '' uses: actions/upload-artifact@v3 with: name: results-${{github.run_attempt}} diff --git a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts index 43449f0db5..c8f98e60b0 100644 --- a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts @@ -185,7 +185,7 @@ describe("GSheet-Functional Tests With All Access", function () { inputFieldName: "Cell range", }); dataSources.RunQuery(); - dataSources.RunQueryNVerifyResponseViews(8); + dataSources.RunQueryNVerifyResponseViews(4); dataSources.AssertQueryTableResponse(0, "eac7efa5dbd3d667f26eb3d3ab504464"); }); diff --git a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts index 1db69b8feb..11e4c9073c 100644 --- a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts @@ -182,7 +182,7 @@ describe("GSheet-Functional Tests With Read/Write Access", function () { inputFieldName: "Cell range", }); dataSources.RunQuery(); - dataSources.RunQueryNVerifyResponseViews(8); + dataSources.RunQueryNVerifyResponseViews(4); dataSources.AssertQueryTableResponse(0, "eac7efa5dbd3d667f26eb3d3ab504464"); }); diff --git a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts index 0c936470a2..1561282ae9 100644 --- a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts @@ -190,7 +190,7 @@ describe("GSheet-Functional Tests With Read Access", function () { inputFieldName: "Cell range", }); dataSources.RunQuery(); - dataSources.RunQueryNVerifyResponseViews(8); + dataSources.RunQueryNVerifyResponseViews(4); dataSources.AssertQueryTableResponse(0, "eac7efa5dbd3d667f26eb3d3ab504464"); }); diff --git a/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts b/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts index 6bbc774f63..4415ae80f0 100644 --- a/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts @@ -173,7 +173,7 @@ describe("GSheet-Functional Tests With Selected Access", function () { inputFieldName: "Cell range", }); dataSources.RunQuery(); - dataSources.RunQueryNVerifyResponseViews(8); + dataSources.RunQueryNVerifyResponseViews(4); dataSources.AssertQueryTableResponse(0, "eac7efa5dbd3d667f26eb3d3ab504464"); });