Use default export templates for HTML5

Changes Emscripten SDK version to match that used to compile the default export
templates used by Godot 3.5 (in this case 3.1.14 as can be seen here:
https://github.com/godotengine/build-containers/blob/3.5/Dockerfile.javascript).

This means we no longer need to compile custom export templates when
exporting HTML5 for Godot 3.5. Exports from other Godot versions may
requiring compiling the GDNative library with a different version of the
Emscripten SDK.

- Changes renderer from GLES3 -> GLES2 and reduces MSAA level to better
  support HTML5 export.
- Updates GitHub Action to export HTML5 and upload as a build artifact.
- Adds Cypress test to smoke test HTML5 export.
This commit is contained in:
Leroy Hopson 2022-08-01 19:56:43 +12:00
parent b31861f171
commit fae6317eb7
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
26 changed files with 4895 additions and 118 deletions

0
test/html5/.gdignore Normal file
View file

4
test/html5/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
cypress-visual-screenshots/
cypress/screenshots/
cypress/videos/
node_modules/

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -0,0 +1,10 @@
const { defineConfig } = require("cypress");
const getCompareSnapshotsPlugin = require('cypress-image-diff-js/dist/plugin');
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
getCompareSnapshotsPlugin(on, config);
},
},
});

View file

@ -0,0 +1,21 @@
Cypress.on('window:before:load', win => {
cy.spy(win.console, 'error')
cy.spy(win.console, 'warn')
cy.spy(win.console, 'log')
})
describe('GodotXterm HTML5 export', () => {
it('Loads and runs without error', () => {
cy.visit('http://localhost:3000')
cy.compareSnapshot('menu', 0.9, {
limit: 100, delay: 200, timeout: 20000,
})
cy.get('body').type('{downArrow}{enter}')
cy.get('body').type('window.console.log("It works!"){enter}')
cy.window().then(win => {
cy.expect(win.console.error).to.have.callCount(0)
cy.expect(win.console.warn).to.have.callCount(0)
cy.expect(win.console.log).to.be.calledWith("It works!")
})
})
})

View file

@ -0,0 +1,2 @@
import compareSnapshotCommand from 'cypress-image-diff-js/dist/command';
compareSnapshotCommand();

View file

@ -0,0 +1 @@
import './commands'

4764
test/html5/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

11
test/html5/package.json Normal file
View file

@ -0,0 +1,11 @@
{
"scripts": {
"start": "npx serve ../../docs/demo",
"test": "npx cypress run"
},
"devDependencies": {
"cypress": "^10.4.0",
"cypress-image-diff-js": "^1.21.1",
"serve": "^14.0.1"
}
}

14
test/html5/shell.nix Normal file
View file

@ -0,0 +1,14 @@
let
pkgs = import <nixpkgs> {};
in pkgs.mkShell {
buildInputs = with pkgs; [
cypress
nodejs-16_x
xsel
];
shellHook = ''
export CYPRESS_INSTALL_BINARY=0
export CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress
'';
}