-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/1.4' of https://github.com/galacean/engine into fea…
…t/editor_module
- Loading branch information
Showing
74 changed files
with
742 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### Note: Require install git-lfs | ||
We use [git-lfs](https://git-lfs.com/) (Install by official website) to manage baseline images for e2e tests, so it's necessary to install it, ignore if already installed. | ||
### 1. Create a case page in the e2e/case directory | ||
You can refer to e2e/case/animator-play.ts. | ||
### 2. Configure your e2e test in e2e/config.ts | ||
The threshold is color difference threshold (from 0 to 1). Less more precise. | ||
### 3. Debug your test cases: | ||
#### Launch the Case page: | ||
|
||
``` | ||
npm run e2e:case | ||
``` | ||
|
||
After successfully launching the case page, run: | ||
|
||
``` | ||
git lfs pull | ||
``` | ||
Pull image from github, then run | ||
|
||
``` | ||
npm run e2e:debug | ||
``` | ||
|
||
Open the Cypress client for debugging. | ||
Cypress will capture screenshots of your case pages. | ||
Review the screenshots in e2e/downloads folder, store them in the e2e/fixtures/originImage directory if there are no issues, then rerun the test cases. If the test cases pass, the debugging is complete. | ||
|
||
### 4. Run the complete e2e tests: | ||
``` | ||
npm run e2e | ||
``` | ||
Note: The e2e testing framework for this project is Cypress. For detailed usage instructions, please refer to https://www.cypress.io/. | ||
|
||
|
||
### Add new e2e case | ||
|
||
1. modify `config.ts` based on the new test case. | ||
2. run `npm run e2e:debug` | ||
|
||
the new image of test case for comparison will be present under directory `e2e/downloads`, you need to copy it into directory `e2e/fixtures/originImage`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @title Project loader | ||
* @category Advance | ||
*/ | ||
import { Logger, WebGLEngine, AssetType, Camera } from "@galacean/engine"; | ||
import { ShaderLab } from "@galacean/engine-shader-lab"; | ||
import { registerIncludes } from "@galacean/engine-toolkit"; | ||
import { initScreenshot, updateForE2E } from './.mockForE2E'; | ||
|
||
// Create ShaderLab | ||
const shaderLab = new ShaderLab(); | ||
registerIncludes(); | ||
|
||
Logger.enable(); | ||
WebGLEngine.create({ canvas: "canvas", shaderLab }).then( (engine) => { | ||
engine.canvas.resizeByClientSize(2); | ||
engine.resourceManager | ||
.load({ | ||
type: AssetType.Project, | ||
url: "https://mdn.alipayobjects.com/oasis_be/afts/file/A*o15SSopTBh0AAAAAAAAAAAAADkp5AQ/project.json" | ||
}).then(() => { | ||
updateForE2E(engine); | ||
|
||
const cameraEntity = | ||
engine.sceneManager.activeScene.findEntityByName('Camera'); | ||
const camera = cameraEntity.getComponent(Camera) | ||
initScreenshot(engine, camera) | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.