question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Allow capturing of alternative text

See original GitHub issue

Summary

It would be nice if Cucumber Expressions could capture the alternative text from the feature file and use it as a parameter as we were able to with regex:

Ex. @And("^I set the (current|comparison) date range to \"([^\"]*)\" through \"([^\"]*)\"$")

vs.

@And("I set the (current/comparison) date range to {string} through {string}")

Expected Behavior

Cucumber users are able to capture alternate text as a parameter to the step definition method.

Current Behavior

Unable to do this currently



Possible Solution

Allow for something like (choice1/choice2) which would capture that word in that position without quotes around it and pass it as an argument.

Context & Motivation

Updating from cuke 1 to cuke 4 (our stuff is old) and I hit a roadblock here. My current solution is to make an enum and pass that down instead, but this could be nice for more than just my team.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aslakhellesoycommented, Jul 8, 2019

@ddaypunk06 have you considered defining a parameter type for this? I set the {date-range-type} date range to {string} through {string}

1reaction
mpkorstanjecommented, Jun 26, 2019

Example, rather sparse because of phone:

@And("I set the current date range to {string} through {string}")
...
    setDateRange(CURRENT, from, to);
....

@And("I set the comparison date range to {string} through {string}")
...
    setDateRange(COMPARISON, from, to);
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create Alternative Text for Images for Accessibility and ...
Alternative text, in its simplest form, is background code added to a digital image that allows a screen reader or other assistive technology...
Read more >
Write good Alt Text to describe images | Digital Accessibility​
Write good Alt Text to describe images ... Alternative (Alt) Text is meant to convey the “why” of the image as it relates...
Read more >
Accessibility: Image Alt text best practices - Siteimprove Support
When using image alt text, it should not include: "picture of"; "image of" ... According to WCAG, images of text are not allowed....
Read more >
ALT Text for Images | Feature requests - GatherContent - Canny
Hi everyone. Setting alt text for images is now possible via the file viewer. Head to Files & media, open an image file,...
Read more >
Making LinkedIn media more inclusive with alternative text ...
One way to improve the accessibility of rich media is by providing an alternative text description when uploading an image. A good alternative ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found