mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 10:17:23 -05:00
Splitting integration tests (#2296)
This commit is contained in:
committed by
GitHub
parent
46239caa19
commit
edbac13713
@@ -47,7 +47,7 @@
|
||||
"build:3rd-party": "node rollup/3rd-party.cjs",
|
||||
"build:tests-index": "node rollup/build_test_index.cjs",
|
||||
"clean:3rd-party": "rm src/3rd-party/*.js && rm src/3rd-party/*.css",
|
||||
"test:integration": "npm run test:ws; static-handler --coi . 2>/dev/null & SH_PID=$!; EXIT_CODE=0; playwright test tests/js_tests.spec.js tests/py_tests.spec.js || EXIT_CODE=$?; kill $SH_PID 2>/dev/null; exit $EXIT_CODE",
|
||||
"test:integration": "npm run test:ws; static-handler --coi . 2>/dev/null & SH_PID=$!; EXIT_CODE=0; (playwright test tests/js_tests.spec.js && playwright test tests/py_tests.main.spec.js && playwright test tests/py_tests.worker.spec.js) || EXIT_CODE=$?; kill $SH_PID 2>/dev/null; exit $EXIT_CODE",
|
||||
"test:ws": "bun tests/javascript/ws/index.js & playwright test tests/javascript/ws/index.spec.js",
|
||||
"dev": "node dev.cjs",
|
||||
"release": "npm run build && npm run zip",
|
||||
|
||||
File diff suppressed because one or more lines are too long
19
core/tests/py_tests.main.spec.js
Normal file
19
core/tests/py_tests.main.spec.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.setTimeout(30 * 1000);
|
||||
|
||||
test('Python unit tests - MicroPython on MAIN thread', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/python/index.html');
|
||||
const result = page.locator("#result"); // Payload for results will be here.
|
||||
await result.waitFor(); // wait for the result.
|
||||
const data = JSON.parse(await result.textContent()); // get the result data.
|
||||
await expect(data.fails).toMatchObject([]); // ensure no test failed.
|
||||
});
|
||||
|
||||
test('Python unit tests - Pyodide on MAIN thread', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/python/index.html?type=py');
|
||||
const result = page.locator("#result"); // Payload for results will be here.
|
||||
await result.waitFor(); // wait for the result.
|
||||
const data = JSON.parse(await result.textContent()); // get the result data.
|
||||
await expect(data.fails).toMatchObject([]); // ensure no test failed.
|
||||
});
|
||||
@@ -2,22 +2,6 @@ import { test, expect } from '@playwright/test';
|
||||
|
||||
test.setTimeout(120 * 1000);
|
||||
|
||||
test('Python unit tests - MicroPython on MAIN thread', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/python/index.html');
|
||||
const result = page.locator("#result"); // Payload for results will be here.
|
||||
await result.waitFor(); // wait for the result.
|
||||
const data = JSON.parse(await result.textContent()); // get the result data.
|
||||
await expect(data.fails).toMatchObject([]); // ensure no test failed.
|
||||
});
|
||||
|
||||
test('Python unit tests - Pyodide on MAIN thread', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/python/index.html?type=py');
|
||||
const result = page.locator("#result"); // Payload for results will be here.
|
||||
await result.waitFor(); // wait for the result.
|
||||
const data = JSON.parse(await result.textContent()); // get the result data.
|
||||
await expect(data.fails).toMatchObject([]); // ensure no test failed.
|
||||
});
|
||||
|
||||
test('Python unit tests - MicroPython on WORKER', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/python/index.html?worker');
|
||||
const result = page.locator("#result"); // Payload for results will be here.
|
||||
Reference in New Issue
Block a user