release: prepare v0.1.5 verified account-free snapshot
release / linux-x64 (push) Failing after 59s
ci / linux-x64 (push) Failing after 1m9s
ci / linux-arm64-cross (push) Failing after 4m15s
release / linux-arm64 (push) Successful in 4m36s
release / appimage-startup (push) Skipped
release / publish (push) Skipped

This commit is contained in:
omar committed 2026-11-02 10:50:54 +03:00
1 parent 8336f01be7
commit c75c8f3d74
39 files changed
+565 -2374

No files matched your search

@@ -0,0 +1,115 @@
// Notification advanced options through the real settings page, preference bridge and warning popup in the
// hidden, nonfocusable, muted offscreen window (launchApp). Disposable profile; no server, no device capture,
// no native dialog, no OS input and no Listen click, so no sound is requested.
import assert from 'node:assert/strict';
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { tmpdir } from 'node:os';
import { launchApp, waitForAsync } from './lib/electron-app.mjs';
const args = process.argv.slice(2);
const option = key => args.includes(`--${key}`) ? args[args.indexOf(`--${key}`) + 1] : undefined;
const profile = mkdtempSync(path.join(tmpdir(), 'teamspeach-notification-advanced-qa-'));
const out = path.resolve(option('out') ?? 'smoke-out/notification-advanced');
mkdirSync(out, { recursive: true });
const result = { checks: [], errors: [], scope: 'Row context menu, Show/Hide Advanced with cancel and confirm, persisted overrides; no Listen click or audible output' };
let app, page;
const states = () => waitForAsync(page, async () => (await window.teamspeach.getPrefs()).notificationStates);
const statesMatch = (expected) => waitForAsync(page, async (want) => {
const got = (await window.teamspeach.getPrefs()).notificationStates;
return Object.entries(want).every(([key, value]) => got[key] === value);
}, expected);
const openNotifications = async () => {
await page.click('#btn-settings');
await page.click('#settings-nav [data-panel="notifications"]');
await page.waitForSelector('[data-notification-group="connection"] [data-setting="disconnected"]');
};
try {
app = await launchApp({ profile, exe: option('exe') });
page = await app.firstWindow();
page.on('pageerror', error => result.errors.push(error.message));
await page.waitForSelector('#view-onboarding', { state: 'visible' });
await page.fill('#onboarding-nick', 'Notification Advanced QA');
await page.click('#onboarding-submit');
await page.waitForSelector('#view-app', { state: 'visible' });
await openNotifications();
const sound = page.locator('#settings-notifications-events > section').first();
assert.equal(await sound.locator('.ts-card-setting-container').count(), 2, 'Sound Notifications holds only the device and volume settings');
assert.deepEqual(await sound.locator('#notification-device option').evaluateAll(nodes => nodes.slice(0, 3).map(node => node.value)), ['voice', '', 'none']);
assert.equal(await page.locator('#settings-notifications-events details').count(), 0, 'no always-visible advanced summaries');
result.checks.push('Sound section has no empty status container; options follow audio-device-selector order; no <details> rows');
const group = page.locator('[data-notification-group="connection"]');
const row = group.locator('[data-setting="disconnected"]');
await row.locator('.tsv-text-truncate').click({ button: 'right' });
const menu = page.locator('.notification-row-menu');
await menu.waitFor();
assert.equal(await menu.getByRole('menuitem').getAttribute('aria-disabled'), null);
await page.keyboard.press('Escape');
await menu.waitFor({ state: 'detached' });
assert.equal(await group.locator('[data-event]').count(), 0);
result.checks.push('Context menu opens on the coalesced row and Escape closes it without changes');
await row.locator('.tsv-text-truncate').click({ button: 'right' });
await menu.getByRole('menuitem').click();
await statesMatch({ advanced_disconnected: 1 });
await group.locator('[data-event="connection_lost"]').waitFor();
assert.equal(await row.locator('[role="radio"]').count(), 0, 'coalesced control replaced while advanced');
assert.equal(await row.locator('.tsv-notifications-content-item-disabled').count(), 1);
assert.equal(await row.locator('.ts-notifications-content-item-subtitle').count(), 1);
assert.deepEqual(await group.locator('[data-event]').evaluateAll(nodes => nodes.map(node => node.dataset.event)), ['disconnected', 'connection_lost']);
result.checks.push('Show Advanced persists, disables the coalesced row and lists its event rows');
await group.locator('[data-event="connection_lost"] [role="radio"]').nth(0).click();
await statesMatch({ event_disconnected_connection_lost: 0 });
await group.locator('[data-event="connection_lost"] .tsv-text-truncate').click({ button: 'right' });
await menu.waitFor();
assert.equal(await menu.getByRole('menuitem').getAttribute('aria-disabled'), 'true');
await page.keyboard.press('Escape');
await menu.waitFor({ state: 'detached' });
result.checks.push('Event rows save their own state; their menu offers only the disabled No Actions entry');
const dialog = page.locator('dialog.warning-dialog');
await row.locator('.tsv-bar-item button').click();
await dialog.waitFor();
await dialog.locator('.tsv-user-input-dialog-cancel').click();
await dialog.waitFor({ state: 'detached' });
assert.deepEqual(await states().then(s => [s.advanced_disconnected, s.event_disconnected_connection_lost]), [1, 0]);
assert.equal(await group.locator('[data-event="connection_lost"] [role="radio"]').nth(0).getAttribute('aria-checked'), 'true');
result.checks.push('Hide Advanced cancel keeps the section and its event override');
await row.locator('.tsv-bar-item button').click();
await dialog.waitFor();
await dialog.locator('.tsv-user-input-dialog-confirm').click();
await statesMatch({ advanced_disconnected: 0, event_disconnected_connection_lost: 0 });
await group.locator('[data-event]').first().waitFor({ state: 'detached' });
assert.equal(await row.locator('[role="radio"]').count(), 3);
const inactive = await page.evaluate(async () => {
const n = await import('./js/notifications.js');
return [n.isAdvanced('disconnected'), n.eventState('disconnected', 'connection_lost') === n.settingState('disconnected')];
});
assert.deepEqual(inactive, [false, true]);
result.checks.push('Confirmed hide deactivates the stored override without deleting it');
await row.locator('.tsv-text-truncate').click({ button: 'right' });
await menu.getByRole('menuitem').click();
await statesMatch({ advanced_disconnected: 1 });
await group.locator('[data-event="connection_lost"]').waitFor();
assert.equal(await group.locator('[data-event="connection_lost"] [role="radio"]').nth(0).getAttribute('aria-checked'), 'true');
await page.screenshot({ path: path.join(out, 'advanced-restored.png') });
result.checks.push('Show Advanced again restores the saved event choice');
const single = page.locator('[data-setting="connected"]');
await single.locator('.tsv-text-truncate').click({ button: 'right' });
await menu.getByRole('menuitem').click();
await statesMatch({ advanced_connected: 1 });
await page.locator('[data-event="connected"]').waitFor();
await page.locator('[data-event="connected"] [role="radio"]').nth(2).click();
await statesMatch({ event_connected_connected: 2 });
assert.equal(await page.evaluate(async () => (await import('./js/notifications.js')).eventState('connected', 'connected')), 2);
result.checks.push('Single-event settings also expose real advanced controls and persist their independent choice');
assert.deepEqual(result.errors, []);
result.ok = true;
} catch (error) { result.ok = false; result.error = error.stack; process.exitCode = 1; if (page) await page.screenshot({ path: path.join(out, 'failure.png') }).catch(() => {}); }
finally { if (app) await app.close(); rmSync(profile, { recursive: true, force: true }); writeFileSync(path.join(out, 'result.json'), JSON.stringify(result, null, 2)); console.log(JSON.stringify(result, null, 2)); }
-2
View File
@@ -49,8 +49,6 @@ try {
const listGroup = page.locator('#keybind-settings .ts-keybinds-hotkeys-group').nth(7); // Whisper to List
await listGroup.locator('select').selectOption(uuid);
await listGroup.locator('.ts-keybinds-hotkeys-entry-unset button').click({ force: true });
const systemShortcut = page.locator('.keybind-menu .menu-item').first();
if (await systemShortcut.count()) await systemShortcut.click();
await page.keyboard.down('F9'); await page.keyboard.up('F9');
await waitForAsync(page, async () => (await window.teamspeach.getKeybinds()).profiles[0]?.bindings.length === 1);
await page.locator('#keybind-settings .ts-keybinds-scope').click(); // Global → In this window