@@ -176,53 +176,9 @@ describe('MQTT Explorer UI Tests', function () {
176176 await page . screenshot ( { path : 'test-screenshot-root-topics.png' } )
177177 } )
178178
179- it ( 'Given a JSON message with nested properties, the tree should display the JSON structure' , async function ( ) {
180- // Given: coffee_maker publishes JSON with heater, temperature, waterLevel
181- await sleep ( 2000 )
182-
183- // Ensure no search filter is active
184- await clearSearch ( page )
185- await sleep ( 500 )
186-
187- // When: Navigate to kitchen/coffee_maker
188- await expandTopic ( 'kitchen/coffee_maker' , page )
189- await sleep ( 1000 )
190-
191- // Then: The JSON properties should be visible in the value preview
192- // We can verify by checking that the topic is selected and showing details
193- const selectedTopic = await page . locator ( '[class*="selectedTopic"]' )
194- const hasSelectedTopic = ( await selectedTopic . count ( ) ) > 0
195-
196- expect ( hasSelectedTopic ) . to . be . true
197-
198- await page . screenshot ( { path : 'test-screenshot-json-structure.png' } )
199- } )
200179 } )
201180
202181 describe ( 'Topic Navigation and Search' , ( ) => {
203- it ( 'should display topic hierarchy after connection' , async function ( ) {
204- // Given: Application is connected to MQTT broker
205- // Ensure clean state
206- await clearSearch ( page )
207- await sleep ( 500 )
208-
209- // Click on Value tab to ensure we're not in History view
210- const valueTab = await page . locator ( '//span[contains(text(), "Value")]' ) . first ( )
211- try {
212- await valueTab . click ( { timeout : 2000 } )
213- await sleep ( 300 )
214- } catch {
215- // Ignore if not found or can't click
216- }
217-
218- // Then: Topic tree should contain nodes
219- const treeNodes = await page . locator ( '[class*="TreeNode"]' )
220- const count = await treeNodes . count ( )
221- expect ( count ) . to . be . greaterThan ( 0 , 'Topic tree should contain nodes' )
222-
223- await page . screenshot ( { path : 'test-screenshot-topic-tree.png' } )
224- } )
225-
226182 it ( 'should search and filter topics containing "temp"' , async function ( ) {
227183 // Given: Multiple topics with "temp" in their path (kitchen/temperature, livingroom/temperature)
228184 // When: User searches for "temp"
@@ -333,52 +289,9 @@ describe('MQTT Explorer UI Tests', function () {
333289 await sleep ( 500 )
334290 } )
335291
336- it ( 'should display message diffs when messages change' , async function ( ) {
337- // Given: Topics that update over time (livingroom/temperature)
338- // When: User enables diff view
339- await showOffDiffCapability ( page )
340- await sleep ( 1500 )
341-
342- // Then: Diff view should be active
343- await page . screenshot ( { path : 'test-screenshot-diffs.png' } )
344- } )
345-
346- it ( 'Given a message with QoS 2, should display the QoS level' , async function ( ) {
347- // Given: kitchen/coffee_maker is published with QoS 2
348- await sleep ( 1000 )
349-
350- // Ensure no search filter is active
351- await clearSearch ( page )
352- await sleep ( 500 )
353-
354- // When: Navigate to the topic
355- await expandTopic ( 'kitchen/coffee_maker' , page )
356- await sleep ( 1000 )
357-
358- // Then: QoS indicator should be visible
359- // (Verified via screenshot showing message details)
360- await page . screenshot ( { path : 'test-screenshot-qos.png' } )
361- } )
362292 } )
363293
364294 describe ( 'Clipboard Operations' , ( ) => {
365- it ( 'should copy topic path to clipboard' , async function ( ) {
366- // Given: A topic is selected
367- // Ensure no search filter is active and select a topic
368- await clearSearch ( page )
369- await sleep ( 500 )
370- await expandTopic ( 'kitchen/coffee_maker' , page )
371- await sleep ( 500 )
372-
373- // When: User clicks copy topic button
374- await copyTopicToClipboard ( page )
375- await sleep ( 500 )
376-
377- // Then: Copy action completes without error
378- // Note: Full clipboard verification requires additional platform-specific setup
379- await page . screenshot ( { path : 'test-screenshot-copy-topic.png' } )
380- } )
381-
382295 it ( 'should copy message value to clipboard' , async function ( ) {
383296 // Given: A topic with a value is selected
384297 // Ensure no search filter is active and select a topic
@@ -409,26 +322,6 @@ describe('MQTT Explorer UI Tests', function () {
409322 } )
410323
411324 describe ( 'Settings and Configuration' , ( ) => {
412- it ( 'should open and display settings menu with available options' , async function ( ) {
413- // When: User opens settings menu
414- const menuButton = await page . locator ( '//button[contains(@aria-label, "Menu")]' ) . first ( )
415- await menuButton . waitFor ( { state : 'visible' , timeout : 5000 } )
416- await menuButton . click ( )
417- await sleep ( 1000 ) // Give menu time to open
418-
419- // Then: Settings menu should be visible
420- const settingsMenu = await page . locator ( '[role="menu"]' ) . first ( )
421- await settingsMenu . waitFor ( { state : 'visible' , timeout : 5000 } )
422- const menuVisible = await settingsMenu . isVisible ( )
423- expect ( menuVisible ) . to . be . true
424-
425- await page . screenshot ( { path : 'test-screenshot-settings.png' } )
426-
427- // Cleanup: Close the menu by clicking outside or pressing Escape
428- await page . keyboard . press ( 'Escape' )
429- await sleep ( 300 )
430- } )
431-
432325 it ( 'should show advanced connection settings with subscription options' , async function ( ) {
433326 // Given: User is on connection page
434327 // First disconnect
@@ -493,115 +386,7 @@ describe('MQTT Explorer UI Tests', function () {
493386 } )
494387 } )
495388
496- describe ( 'Message History and Updates' , ( ) => {
497- it ( 'Given topics with updating values, should display message history' , async function ( ) {
498- // Given: Topics that update over time (livingroom/temperature)
499- await sleep ( 3000 ) // Wait for several updates
500-
501- // Ensure no search filter is active
502- await clearSearch ( page )
503- await sleep ( 500 )
504-
505- // When: Navigate to a topic with history
506- await expandTopic ( 'livingroom/temperature' , page )
507- await sleep ( 1000 )
508-
509- // Then: History should be available
510- // Click on History tab if visible (use .first() as there might be multiple History tabs)
511- const historyTab = await page . locator ( '//span[contains(text(), "History")]' ) . first ( )
512- const historyExists = ( await historyTab . count ( ) ) > 0
513-
514- if ( historyExists ) {
515- await historyTab . click ( )
516- await sleep ( 500 )
517- await page . screenshot ( { path : 'test-screenshot-history.png' } )
518-
519- // Cleanup: Click back to Value tab
520- const valueTab = await page . locator ( '//span[contains(text(), "Value")]' ) . first ( )
521- try {
522- await valueTab . click ( { timeout : 2000 } )
523- await sleep ( 300 )
524- } catch {
525- // Ignore if clicking fails
526- }
527- }
528-
529- // Final cleanup
530- await clearSearch ( page )
531- await sleep ( 300 )
532- } )
533-
534- it ( 'Given a topic with changing values, should show value updates in real-time' , async function ( ) {
535- // Given: kitchen/coffee_maker/temperature updates periodically
536- await sleep ( 1000 )
537-
538- // Ensure no search filter is active
539- await clearSearch ( page )
540- await sleep ( 500 )
541-
542- // When: Navigate to the topic
543- await expandTopic ( 'kitchen/coffee_maker' , page )
544- await sleep ( 500 )
545-
546- // Then: Topic should be selected and showing current value
547- const selectedTopic = await page . locator ( '[class*="selectedTopic"]' )
548- expect ( ( await selectedTopic . count ( ) ) > 0 ) . to . be . true
549-
550- // Wait for value to update
551- await sleep ( 2000 )
552-
553- await page . screenshot ( { path : 'test-screenshot-updating-value.png' } )
554- } )
555- } )
556-
557- describe ( 'Different QoS Levels' , ( ) => {
558- it ( 'Given messages with different QoS levels (0, 1, 2), should display them correctly' , async function ( ) {
559- // Given: Mock publishes messages with different QoS
560- // QoS 0: livingroom/lamp/state
561- // QoS 2: kitchen/coffee_maker
562- await sleep ( 1000 )
563-
564- // Ensure no search filter is active
565- await clearSearch ( page )
566- await sleep ( 500 )
567-
568- // When: Navigate to QoS 0 topic
569- await expandTopic ( 'livingroom/lamp/state' , page )
570- await sleep ( 500 )
571-
572- await page . screenshot ( { path : 'test-screenshot-qos-0.png' } )
573-
574- // When: Navigate to QoS 2 topic
575- await expandTopic ( 'kitchen/coffee_maker' , page )
576- await sleep ( 500 )
577-
578- // Then: Both should display their QoS levels
579- await page . screenshot ( { path : 'test-screenshot-qos-2.png' } )
580- } )
581- } )
582-
583389 describe ( 'Special Topic Names and Characters' , ( ) => {
584- it ( 'Given topics with spaces and special characters, should display correctly' , async function ( ) {
585- // Given: Mock publishes to "test 123" and "hello"
586- await sleep ( 2000 ) // Wait for topic to be published
587-
588- // Ensure no search filter is active
589- await clearSearch ( page )
590- await sleep ( 500 )
591-
592- // When: Navigate to topic with space
593- const testTopic = await page . locator ( 'span[data-test-topic="test 123"]' ) . first ( )
594- await testTopic . waitFor ( { state : 'visible' , timeout : 10000 } )
595-
596- // Then: Topic should be visible
597- expect ( await testTopic . isVisible ( ) ) . to . be . true
598-
599- await testTopic . click ( )
600- await sleep ( 500 )
601-
602- await page . screenshot ( { path : 'test-screenshot-special-chars.png' } )
603- } )
604-
605390 it ( 'Given topic with MAC address format (01-80-C2-00-00-0F/LWT), should display correctly' , async function ( ) {
606391 // Given: Mock publishes to MAC address topic
607392 await sleep ( 1000 )
@@ -621,64 +406,6 @@ describe('MQTT Explorer UI Tests', function () {
621406 } )
622407 } )
623408
624- describe ( 'Bridge Status Topics' , ( ) => {
625- it ( 'Given bridge status topics (zigbee2mqtt, ble2mqtt), should display online status' , async function ( ) {
626- // Given: Mock publishes bridge status topics
627- await sleep ( 2000 )
628-
629- // Ensure no search filter is active
630- await clearSearch ( page )
631- await sleep ( 500 )
632-
633- // When: Navigate to zigbee2mqtt bridge
634- const zigbeeTopic = await page . locator ( 'span[data-test-topic="zigbee2mqtt"]' ) . first ( )
635- await zigbeeTopic . waitFor ( { state : 'visible' , timeout : 10000 } )
636- expect ( await zigbeeTopic . isVisible ( ) ) . to . be . true
637-
638- await zigbeeTopic . click ( )
639- await sleep ( 500 )
640-
641- const bridgeTopic = await page . locator ( 'span[data-test-topic="bridge"]' ) . first ( )
642- await bridgeTopic . waitFor ( { state : 'visible' , timeout : 5000 } )
643- await bridgeTopic . click ( )
644- await sleep ( 500 )
645-
646- // Then: State topic should show "online"
647- await page . screenshot ( { path : 'test-screenshot-bridge-status.png' } )
648- } )
649- } )
650-
651- describe ( '3D Printer Integration' , ( ) => {
652- it ( 'Given 3D printer temperature topics with JSON data, should display bed and tool temperatures' , async function ( ) {
653- // Given: Mock publishes 3D printer data every 3333ms
654- await sleep ( 4000 ) // Wait for first publish
655-
656- // Ensure no search filter is active
657- await clearSearch ( page )
658- await sleep ( 500 )
659-
660- // When: Navigate to 3D printer topics
661- const printerTopic = await page . locator ( 'span[data-test-topic="3d-printer"]' ) . first ( )
662- await printerTopic . waitFor ( { state : 'visible' , timeout : 10000 } )
663- expect ( await printerTopic . isVisible ( ) ) . to . be . true
664-
665- await printerTopic . click ( )
666- await sleep ( 500 )
667-
668- const octoPrintTopic = await page . locator ( 'span[data-test-topic="OctoPrint"]' )
669- await octoPrintTopic . waitFor ( { state : 'visible' , timeout : 5000 } )
670- await octoPrintTopic . click ( )
671- await sleep ( 500 )
672-
673- // Then: Temperature topics should be visible
674- const tempTopic = await page . locator ( 'span[data-test-topic="temperature"]' )
675- await tempTopic . waitFor ( { state : 'visible' , timeout : 5000 } )
676- expect ( await tempTopic . isVisible ( ) ) . to . be . true
677-
678- await page . screenshot ( { path : 'test-screenshot-3d-printer.png' } )
679- } )
680- } )
681-
682409 describe ( 'Garden/IoT Device Topics' , ( ) => {
683410 it ( 'Given garden device topics (pump, water level, lamps), should display all device states' , async function ( ) {
684411 // Given: Mock publishes garden device topics
@@ -706,36 +433,6 @@ describe('MQTT Explorer UI Tests', function () {
706433 } )
707434 } )
708435
709- describe ( 'Topic Value Types' , ( ) => {
710- it ( 'Given topics with different value types (string, number, percentage), should display correctly' , async function ( ) {
711- // Given: Various value types in mock data
712- await sleep ( 1000 )
713-
714- // Ensure no search filter is active
715- await clearSearch ( page )
716- await sleep ( 500 )
717-
718- // When: Check string value (garden/pump/state = "off")
719- await expandTopic ( 'garden/pump/state' , page )
720- await sleep ( 500 )
721-
722- await page . screenshot ( { path : 'test-screenshot-string-value.png' } )
723-
724- // When: Check percentage value (garden/water/level = "70%")
725- await expandTopic ( 'garden/water/level' , page )
726- await sleep ( 500 )
727-
728- await page . screenshot ( { path : 'test-screenshot-percentage-value.png' } )
729-
730- // When: Check numeric value with units (livingroom/thermostat/targetTemperature = "20°C")
731- await expandTopic ( 'livingroom/thermostat/targetTemperature' , page )
732- await sleep ( 500 )
733-
734- // Then: All value types should display correctly
735- await page . screenshot ( { path : 'test-screenshot-temperature-value.png' } )
736- } )
737- } )
738-
739436 describe ( 'Multiple Lamp Devices' , ( ) => {
740437 it ( 'Given multiple lamp devices (lamp-1, lamp-2) with same properties, should distinguish them' , async function ( ) {
741438 // Given: Mock publishes to livingroom/lamp-1 and lamp-2
0 commit comments