Skip to content

Commit

Permalink
Misc cucumber tweaks
Browse files Browse the repository at this point in the history
no refs

Misc cucumber tweaks:

- Use `docker compose run` instead of `docker compose up` to get a `TTY` for
live updating of progress + colorization of output. Also removes the annoying
service name prefix from the output
- Use `progress` as the formatter so we can see that things are happening
- Use JS based config instead of cmd line args for cucumber.js
- Added `failFast` to the config so we can stop on the first failure
  • Loading branch information
mike182uk committed Dec 19, 2024
1 parent 08d551f commit 0737bd8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
let cmd = `--format-options '{"snippetInterface": "synchronous"}'`;
// https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md

if (process.env.TAGS) {
// @see https://cucumber.io/docs/cucumber/api/?lang=javascript#tags
cmd += ` --tags '${process.env.TAGS}'`;
}

console.log(cmd);

export default cmd;
export default {
backtrace: true,
format: ['progress'],
formatOptions: {
snippetInterface: 'synchronous',
},
failFast: true,
tags: process.env.TAGS,
};
2 changes: 1 addition & 1 deletion docker/cucumber-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

export TAGS=$1

docker compose run --rm migrate-testing up && docker compose up cucumber-tests --exit-code-from cucumber-tests
docker compose run --rm migrate-testing up && docker compose run --rm cucumber-tests
2 changes: 1 addition & 1 deletion features/create-note.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Feature: Creating a note
<script>alert("Hello, world!");</script>
"""
Then "Note" is in our Outbox
And "Note" has the content "<p>&lt;p&gt;Hello, world!&lt;&#x2F;p&gt;<br />&lt;script&gt;alert(&quot;Hello, world!&quot;);&lt;&#x2F;script&gt;</p>"
And "Note" has the content "z<p>&lt;p&gt;Hello, world!&lt;&#x2F;p&gt;<br />&lt;script&gt;alert(&quot;Hello, world!&quot;);&lt;&#x2F;script&gt;</p>"

Scenario: Created note is sent to followers
Given an Actor "Person(Alice)"
Expand Down

0 comments on commit 0737bd8

Please sign in to comment.