Skip to content

Commit 1ae9468

Browse files
committed
add first version (empty, minimal and data-tables are enabled) of the compatibility kit
1 parent 48d99c6 commit 1ae9468

File tree

141 files changed

+2652
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2652
-0
lines changed

compatibility/CMakeLists.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
function(add_compatibility_kit name)
2+
set(libname compatibility.${name}.test)
3+
add_executable(${libname})
4+
5+
if(CCR_BUILD_TESTS)
6+
add_test(NAME ${libname} COMMAND ${libname})
7+
endif()
8+
9+
target_link_libraries(${libname} PRIVATE
10+
cucumber_cpp
11+
gtest_main
12+
)
13+
14+
target_include_directories(${libname} PUBLIC
15+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
16+
)
17+
18+
target_sources(${libname} PRIVATE
19+
compatibility.cpp
20+
${name}/${name}.cpp
21+
)
22+
23+
string(REPLACE "-" "_" KITNAME ${name})
24+
25+
target_compile_definitions(${libname} PRIVATE
26+
KIT_NAME=${KITNAME}
27+
KIT_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/${name}"
28+
KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson"
29+
)
30+
endfunction()
31+
32+
file(GLOB kits RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/*)
33+
foreach(kit ${kits})
34+
if (IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/${kit})
35+
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${kit}/${kit}.cpp)
36+
message(STATUS "Adding compatibility kit: ${kit}")
37+
add_compatibility_kit(${kit})
38+
endif()
39+
endif()
40+
endforeach()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Feature: Ambiguous steps
2+
Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine
3+
which one to execute.
4+
5+
Scenario: Multiple step definitions for a step
6+
Given a step with multiple definitions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{"meta":{"protocolVersion":"31.0.0","implementation":{"name":"fake-cucumber","version":"123.45.6"},"cpu":{"name":"arm64"},"os":{"name":"darwin","version":"24.5.0"},"runtime":{"name":"Node.js","version":"24.4.1"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber-ltd/shouty.rb/actions/runs/154666429","buildNumber":"154666429","git":{"revision":"99684bcacf01d95875834d87903dcb072306c9ad","remote":"https://github.com/cucumber-ltd/shouty.rb.git","branch":"main"}}}}
2+
{"source":{"data":"Feature: Ambiguous steps\n Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine\n which one to execute.\n\n Scenario: Multiple step definitions for a step\n Given a step with multiple definitions\n","uri":"samples/ambiguous/ambiguous.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
3+
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Ambiguous steps","description":" Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine\n which one to execute.","children":[{"scenario":{"id":"1","tags":[],"location":{"line":5,"column":3},"keyword":"Scenario","name":"Multiple step definitions for a step","description":"","steps":[{"id":"0","location":{"line":6,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step with multiple definitions"}],"examples":[]}}]},"comments":[],"uri":"samples/ambiguous/ambiguous.feature"}}
4+
{"pickle":{"id":"3","uri":"samples/ambiguous/ambiguous.feature","location":{"line":5,"column":3},"astNodeIds":["1"],"tags":[],"name":"Multiple step definitions for a step","language":"en","steps":[{"id":"2","text":"a step with multiple definitions","type":"Context","astNodeIds":["0"]}]}}
5+
{"stepDefinition":{"id":"4","pattern":{"type":"REGULAR_EXPRESSION","source":"^a (.*?) with (.*?)$"},"sourceReference":{"uri":"samples/ambiguous/ambiguous.ts","location":{"line":3}}}}
6+
{"stepDefinition":{"id":"5","pattern":{"type":"REGULAR_EXPRESSION","source":"^a step with (.*)$"},"sourceReference":{"uri":"samples/ambiguous/ambiguous.ts","location":{"line":7}}}}
7+
{"testRunStarted":{"id":"6","timestamp":{"seconds":0,"nanos":0}}}
8+
{"testCase":{"id":"7","pickleId":"3","testSteps":[{"id":"8","pickleStepId":"2","stepDefinitionIds":["4","5"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"start":2,"value":"step","children":[]}},{"group":{"start":12,"value":"multiple definitions","children":[]}}]},{"stepMatchArguments":[{"group":{"start":12,"value":"multiple definitions","children":[]},"parameterTypeName":""}]}]}],"testRunStartedId":"6"}}
9+
{"testCaseStarted":{"id":"9","testCaseId":"7","timestamp":{"seconds":0,"nanos":1000000},"attempt":0}}
10+
{"testStepStarted":{"testCaseStartedId":"9","testStepId":"8","timestamp":{"seconds":0,"nanos":2000000}}}
11+
{"testStepFinished":{"testCaseStartedId":"9","testStepId":"8","testStepResult":{"status":"AMBIGUOUS","duration":{"seconds":0,"nanos":0}},"timestamp":{"seconds":0,"nanos":3000000}}}
12+
{"testCaseFinished":{"testCaseStartedId":"9","timestamp":{"seconds":0,"nanos":4000000},"willBeRetried":false}}
13+
{"testRunFinished":{"testRunStartedId":"6","timestamp":{"seconds":0,"nanos":5000000},"success":false}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Given } from '@cucumber/fake-cucumber'
2+
3+
Given(/^a (.*?) with (.*?)$/, function () {
4+
// first one
5+
})
6+
7+
Given(/^a step with (.*)$/, function () {
8+
// second one
9+
})
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Feature: Attachments
2+
It is sometimes useful to take a screenshot while a scenario runs or capture some logs.
3+
4+
Cucumber lets you `attach` arbitrary files during execution, and you can
5+
specify a content type for the contents.
6+
7+
Formatters can then render these attachments in reports.
8+
9+
Attachments must have a body and a content type.
10+
11+
Scenario: Strings can be attached with a media type
12+
Beware that some formatters such as @cucumber/react use the media type
13+
to determine how to display an attachment.
14+
15+
When the string "hello" is attached as "application/octet-stream"
16+
17+
Scenario: Log text
18+
When the string "hello" is logged
19+
20+
Scenario: Log ANSI coloured text
21+
When text with ANSI escapes is logged
22+
23+
Scenario: Log JSON
24+
When the following string is attached as "application/json":
25+
```
26+
{"message": "The <b>big</b> question", "foo": "bar"}
27+
```
28+
29+
Scenario: Byte arrays are base64-encoded regardless of media type
30+
When an array with 10 bytes is attached as "text/plain"
31+
32+
Scenario: Attaching PDFs with a different filename
33+
When a PDF document is attached and renamed
34+
35+
Scenario: Attaching URIs
36+
When a link to "https://cucumber.io" is attached

0 commit comments

Comments
 (0)