mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
* Initial Utils and spec * Add automation for set and unset variable * Add validations for globals, and rename * Modify config file * Add all the fixes * Revert config
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import { postgreSqlSelector } from "Selectors/postgreSql";
|
|
|
|
export const selectQuery = (dbName) => {
|
|
cy.get(postgreSqlSelector.buttonAddNewQueries).click();
|
|
cy.get(
|
|
`[data-cy="${dbName.toLowerCase().replace(/\s+/g, "-")}-add-query-card"]`
|
|
)
|
|
.should("contain", dbName)
|
|
.click();
|
|
};
|
|
|
|
export const deleteQuery = (queryName) => {
|
|
cy.get(`[data-cy="list-query-${queryName}"]`).realHover();
|
|
cy.get(`[data-cy="elete-query-${queryName}"]`).click();
|
|
};
|
|
|
|
export const query = (action) => {
|
|
cy.get(`[data-cy="query-${action}-button"]`).click();
|
|
};
|
|
|
|
export const changeQueryToggles = (option) => {
|
|
cy.get(`[data-cy="${option}-toggle-switch"]`).parent().click();
|
|
};
|
|
|
|
export const renameQueryFromEditor = (name) => {
|
|
cy.get('[data-cy="query-name-label"]').realHover();
|
|
cy.get('[class="breadcrum-rename-query-icon false"]').click();
|
|
cy.get('[data-cy="query-rename-input"]').clear().type(`${name}{enter}`);
|
|
// cy.realType(`{selectAll}{backspace}${name}{enter}`);
|
|
};
|
|
|
|
export const addInputOnQueryField = (field, data) => {
|
|
cy.get(`[data-cy="${field}-input-field"]`).clearAndTypeOnCodeMirror(
|
|
`{backSpace}`
|
|
);
|
|
cy.get(`[data-cy="${field}-input-field"]`).clearAndTypeOnCodeMirror(data);
|
|
};
|