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

add DOM elements for sync with puppeteer browser automation - #minor #1035

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mki-c2c
Copy link

@mki-c2c mki-c2c commented Aug 20, 2024

Experimentation with headless chrome printing via puppeteer has brought the need to detect the end of rendering.

The webviewer acan be opened in an automated browser window (headless) via puppeteer:

const browser = await puppeteer.launch({
    headless: false,
    defaultViewport: {width, height, deviceScaleFactor},
    executablePath: '/usr/bin/google-chrome',
    args: [
        "--no-sandbox",
    ]
});
const page = await browser.newPage();
await page.goto(webviewer_url);

Puppeteer can monitor the DOM and wait until the sync elements appear in the document:

await page.waitForFunction(
    "document.getElementById('maplibre_complete') && document.getElementById('openlayer_complete')",
    {timeout: 10000}
).catch(()=>console.log('timeout after 10s, the web page has not finished rendering'))

Test link

@github-actions github-actions bot changed the title add DOM elements for sync with puppeteer browser automation add DOM elements for sync with puppeteer browser automation - #minor Aug 20, 2024
Copy link

cypress bot commented Aug 20, 2024

web-mapviewer    Run #3611

Run Properties:  status check passed Passed #3611  •  git commit 7a71502ad3: touch file to force CI redeployment
Project web-mapviewer
Run status status check passed Passed #3611
Run duration 04m 59s
Commit git commit 7a71502ad3: touch file to force CI redeployment
Committer Moritz Kirmse
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant