Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions designer/client/cypress/e2e/process.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,26 +376,25 @@ describe("Process", () => {
cy.get("[data-testid=window]")
.contains(/^Test case/i)
.should("be.visible");
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]")
.should("contain.text", "Test case")
.then(($win) => {
const width = $win.width();
const height = $win.height();

// maximize (one way)
cy.wrap($win)
.contains(/^source$/i)
.dblclick();
// restore (second way)
cy.wait(500);
cy.wrap($win).get("button[name=zoom]").click();

cy.wrap($win).should(($current) => {
expect($current.width()).to.equal(width);
expect($current.height()).to.equal(height);
});
cy.get("[data-testid=window]").then(($win) => {
const width = $win.width();
const height = $win.height();

// maximize (one way)
cy.wrap($win)
.contains(/^source$/i)
.click()
.click();
// restore (second way)
cy.wait(500);
cy.wrap($win).get("button[name=zoom]").realClick();

cy.wrap($win).should(($current) => {
expect($current.width()).to.equal(width);
expect($current.height()).to.equal(height);
});
});
cy.get("[data-testid=window]").matchImage();
});

it("should open more scenario details", () => {
Expand Down
4 changes: 2 additions & 2 deletions designer/client/cypress/e2e/testsWithInputDataRecords.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const verifyTableData = (row: number, col: number, htmlData: unknown) => {
describe("test with events data", () => {
const seed = "testsWithEventsData";

beforeEach(() => {
before(() => {
cy.deleteAllTestProcesses({ filter: seed, force: true });
});

afterEach(() => {
after(() => {
cy.deleteAllTestProcesses({ filter: seed });
});

Expand Down
24 changes: 12 additions & 12 deletions designer/client/cypress/support/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ declare global {
}

const addTestRecord = (callback?: () => void) => {
cy.get('[data-testid="data-grid-canvas"]')
.should("exist")
.then(($canvas) => {
const rect = $canvas[0].getBoundingClientRect();
// Click near bottom right corner
const clickX = rect.width - 10;
const clickY = rect.height - 10;
cy.get('[data-testid="data-grid-canvas"]').should("exist");
cy.wait(500);
cy.get('[data-testid="data-grid-canvas"]').then(($canvas) => {
const rect = $canvas[0].getBoundingClientRect();
// Click near bottom right corner
const clickX = rect.width - 10;
const clickY = rect.height - 10;

cy.wrap($canvas).click(clickX, clickY, { force: true });
if (callback) {
callback();
}
});
cy.wrap($canvas).click(clickX, clickY, { force: true });
if (callback) {
callback();
}
});
};

Cypress.Commands.add("addTestRecord", addTestRecord);
Expand Down
Loading