chore: Add cypress.env.json to gitIgnore (#21413)

## Description

Adding Cypress.env.json to gitIgnore 

## Type of change

- Chore 

## How Has This Been Tested?


### 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
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
This commit is contained in:
Rishabh Rathod 2023-03-16 10:14:32 +05:30 committed by GitHub
parent fcc4e54dd8
commit 4c31ec35b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 39 additions and 23 deletions

1
.gitignore vendored
View File

@ -2,7 +2,6 @@
*.iml
.env
app/client/cypress.env.json
stacks
# to ignore the node_modeules folder

View File

@ -32,7 +32,7 @@ yarn-error.log*
.storybook-out/
cypress/videos
cypress/screenshots
/cypress.env.json
cypress.env.json
results/

View File

@ -1,5 +0,0 @@
{
"MySQL": 1,
"Mongo": 1,
"Edition": 0
}

View File

@ -0,0 +1,8 @@
export const REPO = {
CE: "CE",
EE: "EE",
};
// CURRENT_REPO value is set as "CE" in appsmith repo and "EE" in appsmith-ee repo.
// appsmith-ee has a commit ahead of CE to persist the change.
// This file should not be modified to avoid the conflict when ce code merged to ee.
export const CURRENT_REPO = REPO.CE;

View File

@ -0,0 +1,5 @@
// Make the INTERCEPT value as true locally, if there is a need to intercept the DB.
export const INTERCEPT = {
MYSQL: false,
MONGO: false,
};

View File

@ -1,3 +1,5 @@
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
const Access = {
AdminSettingsEntryLink: ".admin-settings-menu-option",
LeftPaneAuditLogsLink:
@ -27,7 +29,7 @@ const locators = { ...Access, ...UpgradePage };
describe("Audit logs", () => {
it("1. Super user can access audit logs page", () => {
if (Cypress.env("Edition") === 0) {
if (CURRENT_REPO === REPO.CE) {
cy.LogOut();
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.visit("/applications");

View File

@ -1,4 +1,5 @@
const commonlocators = require("../../../../locators/commonlocators.json");
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
const locators = {
AdminSettingsEntryLink: ".admin-settings-menu-option",
@ -90,7 +91,7 @@ describe("Branding", () => {
});
it("3. Check if localStorage is populated with tenantConfig values & form cannot be submitted", () => {
if (Cypress.env("Edition") === 0) {
if (CURRENT_REPO === REPO.CE) {
const tenantConfig = localStorage.getItem("tenantConfig");
expect(tenantConfig).to.be.null;
cy.get(locators.submitButton).should("be.disabled");

View File

@ -1,5 +1,6 @@
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import * as _ from "../../../../../support/Objects/ObjectsCore";
import { REPO, CURRENT_REPO } from "../../../../../fixtures/REPO";
let repoName1, repoName2, repoName3, repoName4, windowOpenSpy;
describe("Repo Limit Exceeded Error Modal", function() {
@ -46,7 +47,7 @@ describe("Repo Limit Exceeded Error Modal", function() {
// cy.createAppAndConnectGit(repoName3, false);
// cy.createAppAndConnectGit(repoName4, false, true);
if (Cypress.env("Edition") === 0) {
if (CURRENT_REPO === REPO.CE) {
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("exist");
// title and info text checking

View File

@ -1,5 +1,6 @@
const EnterpriseAdminSettingsLocators = require("../../../../locators/EnterpriseAdminSettingsLocators.json");
import adminsSettings from "../../../../locators/AdminsSettings";
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
describe("Admin settings page", function() {
beforeEach(() => {
@ -23,7 +24,7 @@ describe("Admin settings page", function() {
cy.visit("/settings/general");
cy.get(adminsSettings.authenticationTab).click();
cy.url().should("contain", "/settings/authentication");
if (Cypress.env("Edition") === 0) {
if (CURRENT_REPO === REPO.CE) {
cy.get(EnterpriseAdminSettingsLocators.upgradeOidcButton)
.should("be.visible")
.should("contain", "UPGRADE");

View File

@ -1,3 +1,4 @@
import { INTERCEPT } from "../../../../fixtures/variables";
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let dsName: any;
@ -16,7 +17,7 @@ describe("Validate Mongo CRUD with JSON Form", () => {
});
beforeEach(function() {
if (Cypress.env("Mongo") === 0) {
if (INTERCEPT.MONGO) {
cy.log("Mongo DB is not found. Using intercept");
dataSources.StartInterceptRoutesForMongo();
} else cy.log("Mongo DB is found, hence using actual DB");

View File

@ -1,5 +1,5 @@
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
// import { INTERCEPT } from "../../../../fixtures/variables";
let dsName: any;
let agHelper = ObjectsRegistry.AggregateHelper,
@ -13,7 +13,7 @@ let agHelper = ObjectsRegistry.AggregateHelper,
describe("Validate MySQL Generate CRUD with JSON Form", () => {
// beforeEach(function() {
// if (Cypress.env("MySQL") === 0) {
// if (INTERCEPT.MYSQL) {
// cy.log("MySQL DB is not found. Using intercept");
// //dataSources.StartInterceptRoutesForMySQL();
// } else cy.log("MySQL DB is found, hence using actual DB");

View File

@ -1,5 +1,5 @@
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
// import { INTERCEPT } from "../../../../fixtures/variables";
let dsName: any, newStoreSecret: any;
let agHelper = ObjectsRegistry.AggregateHelper,
@ -12,7 +12,7 @@ let agHelper = ObjectsRegistry.AggregateHelper,
describe("Validate MySQL Generate CRUD with JSON Form", () => {
// beforeEach(function() {
// if (Cypress.env("MySQL") === 0) {
// if (INTERCEPT.MYSQL) {
// cy.log("MySQL DB is not found. Using intercept");
// //dataSources.StartInterceptRoutesForMySQL();
// } else cy.log("MySQL DB is found, hence using actual DB");

View File

@ -1,3 +1,4 @@
import { INTERCEPT } from "../../../../fixtures/variables";
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let dsName: any;
@ -17,7 +18,7 @@ describe("Validate Mongo Query Pane Validations", () => {
});
beforeEach(function() {
if (Cypress.env("Mongo") === 0) {
if (INTERCEPT.MONGO) {
cy.log("Mongo DB is not found. Using intercept");
dataSources.StartInterceptRoutesForMongo();
} else cy.log("Mongo DB is found, hence using actual DB");

View File

@ -1,6 +1,7 @@
/* eslint-disable no-console */
const testdata = require("../../../fixtures/testdata.json");
import { ObjectsRegistry } from "../../../support/Objects/Registry";
import { CURRENT_REPO, REPO } from "../../../fixtures/REPO";
let agHelper = ObjectsRegistry.AggregateHelper;
const tedUrl = "http://localhost:5001/v1/parent/cmd";
@ -33,7 +34,7 @@ describe("Upgrade appsmith version", () => {
});
//verify the Applications after upgrade only on CE and skip for BE
if (Cypress.env("Edition") === 0) {
if (CURRENT_REPO === REPO.CE) {
cy.forceVisit(testdata.APPURL);
agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true);
agHelper.Sleep(1000);

View File

@ -1,4 +1,5 @@
import { ObjectsRegistry } from "../Objects/Registry";
import { REPO, CURRENT_REPO } from "../../fixtures/REPO";
export class HomePage {
private agHelper = ObjectsRegistry.AggregateHelper;
private locator = ObjectsRegistry.CommonLocators;
@ -25,7 +26,7 @@ export class HomePage {
workspaceName +
") button:contains('Share')";
private _email =
Cypress.env("Edition") === 0
CURRENT_REPO === REPO.CE
? "//input[@type='email' and contains(@class,'bp3-input-ghost')]"
: "//input[@type='text' and contains(@class,'bp3-input-ghost')]";
_visibleTextSpan = (spanText: string) => "//span[text()='" + spanText + "']";
@ -173,7 +174,7 @@ export class HomePage {
text: string,
) {
const errorMessage =
Cypress.env("Edition") === 0
CURRENT_REPO === REPO.CE
? "Invalid email address(es) found"
: "Invalid email address(es) or group(s) found";
this.StubPostHeaderReq();