Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where scrollbar would take up full width of test runner instead of only command log in Chrome 72+ #3255

Merged
merged 4 commits into from
Jan 30, 2019
Merged
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: 37 additions & 0 deletions packages/driver/test/cypress/integration/issues/3253_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const _ = Cypress._

// https://github.com/cypress-io/cypress/issues/3253
describe('issue #3253: scrollbar appearing full height including scrolling AUT', () => {
it('does not scroll html', () => {
const html = window.top.document.documentElement

const beforeScrollY = window.top.scrollY
const beforeClientRect = html.getBoundingClientRect()
const beforeRect = _.pick(beforeClientRect, _.keysIn(beforeClientRect))

cy.viewport(300, 300)
// this bug only happens when the command log
// extends below the height of the html and aut
_.times(100, (i) => {
cy.wrap(i)
})

cy.wrap(null).then(() => {
// try to scroll the page down a lot
window.scroll(0, 10000)

const afterScrollY = window.top.scrollY
const afterClientRect = html.getBoundingClientRect()
const afterRect = _.pick(afterClientRect, _.keysIn(afterClientRect))

// the html should not be scrollable
// we only want the Command Log to scroll
// so no scrolling should have happened
expect(beforeScrollY).to.deep.eq(afterScrollY)

// the width of the html should not have changed
// meaning, the width of the scrollbar was not subtracted
expect(beforeRect).to.deep.eq(afterRect)
})
})
})
8 changes: 5 additions & 3 deletions packages/runner/src/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
.reporter-wrap {
min-width: $reporter-min-width;
bottom: 0;
display: flex;
flex-direction: column;
left: 0;
position: absolute;
top: 0;
Expand All @@ -17,7 +15,11 @@
}

.reporter {
flex-grow: 2;
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
}

Expand Down