Skip to content

[Proposal] E2E visual test environment #7705

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

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Examples can also contain comments which allow you to define the default configu
// @config NO_MINISTATS
// @config WEBGPU_DISABLED
// @config WEBGL_DISABLED
// @config E2E_TEST
import * as pc from 'playcanvas';
...
```
Expand Down
8 changes: 8 additions & 0 deletions examples/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default [
globals: {
...globals.browser,
...globals.node,
...globals.mocha,
'ObjModelParser': 'readonly',
'OutlineEffect': 'readonly'
}
Expand All @@ -17,6 +18,13 @@ export default [
'import/no-unresolved': 'off'
}
},
{
files: ['test/**/*.mjs'],
rules: {
'no-unused-expressions': 'off',
'prefer-arrow-callback': 'off' // Mocha uses function callbacks
}
},
{
ignores: [
'assets/scripts/utils/area-light-lut-bin-gen.js',
Expand Down
16 changes: 16 additions & 0 deletions examples/scripts/build-metadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ import { parseConfig } from '../utils/utils.mjs';
*/
const exampleMetaData = [];

/**
* @type {{
* categoryKebab: string,
* exampleNameKebab: string
* }[]}
*/
const e2eTestMetaData = [];

/**
* @param {object} obj - The object.
* @returns {string} - The stringified object
Expand Down Expand Up @@ -65,6 +73,13 @@ const main = () => {
categoryKebab,
exampleNameKebab
});

if (config.E2E_TEST) {
e2eTestMetaData.push({
categoryKebab,
exampleNameKebab
});
}
});
});

Expand All @@ -73,5 +88,6 @@ const main = () => {
}

fs.writeFileSync('cache/metadata.mjs', `export const exampleMetaData = ${objStringify(exampleMetaData)};\n`);
fs.writeFileSync('cache/e2eTestMetaData.mjs', `export const e2eTestMetaData = ${objStringify(e2eTestMetaData)};\n`);
};
main();
1 change: 1 addition & 0 deletions examples/src/examples/gizmos/transform-rotate.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, fileImport, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/gizmos/transform-scale.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, fileImport, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, fileImport, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/asset-viewer.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/depth-of-field.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/hdr.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/instancing-glb.example.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION This example demonstrates the functionality of the EXT_mesh_gpu_instancing extension, which enables GPU instancing of meshes stored in a glTF file.
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/shadow-catcher.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath, fileImport } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/shapes.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/sky.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/loaders/gltf-export.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/loaders/gsplat-sh.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/loaders/gsplat.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION This example demonstrates anisotropy on a disc model. It showcases the rendering of anisotropic highlights and material properties.
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION This example demonstrates anisotropy effects on the lamp model. The anisotropic highlights on the lamp's surface showcase the material's directional properties.
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION This example demonstrates anisotropy rotation. Visually, the model showcases the effects of anisotropic highlights as the light interacts with the surface.
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION This example demonstrates anisotropy strength. Visually, the model showcases the effect of anisotropic highlights based on material properties.
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/materials/dispersion.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/materials/lit-material.example.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config HIDDEN
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/test/detail-map.example.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config HIDDEN
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/test/parallax-mapping.example.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config HIDDEN
// @config E2E_TEST
import { data } from 'examples/observer';
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/user-interface/text.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/user-interface/world-ui.example.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @config E2E_TEST
import { deviceType, rootPath } from 'examples/utils';
import * as pc from 'playcanvas';

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading