From c9f8f32e6499798f6dde9e595a5c268a8eaea418 Mon Sep 17 00:00:00 2001 From: Rash419 Date: Fri, 8 Oct 2021 16:03:35 +0530 Subject: cypress: added scrolling tests for desktop calc,impress and writer loleaflet: added test-div for horizontal and vertical scrollbar to get position Signed-off-by: Rash419 Change-Id: I61f5823c26e1dc0a1ec96257bc58cb51bb29024f --- loleaflet/src/layer/tile/ScrollSection.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'loleaflet') diff --git a/loleaflet/src/layer/tile/ScrollSection.ts b/loleaflet/src/layer/tile/ScrollSection.ts index ed15ec7415..a1df8563fe 100644 --- a/loleaflet/src/layer/tile/ScrollSection.ts +++ b/loleaflet/src/layer/tile/ScrollSection.ts @@ -389,6 +389,19 @@ class ScrollSection { this.context.fillRect(startX, scrollProps.startY, this.sectionProperties.scrollBarThickness, scrollProps.scrollSize - this.sectionProperties.scrollBarThickness); this.context.globalAlpha = 1.0; + + if (this.containerObject.testing) { + var element: HTMLDivElement = document.getElementById('test-div-vertical-scrollbar'); + if (!element) { + element = document.createElement('div'); + element.id = 'test-div-vertical-scrollbar'; + document.body.appendChild(element); + } + element.textContent = String(scrollProps.startY); + element.style.display = 'none'; + element.style.position = 'fixed'; + element.style.zIndex = '-1'; + } } private drawHorizontalScrollBar () { @@ -406,6 +419,20 @@ class ScrollSection { this.context.fillRect(scrollProps.startX, startY, scrollProps.scrollSize - this.sectionProperties.scrollBarThickness, this.sectionProperties.scrollBarThickness); this.context.globalAlpha = 1.0; + + if (this.containerObject.testing) { + var element: HTMLDivElement = document.getElementById('test-div-horizontal-scrollbar'); + if (!element) { + element = document.createElement('div'); + element.id = 'test-div-horizontal-scrollbar'; + document.body.appendChild(element); + } + element.textContent = String(scrollProps.startX); + element.style.display = 'none'; + element.style.position = 'fixed'; + element.style.zIndex = '-1'; + } + } private calculateCurrentAlpha (elapsedTime: number) { -- cgit