Skip to content
5 changes: 3 additions & 2 deletions cypress-action/cypress/e2e/e2e/loadDesign.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ const snapshotPath = (designId, theme) => {
const captureSnapshot = ({ window, designId, theme }) => {
console.log("Taking snapshot", designId, theme);
//removeWidgets();
cy.window().then((win) => {
const cytoscape = win.cyto;

// Wait for cytoscape instance to be available and then fit/center
cy.window().its('cyto').should('exist').then((cytoscape) => {
cytoscape.fit();
cytoscape.center();
});
Expand Down