When I copy the code block "example.config.js"

Copy the code of a code block with its copy button ("Copy code to clipboard"), and wait until the button says the code was copied. The browser is allowed to write to the clipboard first (Chromium).

Examples

When I copy the code block "example.config.js"
And I copy the code block "server.js"
When we copy the code block "brew install example"
When copy the code block "example.config.js"
And I copy the code block "curl -fsSL"

Pattern

When(/^(I |we )*copy the code block "([^"]*)?"$/, …)

Part of @webship-js/docusaurus-steps (github.com/webship/docusaurus-steps), a step pack for Webship-js 2.0.x.