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

Make Freeze Animation false by default #1309

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from 1 commit
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
34 changes: 33 additions & 1 deletion packages/webdriver-utils/src/providers/genericProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ export default class GenericProvider {
this.debugUrl = null;
}

addDefaultOptions() {
this.options.freezeAnimation = this.options.freezeAnimation || false;
}

defaultPercyCSS() {
itsjwala marked this conversation as resolved.
Show resolved Hide resolved
return `*, *::before, *::after {
-moz-transition: none !important;
transition: none !important;
-moz-animation: none !important;
animation: none !important;
animation-duration: 0 !important;
caret-color: transparent !important;
content-visibility: visible !important;
}
html{
scrollbar-width: auto !important;
}
svg {
shape-rendering: geometricPrecision !important;
}
scrollbar, scrollcorner, scrollbar thumb, scrollbar scrollbarbutton {
pointer-events: none !important;
-moz-appearance: none !important;
display: none !important;
}
video::-webkit-media-controls {
display: none !important;
}`;
}

async createDriver() {
this.driver = new Driver(this.sessionId, this.commandExecutorUrl);
const caps = await this.driver.getCapabilites();
Expand Down Expand Up @@ -77,7 +107,9 @@ export default class GenericProvider {
}) {
let fullscreen = false;

const percyCSS = this.options.percyCSS || '';
this.addDefaultOptions();

const percyCSS = (this.defaultPercyCSS() + (this.options.percyCSS || '')).split('\n').join('');
await this.addPercyCSS(percyCSS);
const tag = await this.getTag();

Expand Down