From 27ec4cd4b6b9bd7f8831d97d12cdfeae79df7ff1 Mon Sep 17 00:00:00 2001 From: Ankit Srivastava <67647761+ankitsrivas14@users.noreply.github.com> Date: Wed, 31 May 2023 13:45:18 +0530 Subject: [PATCH 1/3] feat: dummy intercom key for CI workflow (#23885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added dummy intercom key in env for CI runs. This will enable intercom option in the UI only for CI and thus cypress test cases can be written around it. #### PR fixes following issue(s) Fixes # (issue number) > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#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.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 0dfa42d749b..8866dbd69eb 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -153,6 +153,7 @@ jobs: docker run -d --name appsmith -p 80:80 -p 9001:9001 \ -v "$PWD/stacks:/appsmith-stacks" \ -e APPSMITH_DISABLE_TELEMETRY=true \ + -e APPSMITH_INTERCOM_APP_ID=DUMMY_VALUE \ -e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \ --add-host=host.docker.internal:host-gateway --add-host=api.segment.io:host-gateway --add-host=t.appsmith.com:host-gateway \ cicontainer From 90f9bd63184ee01765286c87fc4f249e3db1abfc Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Fri, 2 Jun 2023 13:02:54 +0530 Subject: [PATCH 2/3] fix: fork application spec & reconnect modal fix (#23959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes the failing flaky cypress test for ForkModal that was triggering reconnect modal. The spec was calling skip to application but the link created was wrong which created this flakiness. The reconnect modal also has a fix for listing datasources with all the values which are not present in the unconfigured datasources list. #### PR fixes following issue(s) Fixes # (issue number) > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#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 --- .../OtherUIFeatures/ForkApplication_spec.js | 5 +-- .../gitSync/ReconnectDatasourceModal.tsx | 35 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ForkApplication_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ForkApplication_spec.js index f747be84770..33a8022c7a9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ForkApplication_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ForkApplication_spec.js @@ -62,7 +62,9 @@ describe("Fork application across workspaces", function () { ); cy.wait("@importNewApplication").then((interception) => { const { isPartialImport } = interception.response.body.data; + cy.log("isPartialImport : ", isPartialImport); if (isPartialImport) { + cy.wait(2000); cy.get(reconnectDatasourceModal.SkipToAppBtn).click({ force: true, }); @@ -85,8 +87,7 @@ describe("Fork application across workspaces", function () { cy.url().then((url) => { forkableAppUrl = url; - cy.get(homePage.profileMenu).click(); - cy.get(homePage.signOutIcon).click(); + cy.LogOut(); cy.visit(forkableAppUrl); //cy.reload(); diff --git a/app/client/src/pages/Editor/gitSync/ReconnectDatasourceModal.tsx b/app/client/src/pages/Editor/gitSync/ReconnectDatasourceModal.tsx index 1064a3e76a7..49379a3f6f6 100644 --- a/app/client/src/pages/Editor/gitSync/ReconnectDatasourceModal.tsx +++ b/app/client/src/pages/Editor/gitSync/ReconnectDatasourceModal.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from "react"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import { getImportedApplication, @@ -252,10 +252,12 @@ function ReconnectDatasourceModal() { const unconfiguredDatasourceIds = unconfiguredDatasources.map( (ds: Datasource) => ds.id, ); - let datasources = useSelector(getDatasources); - datasources = datasources.filter((ds: Datasource) => - unconfiguredDatasourceIds.includes(ds.id), - ); + const datasourcesList = useSelector(getDatasources); + const datasources = useMemo(() => { + return datasourcesList.filter((ds: Datasource) => + unconfiguredDatasourceIds.includes(ds.id), + ); + }, [datasourcesList, unconfiguredDatasourceIds]); const pluginsArray = useSelector(getDatasourcePlugins); const plugins = keyBy(pluginsArray, "id"); const isLoading = useSelector(getIsListing); @@ -490,15 +492,20 @@ function ReconnectDatasourceModal() { .find((ds: Datasource) => !ds.isConfigured); } next = next || pending[0]; - setSelectedDatasourceId(next.id); - setDatasource(next); - // when refresh, it should be opened. - const appInfo = { - appId: appId, - pageId: pageId, - datasourceId: next.id, - }; - localStorage.setItem("importedAppPendingInfo", JSON.stringify(appInfo)); + if (next && next.id) { + setSelectedDatasourceId(next.id); + setDatasource(next); + // when refresh, it should be opened. + const appInfo = { + appId: appId, + pageId: pageId, + datasourceId: next.id, + }; + localStorage.setItem( + "importedAppPendingInfo", + JSON.stringify(appInfo), + ); + } } else if (appURL) { // open application import successfule localStorage.setItem("importApplicationSuccess", "true"); From a5bd34c9d8aec429438d321543416280cbd9e2e6 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Thu, 1 Jun 2023 19:53:35 +0530 Subject: [PATCH 3/3] task: update Airtable Cypress test as per the new sentence case (#23946) ## Description - As per the new ADS design changes, the labels and helper texts for SaaS plugins have been updated to follow the sentence case model from the current title case model. e.g `Auth Type` to `Auth type` . Hence, the Airtable test needs to be updated accordingly. Fixes #23832 --- .../Sanity/Datasources/Airtable_Basic_Spec.ts | 34 +++++++++---------- .../cypress/support/Pages/DataSources.ts | 6 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts index 8bdc4932d99..d1145351853 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts @@ -18,7 +18,7 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.dataSources.ValidateNSelectDropdown( "Commands", "Please select an option", - "List Records", + "List records", ); _.agHelper.EnterValue(datasourceFormData.AirtableBase, { @@ -29,7 +29,7 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.agHelper.EnterValue(datasourceFormData.AirtableTable, { propFieldName: "", directInput: false, - inputFieldName: "Table Name", + inputFieldName: "Table name", }); _.dataSources.RunQuery(); @@ -70,12 +70,12 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.agHelper.EnterValue("11", { propFieldName: "", directInput: false, - inputFieldName: "Max Records", + inputFieldName: "Max records", }); _.agHelper.EnterValue("", { propFieldName: "", directInput: false, - inputFieldName: "Page Size", + inputFieldName: "Page size", }); _.dataSources.RunQuery(); cy.get("@postExecute").then((resObj: any) => { @@ -87,7 +87,7 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.agHelper.EnterValue("6", { propFieldName: "", directInput: false, - inputFieldName: "Page Size", + inputFieldName: "Page size", }); _.dataSources.RunQuery(); cy.get("@postExecute").then((resObj: any) => { @@ -119,7 +119,7 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.agHelper.EnterValue('NOT({Taxa} = "Rodent")', { propFieldName: "", directInput: false, - inputFieldName: "Filter by Formula", + inputFieldName: "Filter by formula", }); _.dataSources.RunQuery(); @@ -137,17 +137,17 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { _.agHelper.EnterValue("", { propFieldName: "", directInput: false, - inputFieldName: "Page Size", + inputFieldName: "Page size", }); //Removing Page Size _.agHelper.EnterValue("", { propFieldName: "", directInput: false, - inputFieldName: "Filter by Formula", + inputFieldName: "Filter by formula", }); //Removing Filter by Formula _.agHelper.EnterValue("10", { propFieldName: "", directInput: false, - inputFieldName: "Max Records", + inputFieldName: "Max records", }); _.agHelper.EnterValue("sort%5B0%5D%5Bfield%5D=Species_ID", { propFieldName: "", @@ -256,8 +256,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { //Create _.dataSources.ValidateNSelectDropdown( "Commands", - "List Records", - "Create Records", + "List records", + "Create records", ); _.agHelper.EnterValue(createReq, { propFieldName: "", @@ -277,8 +277,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { insertedRecordId = jsonSpecies.records[0].id; _.dataSources.ValidateNSelectDropdown( "Commands", - "Create Records", - "Retrieve A Record", + "Create records", + "Retrieve a record", ); _.agHelper.EnterValue(insertedRecordId, { propFieldName: "", @@ -304,8 +304,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { //Update Records _.dataSources.ValidateNSelectDropdown( "Commands", - "Retrieve A Record", - "Update Records", + "Retrieve a record", + "Update records", ); _.agHelper.EnterValue( `[{ "id" : ${insertedRecordId}, @@ -341,8 +341,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { //insertedRecordId = jsonSpecies.id; _.dataSources.ValidateNSelectDropdown( "Commands", - "Update Records", - "Delete A Record", + "Update records", + "Delete a record", ); _.dataSources.RunQuery(); diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 06d78dec1c4..259d92e5265 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -494,12 +494,12 @@ export class DataSources { public FillAirtableDSForm() { this.ValidateNSelectDropdown( - "Authentication Type", + "Authentication type", "Please select an option", - "Bearer Token", + "Bearer token", ); this.agHelper.UpdateInput( - this.locator._inputFieldByName("Bearer Token"), + this.locator._inputFieldByName("Bearer token"), Cypress.env("AIRTABLE_BEARER"), ); this.agHelper.Sleep();