ToolJet/cypress-tests/cypress/support/utils/workspaceConstants.js
Anantshree Chandola 000b40c7c9
Masking workspace constants on frontend (#9596)
* masking workspace constants on frontend

* remove comment

* update

* added logic to verify constants keys used in codehinter

* Add check for value type

* update workspace constant permissions

* Fix exitsing issues related to validation on code hinter

* do not send encrypted value to fe

* small updates

* Add data-cy for workspace constants components

* Modify workspace constants cypress test cases

* fix value alignment

---------

Co-authored-by: ajith-k-v <[email protected]>
2024-05-14 15:49:12 +05:30

23 lines
997 B
JavaScript

import { commonSelectors } from "Selectors/common";
import { fake } from "Fixtures/fake";
import { workspaceConstantsSelectors } from "Selectors/workspaceConstants";
import { workspaceConstantsText } from "Texts/workspaceConstants";
import { commonText } from "Texts/common";
import * as common from "Support/utils/common";
export const contantsNameValidation = (value, error) => {
cy.clearAndType(commonSelectors.nameInputField, value);
cy.get(commonSelectors.nameErrorText).verifyVisibleElement(
"have.text",
error
);
cy.get(workspaceConstantsSelectors.addConstantButton).should("be.disabled");
};
export const AddNewconstants = (name, value) => {
cy.get(workspaceConstantsSelectors.addNewConstantButton).click();
cy.clearAndType(commonSelectors.nameInputField, name);
cy.get(commonSelectors.valueInputField).click();
cy.clearAndType(commonSelectors.valueInputField, value);
cy.get(workspaceConstantsSelectors.addConstantButton).click();
};