mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-11 11:13:04 +02:00
Rework more coverage in e2e tests and don't force radio restart + better startup error handling
This commit is contained in:
@@ -9,8 +9,15 @@
|
||||
* When a @mesh-traffic-tagged test fails, an advisory annotation is added
|
||||
* to the HTML report and a console message is printed, letting the user
|
||||
* know the failure may be due to low mesh traffic rather than a real bug.
|
||||
*
|
||||
* Call `await nudgeEchoBot()` at the start of any @mesh-traffic test to
|
||||
* send a trigger message to an echo bot on #flightless. If the bot is in
|
||||
* radio range it will generate an incoming packet, potentially saving the
|
||||
* full 3-minute wait. The nudge is best-effort — tests still rely on the
|
||||
* long polling timeout for environments without the bot.
|
||||
*/
|
||||
import { test as base, expect } from '@playwright/test';
|
||||
import { ensureFlightlessChannel, sendChannelMessage } from './api';
|
||||
|
||||
export { expect };
|
||||
|
||||
@@ -18,6 +25,21 @@ const TRAFFIC_ADVISORY =
|
||||
'This test depends on receiving messages from other nodes on the mesh ' +
|
||||
'network. Failure may indicate insufficient mesh traffic rather than a bug.';
|
||||
|
||||
/**
|
||||
* Best-effort: send a message to #flightless that triggers a remote echo
|
||||
* bot. If the bot is within radio range it will reply, generating the
|
||||
* incoming traffic the test needs. Failures are silently ignored — the
|
||||
* test will fall back to waiting for organic mesh traffic.
|
||||
*/
|
||||
export async function nudgeEchoBot(): Promise<void> {
|
||||
try {
|
||||
const channel = await ensureFlightlessChannel();
|
||||
await sendChannelMessage(channel.key, '!echo please give incoming message');
|
||||
} catch {
|
||||
// Best-effort — bot may not be reachable
|
||||
}
|
||||
}
|
||||
|
||||
export const test = base.extend<{ _meshTrafficAdvisory: void }>({
|
||||
_meshTrafficAdvisory: [
|
||||
async ({}, use, testInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user