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

Upgrade puppeteer to 9.0.0 #1408

Merged
merged 1 commit into from
May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
Upgrayedd puppeteer
  • Loading branch information
texodus committed May 1, 2021
commit 706ceb0a5c1decfbc10ea6e31e657407b34b9a89
27 changes: 26 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,36 @@ jobs:
PSP_DOCKER: 1

- task: PublishTestResults@2
condition: succeededOrFailed()
condition: succeeded()
inputs:
testRunner: JUnit
testResultsFiles: 'junit.xml'

- task: PublishPipelineArtifact@1
condition: failed()
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/packages/perspective-viewer/screenshots/'
artifactName: "perspective-viewer"

- task: PublishPipelineArtifact@1
condition: failed()
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/packages/perspective-viewer-datagrid/screenshots/'
artifactName: "perspective-viewer-datagrid"

- task: PublishPipelineArtifact@1
condition: failed()
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/packages/perspective-viewer-d3fc/screenshots/'
artifactName: "perspective-viewer-d3fc"

- task: PublishPipelineArtifact@1
condition: failed()
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/packages/perspective-workspace/screenshots/'
artifactName: "perspective-workspace"


- job: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
Expand Down
12 changes: 2 additions & 10 deletions docker/puppeteer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Liberally copied from zenato/puppeteer

FROM node:8
FROM node:14

RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
Expand All @@ -12,21 +12,13 @@ RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb

RUN yarn add puppeteer@1.14.0
RUN yarn add puppeteer@9.0.0

RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /node_modules


RUN git clone https://github.com/stefanhaustein/TerminalImageViewer.git \
&& cd TerminalImageViewer/src/main/cpp \
&& make \
&& make install \
&& cd ../../.. \
&& rm -rf TerminalImageViewer

USER pptruser

CMD ["google-chrome-stable"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resize_Basic_widget_functions": "30f89fb74a40a6abfe02887d62be8282",
"resize_Resize_the_container_causes_the_widget_to_resize": "30f89fb74a40a6abfe02887d62be8282",
"resize_row_pivots_traitlet_works": "03e9bd6f294b959000490af0908536f2",
"__GIT_COMMIT__": "d6344be7a126e4b2bfa05dbb8c4d5f5feca2b8c5"
"resize_Basic_widget_functions": "bb2bf2ecff35fb62ef2e4e1b832467d6",
"resize_Resize_the_container_causes_the_widget_to_resize": "bb2bf2ecff35fb62ef2e4e1b832467d6",
"resize_row_pivots_traitlet_works": "65892ed4574fe02005e2c8fcf3b67718",
"__GIT_COMMIT__": "686bb7147e58992e5d06056778b20d07605a8042"
}
14 changes: 13 additions & 1 deletion packages/perspective-test/src/js/globalSetup.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
const puppeteer = require("puppeteer");

module.exports = async function() {
let args = ["--disable-accelerated-2d-canvas", "--disable-gpu", "--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", '--proxy-server="direct://"', "--proxy-bypass-list=*"];
let args = [
`--window-size=1280,1024`,
"--disable-accelerated-2d-canvas",
"--disable-gpu",
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
'--proxy-server="direct://"',
"--proxy-bypass-list=*"
];

global.__BROWSER__ = await puppeteer.launch({
headless: !process.env.PSP_PAUSE_ON_FAILURE,
devtools: !!process.env.PSP_PAUSE_ON_FAILURE,

// https://github.com/puppeteer/puppeteer/issues/1183
defaultViewport: null,
args
});
process.env.PSP_BROWSER_ENDPOINT = global.__BROWSER__.wsEndpoint();
Expand Down
14 changes: 13 additions & 1 deletion packages/perspective-test/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,24 @@ async function get_new_page() {
elem.innerText = content;
triggerInputEvent(elem);
}

document.activeElement.blur();
},
content,
path
);
};

page.shadow_blur = async function() {
await this.evaluate(() => {
let elem = document.activeElement;
while (elem) {
elem.blur();
elem = elem.shadowRoot?.activeElement;
}
});
};

page.shadow_focus = async function(...path) {
await this.evaluate(path => {
let elem = document;
Expand Down Expand Up @@ -387,7 +399,7 @@ test.capture = function capture(name, body, {timeout = 60000, viewport = null, w
});
}

const screenshot = await page.screenshot();
const screenshot = await page.screenshot({captureBeyondViewport: false, fullPage: true});
// await page.close();
const hash = crypto
.createHash("md5")
Expand Down
1 change: 1 addition & 0 deletions packages/perspective-viewer-d3fc/src/js/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function drawChart(chart) {
};

createOrUpdateChart.call(this, el, chart, settings);
await new Promise(setTimeout);
};
}

Expand Down
8 changes: 4 additions & 4 deletions packages/perspective-viewer-d3fc/src/js/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function showTooltip(containerNode, node, tooltipDiv, centered) {
tooltipDiv
.style("left", `${left}px`)
.style("top", `${top}px`)
.transition()
.duration(200)
// .transition()
// .duration(200)
.style("opacity", 0.9);

if (centered) [left, top] = centerTip(tooltipDiv, containerRect);
Expand Down Expand Up @@ -150,8 +150,8 @@ function shiftIfOverflowingChartArea(tooltipDiv, containerRect, left, top, cente
function hideTooltip(tooltipDiv) {
if (tooltipDiv) {
tooltipDiv
.transition()
.duration(500)
// .transition()
// .duration(500)
.style("opacity", 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<perspective-viewer plugin="{view-name}" row-pivots='["Date"]' column-pivots='[]' filters='[]' sort='[]'
columns='["Open","Close","High","Low"]'
aggregates='{"Date":"distinct count","Change%":"sum","High":"sum","Low":"sum","Open":"sum","Close":"sum","Vol.":"sum"}'>
aggregates='{"Date":"distinct count","Change %":"sum","High":"sum","Low":"sum","Open":"sum","Close":"sum","Vol.":"sum"}'>

</perspective-viewer>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ utils.with_server({}, () => {
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => element.setAttribute("filters", '[["Name", "==", "BARC"]]'), viewer);
await page.evaluate(async element => await element.flush(), viewer);
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
});

test.capture("filter to date range.", async page => {
Expand All @@ -31,7 +31,7 @@ utils.with_server({}, () => {
await page.evaluate(element => element.setAttribute("column-pivots", '["Name"]'), viewer);
await page.evaluate(element => element.setAttribute("filters", '[["Date", ">", "2019-01-01"]]'), viewer);
await page.evaluate(async element => await element.flush(), viewer);
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
});
},
{reload_page: false, root: path.join(__dirname, "..", "..", "..")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ utils.with_server({}, () => {
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => element.setAttribute("filters", '[["Name", "==", "BARC"]]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
});

test.capture("filter to date range.", async page => {
Expand All @@ -31,7 +31,7 @@ utils.with_server({}, () => {
await page.evaluate(element => element.setAttribute("column-pivots", '["Name"]'), viewer);
await page.evaluate(element => element.setAttribute("filters", '[["Date", ">", "2019-01-01"]]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
});
},
{reload_page: false, root: path.join(__dirname, "..", "..", "..")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ utils.with_server({}, () => {
await page.evaluate(element => element.setAttribute("columns", '["Sales", "Profit"]'), viewer);
await page.evaluate(element => element.setAttribute("filters", '[["Product ID", "==", "FUR-BO-10001798"]]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
const result = await page.waitFor(
element => {
let elem = element.shadowRoot.querySelector("perspective-d3fc-chart").shadowRoot.querySelector(".segment");
Expand All @@ -50,7 +50,7 @@ utils.with_server({}, () => {
await page.evaluate(element => element.setAttribute("columns", '["Sales", "Profit"]'), viewer);
await page.evaluate(element => element.setAttribute("filters", '[["Product ID", "==", "FUR-BO-10001798"]]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(() => document.activeElement.blur());
await page.shadow_blur();
await page.mouse.click(500, 400);
const result = await page.waitFor(
element => {
Expand Down
Loading