@@ -966,18 +966,14 @@ class WebEngineTest extends BaseTest with Matchers with MockitoSugar with Before
966
966
verify(mockTopScope, times(3 )).set(" <attribute>" , " value" , false )
967
967
}
968
968
969
- """ my <name> property <is|will be> "<value>"""" should " evaluate" in {
970
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
971
- evaluate(s """ my gwen.property- $i property $x "value- $i" """ )
972
- Settings .get(s " gwen.property- $i" ) should be (s " value- $i" )
973
- }
969
+ """ my <name> property is "<value>"""" should " evaluate" in {
970
+ evaluate(s """ my gwen.property-0 property is "value-0" """ )
971
+ Settings .get(s " gwen.property-0 " ) should be (s " value-0 " )
974
972
}
975
973
976
- """ my <name> setting <is|will be> "<value>"""" should " evaluate" in {
977
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
978
- evaluate(s """ my gwen.setting- $i setting $x "value- $i" """ )
979
- Settings .get(s " gwen.setting- $i" ) should be (s " value- $i" )
980
- }
974
+ """ my <name> setting is "<value>"""" should " evaluate" in {
975
+ evaluate(s """ my gwen.setting-0 setting is "value-0" """ )
976
+ Settings .get(s " gwen.setting-0 " ) should be (s " value-0 " )
981
977
}
982
978
983
979
" I reset my <name> property" should " evaluate" in {
@@ -990,55 +986,43 @@ class WebEngineTest extends BaseTest with Matchers with MockitoSugar with Before
990
986
Settings .getOpt(s " gwen.web " ) should be (None )
991
987
}
992
988
993
- """ <attribute> <is|will> be defined by javascript "<expression>"""" should " evaluate" in {
989
+ """ <attribute> is defined by javascript "<expression>"""" should " evaluate" in {
994
990
doReturn(mockTopScope).when(envState).topScope
995
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
996
- evaluate(s """ attribute- $i $x defined by javascript "expression- $i" """ )
997
- verify(mockTopScope).set(s " attribute- $i/javascript " , s " expression- $i" , false )
998
- }
991
+ evaluate(s """ attribute-0 is defined by javascript "expression-0" """ )
992
+ verify(mockTopScope).set(s " attribute-0/javascript " , s " expression-0 " , false )
999
993
}
1000
994
1001
- """ <attribute> <is|will> be defined by property "<name>"""" should " evaluate" in {
1002
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1003
- withSetting(s " name- $i" , s " $i" ) {
1004
- evaluate(s """ attribute- $i $x defined by property "name- $i" """ )
1005
- verify(mockTopScope).set(s " attribute- $i" , s " $i" , false )
1006
- }
995
+ """ <attribute> is defined by property "<name>"""" should " evaluate" in {
996
+ withSetting(s " name-0 " , " 0" ) {
997
+ evaluate(s """ attribute-0 is defined by property "name-0" """ )
998
+ verify(mockTopScope).set(s " attribute-0 " , " 0" , false )
1007
999
}
1008
1000
}
1009
1001
1010
- """ <attribute> <is|will> be defined by setting "<name>"""" should " evaluate" in {
1011
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1012
- withSetting(s " name- $i" , s " $i" ) {
1013
- evaluate(s """ attribute- $i $x defined by setting "name- $i" """ )
1014
- verify(mockTopScope).set(s " attribute- $i" , s " $i" , false )
1015
- }
1002
+ """ <attribute> is defined by setting "<name>"""" should " evaluate" in {
1003
+ withSetting(s " name-0 " , " 0" ) {
1004
+ evaluate(s """ attribute-0 is defined by setting "name-0" """ )
1005
+ verify(mockTopScope).set(s " attribute-0 " , " 0" , false )
1016
1006
}
1017
1007
}
1018
1008
1019
- """ <attribute> <is|will> be defined by system process "<process>"""" should " evaluate" in {
1009
+ """ <attribute> is defined by system process "<process>"""" should " evaluate" in {
1020
1010
doReturn(mockTopScope).when(envState).topScope
1021
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1022
- evaluate(s """ attribute- $i $x defined by system process "process- $i" """ )
1023
- verify(mockTopScope).set(s " attribute- $i/sysproc " , s " process- $i" , false )
1024
- }
1011
+ evaluate(s """ attribute-0 is defined by system process "process-0" """ )
1012
+ verify(mockTopScope).set(s " attribute-0/sysproc " , s " process-0 " , false )
1025
1013
}
1026
1014
1027
- """ <attribute> <is|will> be defined by system process "<process>" delimited by "<delimiter>"""" should " evaluate" in {
1015
+ """ <attribute> is defined by system process "<process>" delimited by "<delimiter>"""" should " evaluate" in {
1028
1016
doReturn(mockTopScope).when(envState).topScope
1029
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1030
- evaluate(s """ attribute- $i $x defined by system process "process- $i" delimited by "," """ )
1031
- verify(mockTopScope).set(s " attribute- $i/sysproc " , s " process- $i" , false )
1032
- verify(mockTopScope).set(s " attribute- $i/delimiter " , s " , " , false )
1033
- }
1017
+ evaluate(s """ attribute-0 is defined by system process "process-0" delimited by "," """ )
1018
+ verify(mockTopScope).set(s " attribute-0/sysproc " , s " process-0 " , false )
1019
+ verify(mockTopScope).set(s " attribute-0/delimiter " , s " , " , false )
1034
1020
}
1035
1021
1036
- """ <attribute> <is|will> be defined by file "<filepath>"""" should " evaluate" in {
1022
+ """ <attribute> is defined by file "<filepath>"""" should " evaluate" in {
1037
1023
doReturn(mockTopScope).when(envState).topScope
1038
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1039
- evaluate(s """ attribute- $i $x defined by file "filepath- $i" """ )
1040
- verify(mockTopScope).set(s " attribute- $i/file " , s " filepath- $i" , false )
1041
- }
1024
+ evaluate(s """ attribute-0 is defined by file "filepath-0" """ )
1025
+ verify(mockTopScope).set(s " attribute-0/file " , s " filepath-0 " , false )
1042
1026
}
1043
1027
1044
1028
""" <attribute> is defined by the <text|node|nodeset> in <reference> by xpath "<expression>"""" should " evaluate" in {
@@ -1048,42 +1032,27 @@ class WebEngineTest extends BaseTest with Matchers with MockitoSugar with Before
1048
1032
verify(mockTopScope).set(" <attribute>/xpath/source" , s " <reference- $i> " , false )
1049
1033
verify(mockTopScope).set(" <attribute>/xpath/targetType" , x, false )
1050
1034
verify(mockTopScope).set(" <attribute>/xpath/expression" , s " <expression- $i> " , false )
1035
+ reset(mockTopScope)
1051
1036
}
1052
1037
}
1053
1038
1054
- """ <attribute> will be defined by the <text|node|nodeset> in <reference> by xpath "<expression>"""" should " evaluate" in {
1055
- doReturn(mockTopScope).when(envState).topScope
1056
- List (" text" , " node" , " nodeset" ).zipWithIndex.foreach { case (x, i) =>
1057
- evaluate(s """ <attribute> will be defined by the $x in <reference- $i> by xpath "<expression- $i>" """ )
1058
- verify(mockTopScope).set(" <attribute>/xpath/source" , s " <reference- $i> " , false )
1059
- verify(mockTopScope).set(" <attribute>/xpath/targetType" , x, false )
1060
- verify(mockTopScope).set(" <attribute>/xpath/expression" , s " <expression- $i> " , false )
1061
- }
1062
- }
1063
-
1064
- """ <attribute> <is|will be> defined in <reference> by regex "<expression>"""" should " evaluate" in {
1039
+ """ <attribute> is defined in <reference> by regex "<expression>"""" should " evaluate" in {
1065
1040
doReturn(mockTopScope).when(envState).topScope
1066
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1067
- evaluate(s """ <attribute> $x defined in <reference- $i> by regex "<expression- $i>" """ )
1068
- verify(mockTopScope).set(s " <attribute>/regex/source " , s " <reference- $i> " , false )
1069
- verify(mockTopScope).set(s " <attribute>/regex/expression " , s " <expression- $i> " , false )
1070
- }
1041
+ evaluate(s """ <attribute> is defined in <reference-0> by regex "<expression-0>" """ )
1042
+ verify(mockTopScope).set(s " <attribute>/regex/source " , s " <reference-0> " , false )
1043
+ verify(mockTopScope).set(s " <attribute>/regex/expression " , s " <expression-0> " , false )
1071
1044
}
1072
1045
1073
- """ <attribute> <is|will be> defined in <reference> by json path "<expression>"""" should " evaluate" in {
1046
+ """ <attribute> is defined in <reference> by json path "<expression>"""" should " evaluate" in {
1074
1047
doReturn(mockTopScope).when(envState).topScope
1075
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1076
- evaluate(s """ <attribute> $x defined in <reference- $i> by json path "<expression- $i>" """ )
1077
- verify(mockTopScope).set(s " <attribute>/json path/source " , s " <reference- $i> " , false )
1078
- verify(mockTopScope).set(s " <attribute>/json path/expression " , s " <expression- $i> " , false )
1079
- }
1048
+ evaluate(s """ <attribute> is defined in <reference-0> by json path "<expression-0>" """ )
1049
+ verify(mockTopScope).set(s " <attribute>/json path/source " , s " <reference-0> " , false )
1050
+ verify(mockTopScope).set(s " <attribute>/json path/expression " , s " <expression-0> " , false )
1080
1051
}
1081
1052
1082
- """ <attribute> <is|will be> "<value>"""" should " evaluate" in {
1083
- List (" is" , " will be" ).zipWithIndex.foreach { case (x, i) =>
1084
- evaluate(s """ <attribute- $i> $x "<value- $i>" """ )
1085
- verify(mockTopScope).set(s " <attribute- $i> " , s " <value- $i> " , false )
1086
- }
1053
+ """ <attribute> is "<value>"""" should " evaluate" in {
1054
+ evaluate(s """ <attribute-0> is "<value-0>" """ )
1055
+ verify(mockTopScope).set(s " <attribute-0> " , s " <value-0> " , false )
1087
1056
}
1088
1057
1089
1058
" @Timeout('1s') I wait for <element> text" should " evaluate" in {
@@ -1604,28 +1573,24 @@ class WebEngineTest extends BaseTest with Matchers with MockitoSugar with Before
1604
1573
}
1605
1574
}
1606
1575
1607
- """ <reference> <is|will be> defined by sql "<selectStmt>" in the <dbName> database""" should " evaluate" in {
1576
+ """ <reference> is defined by sql "<selectStmt>" in the <dbName> database""" should " evaluate" in {
1608
1577
doReturn(mockTopScope).when(envState).topScope
1609
1578
withSetting(" gwen.db.<dbName>.driver" , " driver" ) {
1610
1579
withSetting(" gwen.db.<dbName>.url" , " url" ) {
1611
- List (" is" , " will be" ).foreach { x =>
1612
- evaluate(s """ <reference> $x defined by sql "<selectStmt>" in the <dbName> database """ )
1613
- }
1614
- verify(mockTopScope, times(2 )).set(s " <reference>/sql/selectStmt " , " <selectStmt>" , false )
1615
- verify(mockTopScope, times(2 )).set(s " <reference>/sql/dbName " , " <dbName>" , false )
1580
+ evaluate(s """ <reference> is defined by sql "<selectStmt>" in the <dbName> database """ )
1581
+ verify(mockTopScope).set(s " <reference>/sql/selectStmt " , " <selectStmt>" , false )
1582
+ verify(mockTopScope).set(s " <reference>/sql/dbName " , " <dbName>" , false )
1616
1583
}
1617
1584
}
1618
1585
}
1619
1586
1620
- """ <reference> <is|will be> defined in the <dbName> database by sql "<selectStmt>"""" should " evaluate" in {
1587
+ """ <reference> is defined in the <dbName> database by sql "<selectStmt>"""" should " evaluate" in {
1621
1588
doReturn(mockTopScope).when(envState).topScope
1622
1589
withSetting(" gwen.db.<dbName>.driver" , " driver" ) {
1623
1590
withSetting(" gwen.db.<dbName>.url" , " url" ) {
1624
- List (" is" , " will be" ).foreach { x =>
1625
- evaluate(s """ <reference> $x defined in the <dbName> database by sql "<selectStmt>" """ )
1626
- }
1627
- verify(mockTopScope, times(2 )).set(s " <reference>/sql/selectStmt " , " <selectStmt>" , false )
1628
- verify(mockTopScope, times(2 )).set(s " <reference>/sql/dbName " , " <dbName>" , false )
1591
+ evaluate(s """ <reference> is defined in the <dbName> database by sql "<selectStmt>" """ )
1592
+ verify(mockTopScope).set(s " <reference>/sql/selectStmt " , " <selectStmt>" , false )
1593
+ verify(mockTopScope).set(s " <reference>/sql/dbName " , " <dbName>" , false )
1629
1594
}
1630
1595
}
1631
1596
}
0 commit comments