@percy/webdriver-utils 1.27.2 → 1.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,32 +28,7 @@ export default class GenericProvider {
28
28
  this.footer = 0;
29
29
  }
30
30
  addDefaultOptions() {
31
- this.options.freezeAnimation = this.options.freezeAnimation || false;
32
- }
33
- defaultPercyCSS() {
34
- return `*, *::before, *::after {
35
- -moz-transition: none !important;
36
- transition: none !important;
37
- -moz-animation: none !important;
38
- animation: none !important;
39
- animation-duration: 0 !important;
40
- caret-color: transparent !important;
41
- content-visibility: visible !important;
42
- }
43
- html{
44
- scrollbar-width: auto !important;
45
- }
46
- svg {
47
- shape-rendering: geometricPrecision !important;
48
- }
49
- scrollbar, scrollcorner, scrollbar thumb, scrollbar scrollbarbutton {
50
- pointer-events: none !important;
51
- -moz-appearance: none !important;
52
- display: none !important;
53
- }
54
- video::-webkit-media-controls {
55
- display: none !important;
56
- }`;
31
+ this.options.freezeAnimation = this.options.freezeAnimatedImage || this.options.freezeAnimation || false;
57
32
  }
58
33
  async createDriver() {
59
34
  this.driver = new Driver(this.sessionId, this.commandExecutorUrl, this.capabilities);
@@ -75,24 +50,6 @@ export default class GenericProvider {
75
50
  if (i) this.environmentInfo.add(i);
76
51
  }
77
52
  }
78
- async addPercyCSS(userCSS) {
79
- const createStyleElement = `const e = document.createElement('style');
80
- e.setAttribute('data-percy-specific-css', true);
81
- e.innerHTML = '${userCSS}';
82
- document.body.appendChild(e);`;
83
- await this.driver.executeScript({
84
- script: createStyleElement,
85
- args: []
86
- });
87
- }
88
- async removePercyCSS() {
89
- const removeStyleElement = `const n = document.querySelector('[data-percy-specific-css]');
90
- n.remove();`;
91
- await this.driver.executeScript({
92
- script: removeStyleElement,
93
- args: []
94
- });
95
- }
96
53
  async screenshot(name, {
97
54
  ignoreRegionXpaths = [],
98
55
  ignoreRegionSelectors = [],
@@ -105,9 +62,7 @@ export default class GenericProvider {
105
62
  }) {
106
63
  let fullscreen = false;
107
64
  this.addDefaultOptions();
108
- const percyCSS = (this.defaultPercyCSS() + (this.options.percyCSS || '')).split('\n').join('');
109
- log.debug(`[${name}] : Applying the percyCSS - ${this.options.percyCSS}`);
110
- await this.addPercyCSS(percyCSS);
65
+ this.options.percyCSS = (this.options.percyCSS || '').split('\n').join('');
111
66
  log.debug('Fetching comparisong tag ...');
112
67
  const tag = await this.getTag();
113
68
  log.debug(`[${name}] : Tag ${JSON.stringify(tag)}`);
@@ -117,7 +72,6 @@ export default class GenericProvider {
117
72
  const considerRegions = await this.findRegions(considerRegionXpaths, considerRegionSelectors, considerRegionElements, customConsiderRegions);
118
73
  await this.setDebugUrl();
119
74
  log.debug(`[${name}] : Debug url ${this.debugUrl}`);
120
- await this.removePercyCSS();
121
75
  return {
122
76
  name,
123
77
  tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/webdriver-utils",
3
- "version": "1.27.2",
3
+ "version": "1.27.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,8 +29,8 @@
29
29
  "test:coverage": "yarn test --coverage"
30
30
  },
31
31
  "dependencies": {
32
- "@percy/config": "1.27.2",
33
- "@percy/sdk-utils": "1.27.2"
32
+ "@percy/config": "1.27.3",
33
+ "@percy/sdk-utils": "1.27.3"
34
34
  },
35
- "gitHead": "cb64b0c124a5ee1fcb14b130a1fa8e33d26a7284"
35
+ "gitHead": "932d9ce6c17628786cd19091a218d83d2d1f51d9"
36
36
  }