2026-03-12 16:13:51 +00:00
|
|
|
|
2023-09-04 04:05:12 +00:00
|
|
|
export const verifyElemtsNoGds = (option) => {
|
|
|
|
|
cy.get('[data-cy="label-select-datasource"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
2023-09-26 05:28:02 +00:00
|
|
|
"Connect to a Data Source"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="querymanager-description"]').verifyVisibleElement(
|
|
|
|
|
"contain.text",
|
2023-09-26 05:28:02 +00:00
|
|
|
"Select a Data Source to start creating a new query. To know more about queries in ToolJet, you can read our"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="querymanager-doc-link"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"documentation"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="landing-page-label-default"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"Default"
|
|
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="restapi-add-query-card"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
2023-09-20 10:02:50 +00:00
|
|
|
" REST API"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="runjs-add-query-card"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
2023-09-20 10:02:50 +00:00
|
|
|
" JavaScript"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="runpy-add-query-card"]').verifyVisibleElement(
|
2023-09-20 10:02:50 +00:00
|
|
|
"contain.text",
|
|
|
|
|
" Python"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="tooljetdb-add-query-card"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
2023-09-20 10:02:50 +00:00
|
|
|
" ToolJet DB"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="label-avilable-ds"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
2023-09-20 10:02:50 +00:00
|
|
|
"Available data sources 0"
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="landing-page-add-new-ds-button"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"Add new"
|
|
|
|
|
);
|
2023-09-20 10:02:50 +00:00
|
|
|
cy.get('[data-cy="label-no-ds-added"]').verifyVisibleElement(
|
2023-09-04 04:05:12 +00:00
|
|
|
"have.text",
|
2023-09-20 10:02:50 +00:00
|
|
|
"No global data sources have been added yet."
|
2023-09-04 04:05:12 +00:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-26 05:28:02 +00:00
|
|
|
export const verifyElemtsWithGds = (option) => { };
|
2026-03-12 16:13:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
const validateLabel = (fieldName) => {
|
|
|
|
|
cy.get(dsCommonSelector.labelFieldName(fieldName)).verifyVisibleElement("have.text", fieldName);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const verifyConnectionFormUI = (fields) => {
|
|
|
|
|
fields.forEach((field) => {
|
|
|
|
|
switch (field.type) {
|
|
|
|
|
case 'input':
|
|
|
|
|
verifyInputFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'encrypted':
|
|
|
|
|
case 'password':
|
|
|
|
|
verifyEncryptedFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'dropdown':
|
|
|
|
|
verifyDropdownFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'toggle':
|
|
|
|
|
verifyToggleFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'radio':
|
|
|
|
|
verifyRadioButtonFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'keyValue':
|
|
|
|
|
verifyKeyValueFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'checkbox':
|
|
|
|
|
verifyCheckboxFieldUI(field);
|
|
|
|
|
break;
|
|
|
|
|
case 'codeMirror':
|
|
|
|
|
fillDataOnCodeMirrorInput(field);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new Error(`Unsupported field type: ${field.type}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|