mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
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:
parent
2fa2322d7c
commit
10b9764fb3
26 changed files with 4896 additions and 118 deletions
0
test/html5/.gdignore
Normal file
0
test/html5/.gdignore
Normal file
4
test/html5/.gitignore
vendored
Normal file
4
test/html5/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
cypress-visual-screenshots/
|
||||
cypress/screenshots/
|
||||
cypress/videos/
|
||||
node_modules/
|
BIN
test/html5/cypress-visual-screenshots/baseline/smoke_test.cy-menu.png
Executable file
BIN
test/html5/cypress-visual-screenshots/baseline/smoke_test.cy-menu.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
10
test/html5/cypress.config.js
Normal file
10
test/html5/cypress.config.js
Normal 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);
|
||||
},
|
||||
},
|
||||
});
|
21
test/html5/cypress/e2e/smoke_test.cy.js
Normal file
21
test/html5/cypress/e2e/smoke_test.cy.js
Normal 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!")
|
||||
})
|
||||
})
|
||||
})
|
2
test/html5/cypress/support/commands.js
Normal file
2
test/html5/cypress/support/commands.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import compareSnapshotCommand from 'cypress-image-diff-js/dist/command';
|
||||
compareSnapshotCommand();
|
1
test/html5/cypress/support/e2e.js
Normal file
1
test/html5/cypress/support/e2e.js
Normal file
|
@ -0,0 +1 @@
|
|||
import './commands'
|
4764
test/html5/package-lock.json
generated
Normal file
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
11
test/html5/package.json
Normal 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
14
test/html5/shell.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue