I am trying to layout 4 ButtonFields in the corners of the screen:
-------------------
|button button|
| |
| |
|button button|
-------------------
Is there an easy way to do this?
Not sure if I could call this "easy" but you may have to write your own layout manager which positions the 4 child elements inside it. The BB layout managers are similar, but not identical to Swing's. As is usual for BB dev, you may have to play around with it for a while to get it working like you expect :)
Related
I am using an outline examples in my test,
something like :
Feature: feature name
Scenario Outline: outline scenario
Given I go to
When I click on button
Then I should have
Examples:
| website | title |
| google | google welcome|
| yahoo | yahoo welcome |
| Astalavista | altalavista hello I m dead |
so far it is great !!! but if the first one is doing okay and the second one is having an issue the third is not played ...
do you know how to continue all the test in case of outline scenario ?
thanks a lot for your help !
There is something called failFast in the cucumberOpts.
If the value is true then it means fail at the first failure and do not proceed.
If the value is false then the execution will continue for all the scenario in the feature file even if one scenario fails.
So try by making it as false.
Thanks,
Naveen
In my feature file, using the same scenario I am checking more than one requirements. I have written the scenario like below:
Scenario: My first requirement ID
My second requirement ID
My third requirement ID
Etc
After execution, the extend report shows only the result as
Scenario: My first requirement ID
How can I get all the three I D,s in extent report.
NOTE:Each of my scenario title is lengthy.
Can you explain your scenario text a little bit more? According to the documentation, the scenario should describe in human terms what we expect the software to do. It is quite unusual to include expected data in that scenario text. Are you using the ID from an enum? If that is the case, it would be better to spell out the enum in human readable terms. Scenario: UserType is Administrator for example. Another option would be to use a Scenario Outline, something like
Scenario Outline: My generic requirement statement
Given Id <whateverId> is provided
When I do <activity>
Then I expect to see <result>
Examples:
| whateverId | activity | result |
| 12 | firstMethod | MyResult |
| 20 | secondActivity | anotherResult |
| 42 | thirdExample | thirdResult |
The variable names provided in the outline in angle brackets become the column headers in the examples grid. Just be sure to indent the grid below the Examples: line and also include the pipe | on both the left and right boundaries of the grid. Hopefully that helps.
Feature: showing off behave style
Scenario Outline: wow
Given I put "<brand_one/brand_two>" in a blender
When we implement a test
Examples: Brand
| brand_one|brand_two|
| first Frog | second Frog|
I want to select brand_one or brand_two at run time.
On executing feature file i just want to execute method taking value of brand_one (i.e first Frog) or brand_two (i.e seconf Frog) at run time. But only execute one desired brand and not the other one. Please help me out to select this on run time. Thanks
You could use tags for this:
Feature: showing off behave style
Scenario Outline: wow
Given I put "<brand>" in a blender
When we implement a test
#FrogOne
Examples: Brand
| brand|
| first Frog |
#FrogTwo
Examples: Brand
| brand|
| second Frog|
Then choose it at run time like so
behave -t FrogOne
or
behave --tags FrogOne
I'm creating informational output with console.log() in Node.js however, I would like to create a split screen that somehow outputs different data.
Example:
---------------------------------
| value a.1 | value b.1 |
| value a.2 | value b.2 |
| value a.3 | value b.3 |
| value a.4 | value b.4 |
| value a.5 | value b.5 |
| | value b.6 |
| | value b.7 |
---------------------------------
It could be that value b.x is updating very fast, and value a.1 very slowly.
What could I use? Maybe something else then console.log()?
UPDATE:
I needed a UI library for the console.
It sounds like you want a UI library for the console. You're in luck. This sort of thing has been around for a while.
You essentially have two choices:
https://github.com/chjj/blessed - A simple graphics library for terminals that lets you do stuff like what you're describing above.
https://github.com/mscdex/node-ncurses - node bindings for ncurses (this is a standard terminal graphics library).
I think blessed has a nicer API, but the choice is yours!
For the sake of others looking around for more options:
Along with blessed and node-ncurses, you have Colors, Chalk and Terminal-Kit as well.
However, if one do not want to use console.log(), Terminal-Kit could be of use.
Is it possible to somehow construct a Scenario which uses two different Example tables in different steps? Something like this:
Given I log in
When I view a page
Then I should see <goodText>
Examples:
|goodText|
|abc|
And I should not see <badText>
Examples:
|badText|
|xyz|
The scenario above doesn't work, also in reality there would be more rows to each table.
It looks like you're confusing tables with scenario examples. You can mix them, but from your example I'm not sure what you're trying to achieve. Why not just write:
Given I log in
When I view a page
Then I should see "abc"
But I should not see "xyz"
or if you wanted to check for multiple strings:
Given I log in
When I view a page
Then I should see the following text:
| abc |
| def |
But I should not see the following text:
| xyz |
| uvw |
You say that in reality there would be many more rows to the table; but of course a table can also have many columns.
Would this not work for you?
Given I log in
When I view a page
Then I should see <goodText>
But I should not see <badText>
Examples:
|goodText| badText |
|abc | xyz |