@@ -302,7 +302,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
302
302
$ returnVariable = $ customActionAttributes ['returnVariable ' ];
303
303
}
304
304
305
- if (isset ($ customActionAttributes ['url ' ]) && isset ($ customActionAttributes ['userInput ' ])) {
305
+ if (isset ($ customActionAttributes ['variable ' ])) {
306
+ $ input = sprintf ("$%s " , $ customActionAttributes ['variable ' ]);
307
+ } elseif (isset ($ customActionAttributes ['url ' ]) && isset ($ customActionAttributes ['userInput ' ])) {
306
308
$ input = sprintf ("\"%s \"" , $ customActionAttributes ['userInput ' ]);
307
309
} elseif (isset ($ customActionAttributes ['userInput ' ])) {
308
310
$ input = sprintf ("\"%s \"" , $ customActionAttributes ['userInput ' ]);
@@ -354,6 +356,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
354
356
case "amOnUrl " :
355
357
$ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
356
358
break ;
359
+ case "appendField " :
360
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ input );
361
+ break ;
362
+ case "attachFile " :
363
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ input );
364
+ break ;
357
365
case "click " :
358
366
if ($ input && $ selector ) {
359
367
$ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ input , $ selector );
@@ -463,6 +471,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
463
471
case "dontSeeInFormFields " :
464
472
$ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ parameterArray );
465
473
break ;
474
+ case "dontSeeInTitle " :
475
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
476
+ break ;
477
+ case "dontSeeInPageSource " :
478
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
479
+ break ;
466
480
case "dontSeeInSource " :
467
481
// TODO: Solve the HTML parsing issue.
468
482
$ testSteps .= sprintf ("\t\t$%s->%s( \"%s \"); \n" , $ actor , $ actionName , $ html );
@@ -480,6 +494,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
480
494
$ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
481
495
}
482
496
break ;
497
+ case "dontSeeOptionIsSelected " :
498
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ input );
499
+ break ;
483
500
case "dragAndDrop " :
484
501
$ testSteps .= sprintf (
485
502
"\t\t$%s->%s( \"%s \", \"%s \"); \n" ,
@@ -503,7 +520,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
503
520
$ testSteps .= sprintf (
504
521
"\t\t$%s->%s(%s, \"%s \"); \n" ,
505
522
$ actor ,
506
- actionName,
523
+ $ actionName ,
507
524
$ input ,
508
525
$ customActionAttributes ['locale ' ]
509
526
);
@@ -512,58 +529,46 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
512
529
}
513
530
break ;
514
531
case "grabCookie " :
515
- if (isset ($ returnVariable )) {
516
- if (isset ($ parameterArray )) {
517
- $ testSteps .= sprintf (
518
- "\t\t$%s = $%s->%s(%s, %s); \n" ,
519
- $ returnVariable ,
520
- $ actor ,
521
- $ actionName ,
522
- $ input ,
523
- $ parameterArray
524
- );
525
- } else {
526
- $ testSteps .= sprintf (
527
- "\t\t$%s = $%s->%s(%s); \n" ,
528
- $ returnVariable ,
529
- $ actor ,
530
- $ actionName ,
531
- $ input
532
- );
533
- }
532
+ if (isset ($ parameterArray )) {
533
+ $ testSteps .= sprintf (
534
+ "\t\t$%s = $%s->%s(%s, %s); \n" ,
535
+ $ returnVariable ,
536
+ $ actor ,
537
+ $ actionName ,
538
+ $ input ,
539
+ $ parameterArray
540
+ );
534
541
} else {
535
- if (isset ($ parameterArray )) {
536
- $ testSteps .= sprintf (
537
- "\t\t$%s->%s(%s, %s); \n" ,
538
- $ actor ,
539
- $ actionName ,
540
- $ input ,
541
- $ parameterArray
542
- );
543
- } else {
544
- $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
545
- }
542
+ $ testSteps .= sprintf (
543
+ "\t\t$%s = $%s->%s(%s); \n" ,
544
+ $ returnVariable ,
545
+ $ actor ,
546
+ $ actionName ,
547
+ $ input
548
+ );
546
549
}
547
550
break ;
551
+ case "grabAttributeFrom " :
552
+ $ testSteps .= sprintf ("\t\t$%s = $%s->%s(%s, %s); \n" , $ returnVariable , $ actor , $ actionName , $ selector , $ input );
553
+ break ;
548
554
case "grabFromCurrentUrl " :
549
- if (isset ($ returnVariable )) {
550
- if ($ input ) {
551
- $ testSteps .= sprintf (
552
- "\t\t$%s = $%s->%s(%s); \n" ,
553
- $ returnVariable ,
554
- $ actor ,
555
- $ actionName ,
556
- $ input
557
- );
558
- } else {
559
- $ testSteps .= sprintf ("\t\t$%s = $%s->%s(); \n" , $ returnVariable , $ actor , $ actionName );
560
- }
555
+ if ($ input ) {
556
+ $ testSteps .= sprintf (
557
+ "\t\t$%s = $%s->%s(%s); \n" ,
558
+ $ returnVariable ,
559
+ $ actor ,
560
+ $ actionName ,
561
+ $ input
562
+ );
561
563
} else {
562
- if ($ input ) {
563
- $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
564
- } else {
565
- $ testSteps .= sprintf ("\t\t$%s->%s(); \n" , $ actor , $ actionName );
566
- }
564
+ $ testSteps .= sprintf ("\t\t$%s = $%s->%s(); \n" , $ returnVariable , $ actor , $ actionName );
565
+ }
566
+ break ;
567
+ case "grabMultiple " :
568
+ if ($ input ) {
569
+ $ testSteps .= sprintf ("\t\t$%s = $%s->%s(%s, %s); \n" , $ returnVariable , $ actor , $ actionName , $ selector , $ input );
570
+ } else {
571
+ $ testSteps .= sprintf ("\t\t$%s = $%s->%s(%s); \n" , $ returnVariable , $ actor , $ actionName , $ selector );
567
572
}
568
573
break ;
569
574
case "grabValueFrom " :
@@ -579,6 +584,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
579
584
$ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ selector );
580
585
}
581
586
break ;
587
+ case "loadSessionSnapshot " :
588
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
589
+ break ;
582
590
case "loginAsAdmin " :
583
591
if (isset ($ customActionAttributes ['username ' ]) && isset ($ customActionAttributes ['password ' ])) {
584
592
$ testSteps .= sprintf (
@@ -648,6 +656,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
648
656
$ customActionAttributes ['height ' ]
649
657
);
650
658
break ;
659
+ case "saveSessionSnapshot " :
660
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
661
+ break ;
651
662
case "scrollTo " :
652
663
$ testSteps .= sprintf ("\t\t$%s->%s(%s, %s, %s); \n" , $ actor , $ actionName , $ selector , $ x , $ y );
653
664
break ;
@@ -729,9 +740,15 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
729
740
case "seeInPageSource " :
730
741
// TODO: Solve the HTML parsing issue.
731
742
break ;
743
+ case "seeInPopup " :
744
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
745
+ break ;
732
746
case "seeInSource " :
733
747
// TODO: Solve the HTML parsing issue.
734
748
break ;
749
+ case "seeInTitle " :
750
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
751
+ break ;
735
752
case "seeLink " :
736
753
if (isset ($ step ['url ' ])) {
737
754
$ testSteps .= sprintf (
@@ -751,9 +768,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
751
768
$ actor ,
752
769
$ actionName ,
753
770
$ selector ,
754
- $ customActionAttributes [ ' userInput ' ]
771
+ $ input
755
772
);
756
773
break ;
774
+ case "seeOptionIsSelected " :
775
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ input );
776
+ break ;
757
777
case "selectOption " :
758
778
if ($ parameterArray ) {
759
779
$ testSteps .= sprintf (
@@ -807,6 +827,40 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
807
827
);
808
828
}
809
829
break ;
830
+ case "switchToIFrame " :
831
+ if ($ input ) {
832
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
833
+ } else {
834
+ $ testSteps .= sprintf ("\t\t$%s->%s(); \n" , $ actor , $ actionName );
835
+ }
836
+ break ;
837
+ case "switchToPreviousTab " :
838
+ if ($ input ) {
839
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
840
+ } else {
841
+ $ testSteps .= sprintf ("\t\t$%s->%s(); \n" , $ actor , $ actionName );
842
+ }
843
+ break ;
844
+ case "switchToNextTab " :
845
+ if ($ input ) {
846
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
847
+ } else {
848
+ $ testSteps .= sprintf ("\t\t$%s->%s(); \n" , $ actor , $ actionName );
849
+ }
850
+ break ;
851
+ case "switchToWindow " :
852
+ if ($ input ) {
853
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
854
+ } else {
855
+ $ testSteps .= sprintf ("\t\t$%s->%s(); \n" , $ actor , $ actionName );
856
+ }
857
+ break ;
858
+ case "typeInPopup " :
859
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ input );
860
+ break ;
861
+ case "unselectOption " :
862
+ $ testSteps .= sprintf ("\t\t$%s->%s(%s, %s); \n" , $ actor , $ actionName , $ selector , $ input );
863
+ break ;
810
864
case "wait " :
811
865
$ testSteps .= sprintf ("\t\t$%s->%s(%s); \n" , $ actor , $ actionName , $ time );
812
866
break ;
0 commit comments