Skip to content

Commit 2086a59

Browse files
committed
test(e2e): use 2s on CI, 0.5s on dev
1 parent 0ac0f8a commit 2086a59

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

e2e/transitions/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<style>
1212
.fade-enter-active,
1313
.fade-leave-active {
14-
transition: opacity 1.5s ease;
14+
transition: opacity 2s ease;
1515
}
1616
.fade-enter-from,
1717
.fade-leave-active {
1818
opacity: 0;
1919
}
2020
.child-view {
2121
position: absolute;
22-
transition: all 1.5s cubic-bezier(0.55, 0, 0.1, 1);
22+
transition: all 2s cubic-bezier(0.55, 0, 0.1, 1);
2323
}
2424
.slide-left-enter-from,
2525
.slide-right-leave-active {

e2e/transitions/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ const Home: RouteComponent = {
1111
`,
1212
}
1313

14+
// override existing style on dev with shorter times
15+
if (!__CI__) {
16+
const transitionDuration = '0.5s'
17+
const styleEl = document.createElement('style')
18+
styleEl.innerHTML = `
19+
.fade-enter-active,
20+
.fade-leave-active {
21+
transition: opacity ${transitionDuration} ease;
22+
}
23+
.child-view {
24+
position: absolute;
25+
transition: all ${transitionDuration} cubic-bezier(0.55, 0, 0.1, 1);
26+
}
27+
`
28+
document.head.append(styleEl)
29+
}
30+
1431
const Parent: RouteComponent = {
1532
data() {
1633
return {

e2e/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const config = (env = {}) => ({
7575
plugins: [
7676
new webpack.DefinePlugin({
7777
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
78+
__CI__: JSON.stringify(process.env.CI || false),
7879
__BROWSER__: 'true',
7980
'process.env': {
8081
NODE_ENV: JSON.stringify(process.env.NODE_ENV),

src/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// Global compile-time constants
22
declare var __DEV__: boolean
33
declare var __BROWSER__: boolean
4+
declare var __CI__: boolean

0 commit comments

Comments
 (0)