mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 10:16:47 +00:00
Merge branch 'develop' into feat/kanban-view
This commit is contained in:
@@ -30,32 +30,32 @@ import { isXcdb, isPostgres } from "./page_objects/projectConstants";
|
||||
require("@4tw/cypress-drag-drop");
|
||||
|
||||
// recursively gets an element, returning only after it's determined to be attached to the DOM for good
|
||||
Cypress.Commands.add('getSettled', (selector, opts = {}) => {
|
||||
Cypress.Commands.add("getSettled", (selector, opts = {}) => {
|
||||
const retries = opts.retries || 3;
|
||||
const delay = opts.delay || 400;
|
||||
|
||||
const isAttached = (resolve, count = 0) => {
|
||||
const el = Cypress.$(selector);
|
||||
const el = Cypress.$(selector);
|
||||
|
||||
// is element attached to the DOM?
|
||||
count = Cypress.dom.isAttached(el) ? count + 1 : 0;
|
||||
// is element attached to the DOM?
|
||||
count = Cypress.dom.isAttached(el) ? count + 1 : 0;
|
||||
|
||||
// hit our base case, return the element
|
||||
if (count >= retries) {
|
||||
return resolve(el);
|
||||
}
|
||||
// hit our base case, return the element
|
||||
if (count >= retries) {
|
||||
return resolve(el);
|
||||
}
|
||||
|
||||
// retry after a bit of a delay
|
||||
setTimeout(() => isAttached(resolve, count), delay);
|
||||
// retry after a bit of a delay
|
||||
setTimeout(() => isAttached(resolve, count), delay);
|
||||
};
|
||||
|
||||
// wrap, so we can chain cypress commands off the result
|
||||
return cy.wrap(null).then(() => {
|
||||
return new Cypress.Promise((resolve) => {
|
||||
return isAttached(resolve, 0);
|
||||
}).then((el) => {
|
||||
return cy.wrap(el);
|
||||
});
|
||||
return new Cypress.Promise((resolve) => {
|
||||
return isAttached(resolve, 0);
|
||||
}).then((el) => {
|
||||
return cy.wrap(el);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -179,7 +179,7 @@ Cypress.Commands.add("openTableTab", (tn, rc) => {
|
||||
// for some tables, linked records are not available immediately
|
||||
cy.wait(1000);
|
||||
|
||||
cy.get(".xc-row-table.nc-grid").should("exist");
|
||||
cy.get(".xc-row-table.nc-grid", { timeout: 30000 }).should("exist");
|
||||
|
||||
// wait for page rendering to complete
|
||||
if (rc != 0) {
|
||||
@@ -199,7 +199,7 @@ Cypress.Commands.add("closeTableTab", (tn) => {
|
||||
.click();
|
||||
|
||||
// subsequent tab open commands will fail if tab is not closed completely
|
||||
cy.wait(100);
|
||||
cy.wait(2000)
|
||||
});
|
||||
|
||||
Cypress.Commands.add("openOrCreateGqlProject", (_args) => {
|
||||
@@ -280,6 +280,10 @@ Cypress.Commands.add("getActiveModal", (wrapperSelector) => {
|
||||
return cy.get(".ant-modal-content:visible").last();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("closeActiveModal", (wrapperSelector) => {
|
||||
cy.getActiveModal(wrapperSelector).find(".ant-modal-close-x").click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("getActiveMenu", (overlaySelector) => {
|
||||
if (overlaySelector) {
|
||||
return cy.getSettled(`${overlaySelector} .ant-dropdown-content:visible`);
|
||||
|
||||
Reference in New Issue
Block a user