@@ -112,7 +112,7 @@ export const startTutorial = (
112
112
function handleMouseUp ( event : { target : any } ) {
113
113
const target = event . target ;
114
114
const validConnectionPoint = document . querySelector (
115
- '[data-id="custom-node-2"] [data-handlepos="left "]' ,
115
+ '[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target "]' ,
116
116
) ;
117
117
118
118
if ( validConnectionPoint && ! validConnectionPoint . contains ( target ) ) {
@@ -394,7 +394,7 @@ export const startTutorial = (
394
394
id : "copy-paste-block" ,
395
395
title : "Copy and Paste the Block" ,
396
396
text : "Let’s duplicate this block. Click and hold the block with your mouse, then press Ctrl+C (Cmd+C on Mac) to copy and Ctrl+V (Cmd+V on Mac) to paste." ,
397
- attachTo : { element : '[data-id ^="custom-node -"]' , on : "top" } ,
397
+ attachTo : { element : '[data-testid ^="rf__node -"]' , on : "top" } ,
398
398
buttons : [
399
399
{
400
400
text : "Back" ,
@@ -404,7 +404,7 @@ export const startTutorial = (
404
404
when : {
405
405
show : ( ) => {
406
406
fitViewToScreen ( ) ;
407
- waitForElement ( '[data-id="custom-node-2"] ' ) . then ( ( ) => {
407
+ waitForElement ( '[data-testid^="rf__node-"]:nth-child(2) ' ) . then ( ( ) => {
408
408
tour . next ( ) ;
409
409
} ) ;
410
410
} ,
@@ -415,9 +415,9 @@ export const startTutorial = (
415
415
id : "focus-second-block" ,
416
416
title : "Focus on the New Block" ,
417
417
text : "This is your copied Calculator Block. Now, let’s move it to the side of the first block." ,
418
- attachTo : { element : ` [data-id ^="custom-node-"][data-id$="2"]` , on : "top" } ,
418
+ attachTo : { element : ' [data-testid ^="rf__node-"]:nth-child(2)' , on : "top" } ,
419
419
beforeShowPromise : ( ) =>
420
- waitForElement ( '[data-id ^="custom-node-"][data-id$="2"] ' ) ,
420
+ waitForElement ( '[data-testid ^="rf__node-"]:nth-child(2) ' ) ,
421
421
buttons : [
422
422
{
423
423
text : "Next" ,
@@ -432,7 +432,7 @@ export const startTutorial = (
432
432
text : "Now, let's connect the output of the first Calculator Block to the input of the second Calculator Block. Drag from the output pin of the first block to the input pin (A) of the second block." ,
433
433
attachTo : {
434
434
element :
435
- '[data-id ^="1 -"][data-id$="-result-source"]:not([data-id="1-2-result-source"]) ' ,
435
+ '[data-testid ^="rf__node -"]:first-child [data-id$="-result-source"]' ,
436
436
on : "bottom" ,
437
437
} ,
438
438
@@ -444,24 +444,24 @@ export const startTutorial = (
444
444
] ,
445
445
beforeShowPromise : ( ) => {
446
446
return waitForElement (
447
- '[data-id ^="1 -"][data-id$="-result-source"]:not([data-id="1-2-result-source"]) ' ,
448
- ) . then ( ( ) => { } ) ;
447
+ '[data-testid ^="rf__node -"]:first-child [data-id$="-result-source"]' ,
448
+ ) ;
449
449
} ,
450
450
when : {
451
451
show : ( ) => {
452
452
fitViewToScreen ( ) ;
453
453
resetConnectionState ( ) ; // Reset state when revisiting this step
454
454
tour . modal . show ( ) ;
455
455
const outputPin = document . querySelector (
456
- '[data-id ^="1 -"][data-id$="-result-source"]:not([data-id="1-2-result-source"]) ' ,
456
+ '[data-testid ^="rf__node -"]:first-child [data-id$="-result-source"]' ,
457
457
) ;
458
458
if ( outputPin ) {
459
459
outputPin . addEventListener ( "mousedown" , handleMouseDown ) ;
460
460
}
461
461
} ,
462
462
hide : ( ) => {
463
463
const outputPin = document . querySelector (
464
- '[data-id ^="1 -"][data-id$="-result-source"]:not([data-id="1-2-result-source"]) ' ,
464
+ '[data-testid ^="rf__node -"]:first-child [data-id$="-result-source"]' ,
465
465
) ;
466
466
if ( outputPin ) {
467
467
outputPin . removeEventListener ( "mousedown" , handleMouseDown ) ;
@@ -475,12 +475,14 @@ export const startTutorial = (
475
475
title : "Connect the Blocks: Input" ,
476
476
text : "Now, connect the output to the input pin of the second block (A)." ,
477
477
attachTo : {
478
- element : '[data-id="1-2 -a-target"]' ,
478
+ element : '[data-testid^="rf__node-"]:nth-child(2) [data-id$=" -a-target"]' ,
479
479
on : "top" ,
480
480
} ,
481
481
buttons : [ ] ,
482
482
beforeShowPromise : ( ) => {
483
- return waitForElement ( '[data-id="1-2-a-target"]' ) . then ( ( ) => {
483
+ return waitForElement (
484
+ '[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target"]' ,
485
+ ) . then ( ( ) => {
484
486
detectConnection ( ) ;
485
487
} ) ;
486
488
} ,
0 commit comments