This is an automated email from the ASF dual-hosted git repository.
100pah pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new 37bf0264 fix(e2e): Fix e2e test tool: add missing global variable and
update README.
37bf0264 is described below
commit 37bf0264b9c37242a2ca59e2a50e3077b46f56c9
Author: 100pah <[email protected]>
AuthorDate: Wed May 27 19:00:54 2026 +0800
fix(e2e): Fix e2e test tool: add missing global variable and update README.
---
README.md | 36 ++++++++++++++++++++++++++----------
e2e/main.js | 6 ++++++
2 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 2d2a936b..40ce908c 100644
--- a/README.md
+++ b/README.md
@@ -186,7 +186,7 @@ npm run dev
2. Add `local=1` to the entry URL.
- For example: `http://127.0.0.1:3002/en/editor.html?c=line-simple&local=1`
-## Run e2e tests.
+## Run e2e tests
Run all the examples to test package publishing and install, module importing,
minimal bundling and DTS correctness.
@@ -238,27 +238,43 @@ npm run test:e2e:esbuild > result.log 2>&1
### Check the test result
-The test result is in:
-
+**Check the overall test result**:
- the `result.log`
- `echarts-examples/e2e/report.html`, the file should be opened in your own
local http server.
-### Run partial tests.
+**Check a single test case in browser**:
+Modify the bundle js file in `echarts-examples/e2e/preview.html`, for example:
+```html
+<script src="tmp/bundles/bar3D.js"></script>
+```
+Then open it:
+```shell
+cd /path/to/your/echarts-examples
+python3 -m http.server 3322
+open "http://127.0.0.1:3322/e2e/preview.html"
+```
+
+### Run partial tests
> Note: This can only be used when you run the whole e2e test at least once.
-Skip specific stages.
-
+Skip specific stages:
```shell
-node e2e/main.js --skip bundle
+# Skip updating dependencies (echarts, zrender, echarts-gl, etc.)
+node e2e/main.js --skip npm --local
+# Skip rendering and comparing (via puppeteer)
+node e2e/main.js --skip render,compare --local
+# Skip bundling (by webpack/esbuild)
+node e2e/main.js --skip bundle --local
```
-Specify matched tests.
-
+Run a single test:
```shell
-node e2e/main.js --skip npm --tests bar3D*
+node e2e/main.js --skip npm --local --tests bar3D*
+node e2e/main.js --skip npm --local --tests line3d-orthographic
```
+
## Release
Update echarts version in `package.json` to the latest version, and then
diff --git a/e2e/main.js b/e2e/main.js
index 4d9b89ef..17bc6757 100644
--- a/e2e/main.js
+++ b/e2e/main.js
@@ -299,12 +299,16 @@ async function buildRunCode() {
) {
const ROOT_PATH = `${baseUrl}/public`;
+ // Global variables used in test cases.
+ const CDN_PATH = 'https://echarts.apache.org/en/js/vendors/';
+
const fullCode = buildExampleCode(buildPrepareCode(true) + testCode, deps,
{
minimal: false,
ts: checkTs,
// Check if theme will break the minimal imports.
theme: TEST_THEME,
ROOT_PATH,
+ CDN_PATH,
extraImports
});
const minimalCode = buildExampleCode(
@@ -315,6 +319,7 @@ async function buildRunCode() {
ts: checkTs,
theme: TEST_THEME,
ROOT_PATH,
+ CDN_PATH,
extraImports
}
);
@@ -327,6 +332,7 @@ async function buildRunCode() {
ts: false,
theme: TEST_THEME,
ROOT_PATH,
+ CDN_PATH,
extraImports: extraRequire
}
);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]