diff --git a/.gitignore b/.gitignore index ccc7b514fc56..f86fac7a600e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,6 @@ Thumbs.db # playwright /playwright/.cache/ /Specs/e2e/*-snapshots/ -/Specs/e2e/webgl-check/ /Tools/jsdoc/cesium_template/static/javascript/prism.js /Tools/jsdoc/cesium_template/static/styles/prism.css @@ -43,4 +42,4 @@ yarn.lock .idea/shelf # Used in the CLA checking GitHub workflow -GoogleConfig.json +GoogleConfig.json \ No newline at end of file diff --git a/.markdownlint.json b/.markdownlint.json index 9a399a1aa404..496d1554517e 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -8,5 +8,7 @@ "ol-prefix": { "style": "ordered" }, - "no-inline-html": true -} \ No newline at end of file + "no-inline-html": { + "allowed_elements": ["details", "summary"] + } +} diff --git a/Documentation/Contributors/TestingGuide/README.md b/Documentation/Contributors/TestingGuide/README.md index 035b971337a5..23a9c5131573 100644 --- a/Documentation/Contributors/TestingGuide/README.md +++ b/Documentation/Contributors/TestingGuide/README.md @@ -294,6 +294,64 @@ When new Sandcastle is added, or behavior is intentionally changed, the screensh npm run test-e2e-update -- -g "3D Tiles Clipping Planes" ``` +#### End to End test performance + +The vast majority of our end to end tests should run in about 2-5 seconds across any machine (a few may still be above 15 seconds but most should not). If they are taking longer than that you should look to speed them up. We've previously noticed certain browsers not using the GPU under Playwright resulting in slower tests. + +The first step to checking for WebGL related issues should be to add an extra test or two to load the WebGL report under the Playwright environment to see if anything (like the wrong GPU) pops out. Expand the details below for an example of these tests + +
WebGL check example + +```js +// tests/example1.test.js +import { test } from "./test.js"; + +function waitFor(delay) { + return new Promise((resolve) => setTimeout(resolve, delay)); +} + +const screenshotPath = "Specs/e2e/webgl-check"; + +const chromeGpu = "chrome://gpu/"; // only works for chrome not firefox +const webGlReport1 = "https://webglreport.com/?v=1"; +const webGlReport2 = "https://webglreport.com/?v=2"; + +/** + * This is used to check how WebGL is running in the testing environment to spot things like + * not using the correct gpu that may affect performace and run time of the tests themselves + * Based off of https://www.createit.com/blog/headless-chrome-testing-webgl-using-playwright/ + */ +test.describe("WebGL verification", () => { + // Check if hardware acceleration is enabled. Without it, our tests will be much slower. + test("GPU hardware acceleration", async ({ page }) => { + await page.goto(chromeGpu); + await waitFor(2000); + await page.screenshot({ + path: `${screenshotPath}/screenshot_hardware.png`, + fullPage: true, + }); + }); + test("webgl report v1", async ({ page }) => { + await page.goto(webGlReport1); + await waitFor(2000); + await page.screenshot({ + path: `${screenshotPath}/screenshot_webgl1.png`, + fullPage: true, + }); + }); + test("webgl report v2", async ({ page }) => { + await page.goto(webGlReport2); + await waitFor(2000); + await page.screenshot({ + path: `${screenshotPath}/screenshot_webgl2.png`, + fullPage: true, + }); + }); +}); +``` + +
+ ## `testfailure` Label for Issues Despite our best efforts, sometimes tests fail. This is often due to a new browser, OS, or driver bug that breaks a test that previously passed. If this indicates a bug in CesiumJS, we strive to quickly fix it. Likewise, if it indicates that CesiumJS needs to work around the issue (for example, as we [did for Safari 9](https://github.com/CesiumGS/cesium/issues/2989)), we also strive to quickly fix it. diff --git a/Specs/e2e/webgl-check.spec.js b/Specs/e2e/webgl-check.spec.js deleted file mode 100644 index f59e407ef0b1..000000000000 --- a/Specs/e2e/webgl-check.spec.js +++ /dev/null @@ -1,58 +0,0 @@ -// tests/example1.test.js -import { test } from "./test.js"; - -function waitFor(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} - -const screenshotPath = "Specs/e2e/webgl-check"; - -const chromeGpu = "chrome://gpu/"; -const webGlReport1 = "https://webglreport.com/?v=1"; -const webGlReport2 = "https://webglreport.com/?v=2"; -const aquarium = "https://webglsamples.org/aquarium/aquarium.html"; - -test.beforeEach(async ({ page }, testInfo) => { - testInfo.setTimeout(testInfo.timeout + 160000); -}); - -/** - * This is used to check how WebGL is running in the testing environment to spot things like - * not using the correct gpu that may affect performace and run time of the tests themselves - * Based off of https://www.createit.com/blog/headless-chrome-testing-webgl-using-playwright/ - */ -test.describe("WebGL verification", () => { - // Check if hardware acceleration is enabled. Without it, our tests will be much slower. - test("GPU hardware acceleration", async ({ page }) => { - await page.goto(chromeGpu); - await waitFor(2000); - await page.screenshot({ - path: `${screenshotPath}/screenshot_hardware.png`, - fullPage: true, - }); - }); - test("webgl report v1", async ({ page }) => { - await page.goto(webGlReport1); - await waitFor(2000); - await page.screenshot({ - path: `${screenshotPath}/screenshot_webgl1.png`, - fullPage: true, - }); - }); - test("webgl report v2", async ({ page }) => { - await page.goto(webGlReport2); - await waitFor(2000); - await page.screenshot({ - path: `${screenshotPath}/screenshot_webgl2.png`, - fullPage: true, - }); - }); - test("aquarium", async ({ page }) => { - await page.goto(aquarium); - await waitFor(5000); - await page.screenshot({ - path: `${screenshotPath}/screenshot_aquarium.png`, - fullPage: true, - }); - }); -});