Last active
September 25, 2023 10:17
-
-
Save mradbourne/f82f29e63597b7f85a12133506daa868 to your computer and use it in GitHub Desktop.
Revisions
-
mradbourne revised this gist
Sep 25, 2023 . 2 changed files with 53 additions and 40 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,43 +1,56 @@ Feature: Multiple selectors Background: Given the username is "Matt" And the source is: """ match {$photoCount :number} {$userGender :equals} when 1 masculine {{$userName} added a new photo to his album.} when 1 feminine {{$userName} added a new photo to her album.} when 1 * {{$userName} added a new photo to their album.} when * masculine {{$userName} added {$photoCount} photos to his album.} when * feminine {{$userName} added {$photoCount} photos to her album.} when * * {{$userName} added {$photoCount} photos to their album.} """ Scenario: One item - male When the message is resolved with params: | key | value | | photoCount | 1 | | userGender | masculine | Then the string output is "Matt added a new photo to his album." Scenario: One item - female When the message is resolved with params: | key | value | | photoCount | 1 | | userGender | feminine | Then the string output is "Matt added a new photo to her album." Scenario: One item - other When the message is resolved with params: | key | value | | photoCount | 1 | | userGender | other | Then the string output is "Matt added a new photo to their album." Scenario: Multiple items - male When the message is resolved with params: | key | value | | photoCount | 2 | | userGender | masculine | Then the string output is "Matt added 2 photos to his album." Scenario: Multiple items - female When the message is resolved with params: | key | value | | photoCount | 2 | | userGender | feminine | Then the string output is "Matt added 2 photos to her album." Scenario: Multiple items - other When the message is resolved with params: | key | value | | photoCount | 2 | | userGender | other | Then the string output is "Matt added 2 photos to their album." This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ # Advantages - Legibility (compared with json, yaml, toml) - Separation of test cases and implementation - It is easy to utilise regex in step definitions to check param types in the Gherkin - Good first-party support from Cucumber across programming languages - Tried and tested - MIT license (for Gherkin syntax, cucumber-js, cucumber-cpp and cucumber-jvm) # Challenges - Providing structured data in arguments is less convenient - We can parse strings as structured data in step definitions - Will tabular data cater for the majority of cases? -
mradbourne revised this gist
Sep 25, 2023 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ # Advantages - Legibility (compared with json, yaml, toml) - Separation of test cases and implementation - MIT license (for Gherkin syntax, cucumber-js, cucumber-cpp and cucumber-jvm) - Tried and tested - Large community - Shallow learning curve # Risks - Providing structured data in arguments is less convenient - We can parse strings as structured data in step definitions - Tabular data may cater for the majority of cases -
mradbourne created this gist
Sep 22, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ Feature: Multi-selector messages # unicode-org/message-format-wg#119 Background: # All-inclusive resort example provided by @nbouvrette Given the locale is "en" And the source is: """ This all-inclusive resort includes {poolCount, plural, =0 {no pools} one {# pool} other {# pools} }, {restaurantCount, plural, =0 {no restaurants} one {# restaurant} other {# restaurants} }, {beachCount, plural, =0 {no beaches} one {# beach} other {# beaches} } and {golfCount, plural, =0 {no golf courses} one {# golf course} other {# golf courses} }. """ Scenario: No items When the message is resolved with params: | key | value | | poolCount | 0 | | restaurantCount | 0 | | beachCount | 0 | | golfCount | 0 | Then the string output is: """ This all-inclusive resort includes no pools, no restaurants, no beaches and no golf courses. """ Scenario: One item When the message is resolved with params: | key | value | | poolCount | 1 | | restaurantCount | 1 | | beachCount | 1 | | golfCount | 1 | Then the string output is: """ This all-inclusive resort includes 1 pool, 1 restaurant, 1 beach and 1 golf course. """