@iobroker/legacy-testing 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/guiHelper.js +16 -5
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -14,7 +14,10 @@ Set process.env.JS_CONTROLLER_VERSION to version e.g. `5.0.5-alpha.0-20230617-46
|
|
|
14
14
|
|
|
15
15
|
## Changelog
|
|
16
16
|
<!-- ### **WORK IN PROGRESS** -->
|
|
17
|
-
### 1.0.
|
|
17
|
+
### 1.0.4 (2023-12-15)
|
|
18
|
+
* (bluefox) Allowed GUI tests for tab_m.html too
|
|
19
|
+
|
|
20
|
+
### 1.0.3 (2023-10-26)
|
|
18
21
|
* (bluefox) Added helper files to test react admin GUI
|
|
19
22
|
|
|
20
23
|
### 1.0.1 (2023-10-16)
|
package/guiHelper.js
CHANGED
|
@@ -9,11 +9,19 @@ const puppeteer = require('puppeteer');
|
|
|
9
9
|
const { blue, cyan, red, yellow } = require('colorette');
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
|
|
12
|
-
const rootDir = `${__dirname}/../`;
|
|
13
12
|
let gBrowser;
|
|
14
13
|
let gPage;
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
/* This function starts the browser and opens the desired adapter
|
|
16
|
+
* @param {string} adapterName - could be just an adapter name or adapter name with path, like 'device-manager/tab_m.html'
|
|
17
|
+
* @param {string} rootDir
|
|
18
|
+
* @param {boolean} headless
|
|
19
|
+
*/
|
|
20
|
+
async function startBrowser(adapterName, rootDir, headless) {
|
|
21
|
+
if (!rootDir.endsWith('/')) {
|
|
22
|
+
rootDir += '/';
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
const browser = await puppeteer.launch({
|
|
18
26
|
headless: headless === undefined ? false : headless,
|
|
19
27
|
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
|
@@ -47,7 +55,7 @@ async function startBrowser(adapterName, headless) {
|
|
|
47
55
|
})
|
|
48
56
|
.on('pageerror', ({ message }) => console.log(red(`[BROWSER] ${message}`)));
|
|
49
57
|
|
|
50
|
-
await gPage.goto(`http://127.0.0.1:8081/adapter/${adapterName}/index_m.html
|
|
58
|
+
await gPage.goto(`http://127.0.0.1:8081/adapter/${adapterName.includes('/') ? (!adapterName.includes('?') ? `${adapterName}?` : adapterName) : `${adapterName}/index_m.html?`}&newReact=true&0&react=dark`, { waitUntil: 'domcontentloaded' });
|
|
51
59
|
|
|
52
60
|
// Create directory
|
|
53
61
|
!fs.existsSync(`${rootDir}tmp/screenshots`) && fs.mkdirSync(`${rootDir}tmp/screenshots`);
|
|
@@ -61,7 +69,10 @@ async function stopBrowser(browser) {
|
|
|
61
69
|
await browser.close();
|
|
62
70
|
}
|
|
63
71
|
|
|
64
|
-
async function screenshot(page, fileName) {
|
|
72
|
+
async function screenshot(rootDir, page, fileName) {
|
|
73
|
+
if (!rootDir.endsWith('/')) {
|
|
74
|
+
rootDir += '/';
|
|
75
|
+
}
|
|
65
76
|
page = page || gPage;
|
|
66
77
|
await page.screenshot({ path: `${rootDir}tmp/screenshots/${fileName}.png` });
|
|
67
78
|
}
|
|
@@ -70,4 +81,4 @@ module.exports = {
|
|
|
70
81
|
startBrowser,
|
|
71
82
|
stopBrowser,
|
|
72
83
|
screenshot
|
|
73
|
-
};
|
|
84
|
+
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.4",
|
|
3
3
|
"name": "@iobroker/legacy-testing",
|
|
4
4
|
"main": "setup.js",
|
|
5
5
|
"files": [
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"chai": "^4.3.10"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@alcalzone/release-script": "^3.
|
|
34
|
-
"@alcalzone/release-script-plugin-license": "^3.
|
|
33
|
+
"@alcalzone/release-script": "^3.7.0",
|
|
34
|
+
"@alcalzone/release-script-plugin-license": "^3.7.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"release": "release-script",
|
|
38
38
|
"release-patch": "release-script patch --yes",
|
|
39
39
|
"release-minor": "release-script minor --yes",
|
|
40
|
-
"release-major": "release-script major --yes"
|
|
40
|
+
"release-major": "release-script major --yes",
|
|
41
|
+
"update-packages": "ncu --upgrade"
|
|
41
42
|
}
|
|
42
43
|
}
|