Skip to content

Commit dd8bc8f

Browse files
committed
integration test: fix video recorder
1 parent 7d90c78 commit dd8bc8f

File tree

9 files changed

+221
-247
lines changed

9 files changed

+221
-247
lines changed

test/integration/man.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ try {
2828
.argv;
2929

3030
let manual = new Manual(argv.configs, argv.port);
31-
manual.runManual();
31+
manual.run();
3232
} catch (err) {
3333
process.exitCode = 1;
3434
console.error(err);

test/integration/modules/browser/browsers-chrome.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
const path = require("path");
2+
const fs = require("fs");
3+
14
const Chrome = require("../../modules/browser/chrome.js");
25

36

@@ -45,7 +48,7 @@ class BrowsersChrome {
4548
this.#browsers.forEach((browser, index) => {
4649
if (browser) {
4750
let browserLogReady = new Promise(resolve => { resolve() });
48-
if (!this.#browsersLogPath) {
51+
if (this.#browsersLogPath) {
4952
browserLogReady = new Promise((resolve, reject) => {
5053
fs.mkdir(this.#browsersLogPath, { recursive: true, force: true }, err => {
5154
if (err) {

test/integration/modules/integration-test/test-suite.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ class TestSuite {
158158
this.#testCasesConfig = testCasesConfig;
159159
testCasesConfig.suites.forEach(suite => {
160160
this.#cnsl.log("[ " + "T.CONFIG".padEnd(this.#cnsl.getTestStatusPad(), " ") + " ]" + " " + "[ " + suite.config + " ]");
161-
});
162-
testCasesConfig.suites.forEach(suite => {
163161
this.#cnsl.log("[ " + "T.CASES".padEnd(this.#cnsl.getTestStatusPad(), " ") + " ]" + " " + "[ " + suite.suite + " ]");
164162
});
165163
});

test/integration/modules/manual/manual.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Manual {
2727
}
2828

2929

30-
runManual() {
30+
run() {
3131
this.#workspaceHost = new WorkspaceHost(TestEnv.getWorkspacePath(), this.#workspaceHostServerPort);
3232
this.#workspaceHostReady = this.#workspaceHost.serverPortReady();
3333
this.#workspaceHostReady.then(() => {

test/integration/modules/videorecorder/index.html renamed to test/integration/modules/videorecorder/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>VizzuTest</title>
4+
<title>Recording....</title>
55
<meta charset="utf-8"/>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
</head>

test/integration/modules/videorecorder/index.js renamed to test/integration/modules/videorecorder/client/index.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,30 @@ function catchError(err) {
77
if (err.stack !== undefined) {
88
errMsg = err.stack;
99
}
10-
window.data = { result: 'ERROR', description: errMsg };
10+
window.result = { result: "ERROR", description: errMsg };
11+
document.title = "Finished";
1112
}
1213

1314

1415
try {
1516
let queryString = window.location.search;
1617
let urlParams = new URLSearchParams(queryString);
17-
let testCase = urlParams.get('testCase');
18-
let vizzuUrl = urlParams.get('vizzuUrl');
18+
let testSuitePath = urlParams.get("testSuitePath");
19+
let testCasesPath = urlParams.get("testCasesPath");
20+
let testCase = urlParams.get("testCase");
21+
let vizzuUrl = urlParams.get("vizzuUrl");
1922

2023
import(vizzuUrl).then(vizzuModule => {
2124
var Vizzu = vizzuModule.default;
22-
return import('/test/integration/test_cases/' + testCase + '.mjs').then((testCasesModule) => {
23-
let chart = new Vizzu('vizzuCanvas');
24-
let videoRecorder = new VideoRecorder('vizzuCanvas', (data) => {
25-
let a = document.createElement('a')
26-
a.setAttribute('href', data)
27-
a.setAttribute('download', testCase + '.webm')
25+
return import(testSuitePath + "/" + testCasesPath + "/" + testCase + ".mjs").then((testCasesModule) => {
26+
let chart = new Vizzu("vizzuCanvas");
27+
let videoRecorder = new VideoRecorder("vizzuCanvas", (data) => {
28+
let a = document.createElement("a")
29+
a.setAttribute("href", data)
30+
a.setAttribute("download", testCasesPath.replace("/", "__") + "__" + testCase + ".webm")
2831
a.click()
29-
window.data = { result: 'DONE' };
32+
window.result = { result: "OK" };
33+
document.title = "Finished";
3034
});
3135
let steps = [];
3236
let snapshots = [];

test/integration/modules/videorecorder/videorecorder.js renamed to test/integration/modules/videorecorder/client/videorecorder.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use strict";
2-
31
export class VideoRecorder
42
{
53
constructor(canvasName, callback)

0 commit comments

Comments
 (0)