Skip to content

Commit cf89a11

Browse files
chore(deps-dev): bump cypress from 9.1.0 to 10.2.0 (#273)
* chore(deps-dev): bump cypress from 9.1.0 to 10.2.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 9.1.0 to 10.2.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](cypress-io/cypress@v9.1.0...v10.2.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Migrate to cypress 10 * Fix glob Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitriy <[email protected]>
1 parent 29d69a0 commit cf89a11

File tree

15 files changed

+1062
-1205
lines changed

15 files changed

+1062
-1205
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ workflows:
5757
# following examples from
5858
# https://circleci.com/docs/2.0/parallelism-faster-jobs/
5959
command: |
60-
TESTFILES=$(circleci tests glob "cypress/integration/**/*spec.{js,jsx,ts,tsx}" | circleci tests split --total=2)
60+
TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.ts" | circleci tests split --total=2)
6161
echo "Test files for this machine are $TESTFILES"
6262
npx cypress run --spec $TESTFILES
6363
- release:

cypress.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
video: false,
5+
e2e: {
6+
// We've imported your old cypress plugins here.
7+
// You may want to clean this up later by importing these.
8+
setupNodeEvents(on, config) {
9+
return require('./cypress/plugins/index.js')(on, config)
10+
},
11+
},
12+
})

cypress.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

cypress/integration/click.spec.ts renamed to cypress/e2e/click.cy.ts

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,41 @@ describe("cy.realClick", () => {
4444
cy.get(".action-btn")
4545
.then(($button) => {
4646
$button.get(0).addEventListener("dblclick", () => {
47-
done()
47+
done();
4848
});
4949
})
5050
.realClick({ clickCount: 2 });
5151
});
5252

5353
it("should dispatch multiple clicks with clickCount greater than 1", (done) => {
54-
let count = 0
54+
let count = 0;
5555
cy.get(".action-btn")
5656
.then(($button) => {
5757
$button.get(0).addEventListener("click", () => {
58-
count++
58+
count++;
5959
if (count === 2) {
60-
done()
60+
done();
6161
}
6262
});
6363
})
6464
.realClick({ clickCount: 2 });
6565
});
6666

6767
it("right click should only report secondary button being pressed", () => {
68-
cy.get(".navbar-brand").then($navbarBrand => {
69-
$navbarBrand.get(0).addEventListener('contextmenu', (ev) => {
70-
ev.preventDefault()
71-
expect(ev.buttons).to.eq(2)
72-
})
73-
})
68+
cy.get(".navbar-brand").then(($navbarBrand) => {
69+
$navbarBrand.get(0).addEventListener("contextmenu", (ev) => {
70+
ev.preventDefault();
71+
expect(ev.buttons).to.eq(2);
72+
});
73+
});
7474

75-
cy.get('.navbar-brand').realClick({ button: 'right' })
75+
cy.get(".navbar-brand").realClick({ button: "right" });
7676
});
7777

7878
describe("scroll behavior", () => {
7979
function getScreenEdges() {
80-
const cypressAppWindow = window.parent.document.querySelector("iframe")
81-
.contentWindow;
80+
const cypressAppWindow =
81+
window.parent.document.querySelector("iframe").contentWindow;
8282
const windowTopEdge = cypressAppWindow.document.documentElement.scrollTop;
8383
const windowBottomEdge = windowTopEdge + cypressAppWindow.innerHeight;
8484
const windowCenter = windowTopEdge + cypressAppWindow.innerHeight / 2;
@@ -94,8 +94,8 @@ describe("cy.realClick", () => {
9494
const $elTop = $el.offset().top;
9595

9696
return {
97-
top: $elTop,
98-
bottom: $elTop + $el.outerHeight(),
97+
top: Math.floor($elTop),
98+
bottom: Math.floor($elTop + $el.outerHeight()),
9999
};
100100
}
101101

@@ -110,7 +110,7 @@ describe("cy.realClick", () => {
110110
const { top: $elTop } = getElementEdges($canvas);
111111
const { top: screenTop } = getScreenEdges();
112112

113-
expect($elTop).to.equal(screenTop);
113+
expect($elTop).to.equal(Math.floor(screenTop));
114114
});
115115
});
116116

@@ -123,8 +123,12 @@ describe("cy.realClick", () => {
123123

124124
const screenCenter = screenTop + (screenBottom - screenTop) / 2;
125125

126-
expect($elTop).to.equal(screenCenter - $canvas.outerHeight() / 2);
127-
expect($elBottom).to.equal(screenCenter + $canvas.outerHeight() / 2);
126+
expect($elTop).to.eq(
127+
Math.floor(screenCenter - $canvas.outerHeight() / 2)
128+
);
129+
expect($elBottom).to.equal(
130+
Math.floor(screenCenter + $canvas.outerHeight() / 2)
131+
);
128132
});
129133
});
130134

@@ -135,7 +139,7 @@ describe("cy.realClick", () => {
135139
const { top: $elTop } = getElementEdges($canvas);
136140
const { top: screenTop } = getScreenEdges();
137141

138-
expect($elTop).to.equal(screenTop);
142+
expect($elTop).to.equal(Math.floor(screenTop));
139143
});
140144
});
141145

@@ -146,7 +150,7 @@ describe("cy.realClick", () => {
146150
const { bottom: $elBottom } = getElementEdges($canvas);
147151
const { bottom: screenBottom } = getScreenEdges();
148152

149-
expect($elBottom).to.equal(screenBottom);
153+
expect($elBottom).to.equal(Math.floor(screenBottom));
150154
});
151155
});
152156

@@ -159,7 +163,7 @@ describe("cy.realClick", () => {
159163
const { top: $elTop } = getElementEdges($canvas);
160164
const { top: screenTop } = getScreenEdges();
161165

162-
expect($elTop).to.equal(screenTop);
166+
expect($elTop).to.equal(Math.floor(screenTop));
163167
});
164168

165169
cy.window().scrollTo("top");
@@ -170,7 +174,7 @@ describe("cy.realClick", () => {
170174
const { bottom: $elBottom } = getElementEdges($canvas);
171175
const { bottom: screenBottom } = getScreenEdges();
172176

173-
expect($elBottom).to.equal(screenBottom);
177+
expect($elBottom).to.equal(Math.floor(screenBottom));
174178
});
175179
});
176180
});

cypress/integration/hover.spec.ts renamed to cypress/e2e/hover.cy.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ describe("cy.realHover", () => {
2626
const windowCenter = windowTopEdge + cypressAppWindow.innerHeight / 2;
2727

2828
return {
29-
screenTop: windowTopEdge,
30-
screenBottom: windowBottomEdge,
31-
screenCenter: windowCenter,
29+
screenTop: Math.floor(windowTopEdge),
30+
screenBottom: Math.floor(windowBottomEdge),
31+
screenCenter: Math.floor(windowCenter),
3232
};
3333
}
3434

3535
function getElementEdges($el: JQuery) {
3636
const $elTop = $el.offset().top;
3737

3838
return {
39-
$elTop,
40-
$elBottom: $elTop + $el.outerHeight(),
39+
$elTop: Math.floor($elTop),
40+
$elBottom: Math.floor($elTop + $el.outerHeight()),
4141
};
4242
}
4343

@@ -65,8 +65,12 @@ describe("cy.realHover", () => {
6565

6666
const screenCenter = screenTop + (screenBottom - screenTop) / 2;
6767

68-
expect($elTop).to.equal(screenCenter - $canvas.outerHeight() / 2);
69-
expect($elBottom).to.equal(screenCenter + $canvas.outerHeight() / 2);
68+
expect($elTop).to.equal(
69+
Math.floor(screenCenter) - $canvas.outerHeight() / 2
70+
);
71+
expect($elBottom).to.equal(
72+
Math.floor(screenCenter) + $canvas.outerHeight() / 2
73+
);
7074
});
7175
});
7276

@@ -77,7 +81,7 @@ describe("cy.realHover", () => {
7781
const { $elTop } = getElementEdges($canvas);
7882
const { screenTop } = getScreenEdges();
7983

80-
expect($elTop).to.equal(screenTop);
84+
expect($elTop).to.equal(Math.floor(screenTop));
8185
});
8286
});
8387

@@ -88,7 +92,7 @@ describe("cy.realHover", () => {
8892
const { $elBottom } = getElementEdges($canvas);
8993
const { screenBottom } = getScreenEdges();
9094

91-
expect($elBottom).to.equal(screenBottom);
95+
expect($elBottom).to.equal(Math.floor(screenBottom));
9296
});
9397
});
9498

@@ -101,7 +105,7 @@ describe("cy.realHover", () => {
101105
const { $elTop } = getElementEdges($canvas);
102106
const { screenTop } = getScreenEdges();
103107

104-
expect($elTop).to.equal(screenTop);
108+
expect($elTop).to.equal(Math.floor(screenTop));
105109
});
106110

107111
cy.window().scrollTo("top");
@@ -112,7 +116,7 @@ describe("cy.realHover", () => {
112116
const { $elBottom } = getElementEdges($canvas);
113117
const { screenBottom } = getScreenEdges();
114118

115-
expect($elBottom).to.equal(screenBottom);
119+
expect($elBottom).to.equal(Math.floor(screenBottom));
116120
});
117121
});
118122
});

0 commit comments

Comments
 (0)