Is it possible to use long strings in Behave's Scenario description?Calling a function of a module by using its name (a string)Are static class variables possible in Python?How do I parse a string to a float or int?Converting string into datetimeConvert bytes to a string?How to substring a string in Python?Converting integer to string?Does Python have a string 'contains' substring method?How do I lowercase a string in Python?Pythonic way to create a long multi-line string

Is there such a thing as too inconvenient?

Alchemist potion on Undead

Are there reliable, formulaic ways to form chords on the guitar?

Multicolumn in table not centered

How did Apollo 15's depressurization work?

Why doesn't mathematics collapse down, even though humans quite often make mistakes in their proofs?

How to compare two different formulations of a problem?

Earliest evidence of objects intended for future archaeologists?

What professions does medieval village with a population of 100 need?

How to decide whether an eshop is safe or compromised

How do slats reduce stall speed?

Count the frequency of integers in an array

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

Is a butterfly one or two animals?

What can I do to keep a threaded bolt from falling out of it’s slot

Did the twin engined Lazair ultralight have a throttle for each engine?

Designing a prison for a telekinetic race

How much code would a codegolf golf if a codegolf could golf code?

How can I pack my food so it doesn't smell?

iPhone 8 purchased through AT&T change to T-Mobile

Have only girls been born for a long time in this village?

90s(?) book series about two people transported to a parallel medieval world, she joins city watch, he becomes wizard

Are there any OR challenges that are similar to kaggle's competitions?

Nuclear decay triggers



Is it possible to use long strings in Behave's Scenario description?


Calling a function of a module by using its name (a string)Are static class variables possible in Python?How do I parse a string to a float or int?Converting string into datetimeConvert bytes to a string?How to substring a string in Python?Converting integer to string?Does Python have a string 'contains' substring method?How do I lowercase a string in Python?Pythonic way to create a long multi-line string






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to get some good-looking output in Behave test.



example.feature



# language: en

Feature: My feature

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility

Given given step
When when step
Then then step


steps.py



from behave import *


@given('given step')
def given(context):
pass


@when('when step')
def given(context):
pass


@then('then step')
def given(context):
pass


output



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.002s


As you can see, the output is aligned by Scenario string. It ruined the output because if I wan to use it in not too wide window and makes log unreadable.
I tried to use multiline tricks for YAML but it seems that Behave can work only with single string. Please give me a tip how can I make output looking like this:



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music,
wear some Acapulco shirt, erase db
and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14









share|improve this question
























  • The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

    – V-R
    Apr 8 at 16:04


















0















I'm trying to get some good-looking output in Behave test.



example.feature



# language: en

Feature: My feature

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility

Given given step
When when step
Then then step


steps.py



from behave import *


@given('given step')
def given(context):
pass


@when('when step')
def given(context):
pass


@then('then step')
def given(context):
pass


output



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.002s


As you can see, the output is aligned by Scenario string. It ruined the output because if I wan to use it in not too wide window and makes log unreadable.
I tried to use multiline tricks for YAML but it seems that Behave can work only with single string. Please give me a tip how can I make output looking like this:



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music,
wear some Acapulco shirt, erase db
and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14









share|improve this question
























  • The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

    – V-R
    Apr 8 at 16:04














0












0








0








I'm trying to get some good-looking output in Behave test.



example.feature



# language: en

Feature: My feature

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility

Given given step
When when step
Then then step


steps.py



from behave import *


@given('given step')
def given(context):
pass


@when('when step')
def given(context):
pass


@then('then step')
def given(context):
pass


output



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.002s


As you can see, the output is aligned by Scenario string. It ruined the output because if I wan to use it in not too wide window and makes log unreadable.
I tried to use multiline tricks for YAML but it seems that Behave can work only with single string. Please give me a tip how can I make output looking like this:



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music,
wear some Acapulco shirt, erase db
and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14









share|improve this question














I'm trying to get some good-looking output in Behave test.



example.feature



# language: en

Feature: My feature

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility

Given given step
When when step
Then then step


steps.py



from behave import *


@given('given step')
def given(context):
pass


@when('when step')
def given(context):
pass


@then('then step')
def given(context):
pass


output



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music, wear some Acapulco shirt, erase db and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.002s


As you can see, the output is aligned by Scenario string. It ruined the output because if I wan to use it in not too wide window and makes log unreadable.
I tried to use multiline tricks for YAML but it seems that Behave can work only with single string. Please give me a tip how can I make output looking like this:



Feature: My feature # features/example-scenario.feature:3

Scenario: As admin I want to listen special music,
wear some Acapulco shirt, erase db
and do not want to bear any responsibility # features/example-scenario.feature:5
Given given step # features/steps/x.py:4
When when step # features/steps/x.py:9
Then then step # features/steps/x.py:14






python cucumber bdd python-behave






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 14:50









Xing-fuXing-fu

288 bronze badges




288 bronze badges















  • The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

    – V-R
    Apr 8 at 16:04


















  • The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

    – V-R
    Apr 8 at 16:04

















The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

– V-R
Apr 8 at 16:04






The point of using the Gherkin language is to keep your (executable) specification easily readable. Good scenario titles are short one-liners. Your example should be split into several different Scenarios maybe even inside several different features, e.g. music_listening.feature and database_erasing.feature. Ideally use something like gherkin_lint to keep it all readable. You can still write multi-line comments between """ if you really want that.

– V-R
Apr 8 at 16:04













0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380171%2fis-it-possible-to-use-long-strings-in-behaves-scenario-description%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380171%2fis-it-possible-to-use-long-strings-in-behaves-scenario-description%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript