Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Create reuseable process that normalizes the viewport of all browsers #689

Benjamin Kingb002ce90430c
diff --git a/e2e/reuseables/normalize-viewport.js b/e2e/reuseables/normalize-viewport.js
new file mode 100644
index 000000000..ce1e1a971
--- /dev/null
+++ b/e2e/reuseables/normalize-viewport.js
@@ -0,0 +1,15 @@
+module.exports = {
+ normalizeViewport: function(client, width, height) {
+ client.windowSize('current', width, height);
+ client
+ .execute(function(width, height) {
+ return {
+ width: width === window.innerWidth ? 0 : window.outerWidth - window.innerWidth,
+ height: height === window.innerHeight ? 0 : window.outerHeight - window.innerHeight
+ };
+ }, [ width, height ], function(result) {
+ const padding = result.value;
+ client.windowSize('current', width + padding.width, height + padding.height);
+ });
+ }
+};