Skip to content

Commit

Permalink
build: uninstalled saucelabs-connector (#8014)
Browse files Browse the repository at this point in the history
<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
_Describe the problem you want to address or the feature you want to
implement._

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
DevExpress/saucelabs-connector#44

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
  • Loading branch information
Aleksey28 authored Sep 19, 2023
1 parent 0ff6d05 commit 455291f
Show file tree
Hide file tree
Showing 9 changed files with 247 additions and 15,879 deletions.
15,848 changes: 122 additions & 15,726 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@
"rollup": "2.16.1",
"rollup-plugin-typescript2": "^0.32.1",
"run-sequence": "^1.2.2",
"saucelabs-connector": "^1.0.0",
"serve-static": "^1.10.0",
"sinon": "^7.3.0",
"stack-chain": "^2.0.0",
Expand Down
1 change: 0 additions & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const hostname = /true/.test(process.env.USE_PUBLIC_HOSTNAME) ? process.env.HOSTNAME : '127.0.0.1';

const browserProviderNames = {
sauceLabs: 'sauceLabs',
browserstack: 'browserstack',
remote: 'remote',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,49 +43,43 @@
<div class="fixed-left" onclick="throw new Error('Misplaced click')"></div>

<script>
const userAgent = window.navigator.userAgent.toLocaleLowerCase();
const isIOS = /(iphone|ipod|ipad)/.test(userAgent);
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;

// NOTE: Try to avoid odd scrolls in iOS on sauceLabs
if (isIOS) {
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;
let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;

let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;
nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];

nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];
originWindowScrollTo.apply(window, arguments);
};

originWindowScrollTo.apply(window, arguments);
};
window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});

window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});
Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

set: function (y) {
window.scrollTo(window.scrollX, y);
}
});
set: function (y) {
window.scrollTo(window.scrollX, y);
}
});

Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},
Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},

set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
}
set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
</script>
</body>
</html>
64 changes: 29 additions & 35 deletions test/functional/fixtures/regression/gh-1353/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,43 @@

// NOTE: scrolling has issues in iOS Simulator https://github.com/DevExpress/testcafe/issues/1237
<script>
const userAgent = window.navigator.userAgent.toLocaleLowerCase();
const isIOS = /(iphone|ipod|ipad)/.test(userAgent);
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;

// NOTE: Try to avoid odd scrolls in iOS on sauceLabs
if (isIOS) {
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;
let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;

let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;
nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];

nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];
originWindowScrollTo.apply(window, arguments);
};

originWindowScrollTo.apply(window, arguments);
};
window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});

window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});
Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

set: function (y) {
window.scrollTo(window.scrollX, y);
}
});
set: function (y) {
window.scrollTo(window.scrollX, y);
}
});

Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},
Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},

set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
}
set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
</script>
</body>
</html>
80 changes: 37 additions & 43 deletions test/functional/fixtures/regression/gh-883/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,43 @@
<div style="height: 9000px">FILLER</div>
<div id="target">TARGET</div>
<script>
const userAgent = window.navigator.userAgent.toLocaleLowerCase();
const isIOS = /(iphone|ipod|ipad)/.test(userAgent);

// NOTE: Try to avoid odd scrolls in iOS on sauceLabs
if (isIOS) {
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;

let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;

nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];

originWindowScrollTo.apply(window, arguments);
};

window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});

Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

set: function (y) {
window.scrollTo(window.scrollX, y);
}
});

Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},

set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
}
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;

let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;

nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];

originWindowScrollTo.apply(window, arguments);
};

window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});

Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

set: function (y) {
window.scrollTo(window.scrollX, y);
}
});

Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},

set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
</script>
</body>
</html>
64 changes: 29 additions & 35 deletions test/functional/fixtures/regression/gh-973/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,43 @@
<div id='targetLowerRight' class="target" style="left:2000px; top:2000px;">Lower right target</div>
<div class="peg" style="left:2700px; top:2700px;"></div>
<script>
const userAgent = window.navigator.userAgent.toLocaleLowerCase();
const isIOS = /(iphone|ipod|ipad)/.test(userAgent);
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;

// NOTE: Try to avoid odd scrolls in iOS on sauceLabs
if (isIOS) {
const nativeMethods = window['%hammerhead%'].nativeMethods;
const originWindowScrollTo = nativeMethods.scrollTo;
let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;

let lastScrollTop = window.scrollY;
let lastScrollLeft = window.scrollX;
nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];

nativeMethods.scrollTo = function () {
lastScrollLeft = arguments[0];
lastScrollTop = arguments[1];
originWindowScrollTo.apply(window, arguments);
};

originWindowScrollTo.apply(window, arguments);
};
window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});

window.addEventListener('scroll', function () {
if (window.scrollX !== lastScrollLeft || window.scrollY !== lastScrollTop)
window.scrollTo(lastScrollLeft, lastScrollTop);
});
Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

Object.defineProperty(document.body, 'scrollTop', {
get: function () {
return window.scrollY;
},

set: function (y) {
window.scrollTo(window.scrollX, y);
}
});
set: function (y) {
window.scrollTo(window.scrollX, y);
}
});

Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},
Object.defineProperty(document.body, 'scrollLeft', {
get: function () {
return window.scrollX;
},

set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
}
set: function (x) {
window.scrollTo(x, window.scrollY);
}
});
</script>
</body>
</html>
2 changes: 0 additions & 2 deletions test/functional/setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path');
const SlConnector = require('saucelabs-connector');
const BsConnector = require('browserstack-connector');
const caller = require('caller');
const promisifyEvent = require('promisify-event');
Expand Down Expand Up @@ -44,7 +43,6 @@ const REQUESTED_MACHINES_COUNT = environment.browsers.length;

const REMOTE_CONNECTORS_MAP = {
[config.browserProviderNames.browserstack]: BsConnector,
[config.browserProviderNames.sauceLabs]: SlConnector,
[config.browserProviderNames.remote]: RemoteConnector,
};

Expand Down
2 changes: 1 addition & 1 deletion test/server/compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ describe('Compiler', function () {
const err = errList.items[0];
const stack = err.callsite.stackFrames.filter(createStackFilter(stackTraceLimit));

expect(stack.length).eql(7);
expect(stack.length).eql(8);

const lastStackItem = stack.pop();

Expand Down

0 comments on commit 455291f

Please sign in to comment.