Failed to convert Jbehave named parameters without delemeters - jbehave

We are using Serenity with Jbehave for out automation stories, and we have recently upgraded our version to Serenity(2.2.1) and jbejave(1.46.0). Jbehave-core updated from 4.1.3 to 4.4. After the update i am facing an issue with examples table. it is forcing to use delimiter for the step table provided which is taken from story Examples.
This worked previously and got expected values into table
Scenario: Verify scenario
Meta:
Given modal should contains the next content:
{transformer=FROM_LANDSCAPE}
| modalTitle | expectedTitle1 |
| modalFooterTitle | expectedFooterTitle |
Examples:
{transformer=FROM_LANDSCAPE}
| expectedTitle1 | this is first expected title |
| expectedFooterTitle | This is expected footer text |
Now i have to use delimiter to get my expected content into table as below
Given product modal should contains the next content:
{transformer=FROM_LANDSCAPE}
| modalTitle | <expectedTitle1> |
| modalFooterTitle | <expectedFooterTitle> |
Examples:
{transformer=FROM_LANDSCAPE}
| expectedTitle1 | this is first expected title |
| expectedFooterTitle | This is expected footer text |
Also tried with configuration steps like ParameterControls().useDelimiterNamedParameters(false) but didn't worked. We have already implemented thousands of stories and it is hard to replace storied with delimiters. is there any work around to solve my problem?

Related

Selenium IDE: If variable contains some text

In the Selenium IDE Firefox add-on I'm trying to create an If statement that will execute a one way if my variable contains a certain text and will execute another way if it contains other text. The issue I'm having is I need it to check just one or two words in a long text so I can't use ==. What I've been trying to do is:
Command | Target | Value
Store Value | id = stuff | Test
If | ${Test}.contains('text') |
But this hasn't been working. Any help with this is greatly appreciated!
I use this contraction for such cases.
Command | Target | Value
Store Value | id = stuff | Test
execute script | var t = ${Test}; return t.contains('text'); | tmp
If | ${tmp}=='true' |

Postgres fulltext ignores xml tags

I'm working on web app which enables the user to search within a source repository.
The program parses the diffs.
I can't find a way to inject all parts of the diff into the Postgres' fulltext vector.
Example:
select alias, description, token from ts_debug('Link to Yahoo! web site');
+-----------+-----------------+----------------------------+
| alias | description | token |
+-----------+-----------------+----------------------------+
| asciiword | Word, all ASCII | Link |
| blank | Space symbols | |
| asciiword | Word, all ASCII | to |
| blank | Space symbols | |
| tag | XML tag | <a href="//www.yahoo.com"> |
| asciiword | Word, all ASCII | Yahoo |
| blank | Space symbols | ! |
| tag | XML tag | </a> |
| blank | Space symbols | |
| asciiword | Word, all ASCII | web |
| blank | Space symbols | |
| asciiword | Word, all ASCII | site |
+-----------+-----------------+----------------------------+
It seems to be parsed ok. But if I turn it into a document vector the XML tag won't be included.
select to_tsvector('simple', 'Link to Yahoo! web site') to_tsvector;
+--------------------------------------------+
| to_tsvector |
+--------------------------------------------+
| 'link':1 'site':5 'to':2 'web':4 'yahoo':3 |
+--------------------------------------------+
I guess it has something to do with the configuration?
Any ideas?
The parser parses out tags, but the default configuration 'simple' ignores them (as can be seen in psql by running \dF+ simple, tokens not listed are ignored).
You can tell it not to ignore them:
alter text search configuration simple add mapping for tag with simple;
But you would probably be better off copying the configuration and then modifying the copy.
You might also need a custom dictionary to process the tags, since the 'simple' dictionary is unlikely to do what you want.
select to_tsvector('simple', 'Link to Yahoo! web site') to_tsvector;
to_tsvector
------------------------------------------------------------------------------------
'</a>':5 '<a href="//www.yahoo.com">':3 'link':1 'site':7 'to':2 'web':6 'yahoo':4

Using markdown icons within tables in Github?

I would like checkmarks to appear in table cells in my github README.md file. The problem is, instead of :white_check_mark: taking the form of a white checkmark, it instead leaves that raw literal text within the table.
Here is the full markdown of the table
| Property | Type | Null | Description |
| -------- | ---- | ---- | ----------- |
| subject | string | | Message subject |
| body_excerpt | string | | Short excerpt of the message body |
| to | list | :white_check_mark: | Names and emails of the message recipients |
| cc | list | :white_check_mark: | Names and emails of the message recipients who were CC'd |
Any ideas why this icon might not be appearing?
Thanks
EDIT: above example actually does show the white check marks. For better reference, check out README.md in this repo
TL;DR
Your table is correctly formatted. The problem is elsewhere.
More detailed answer
Hmmm. I've sent a Pull Request to your repo which "fixes" the rendering of the checkmark. However, the fix is completely unrelated. I just dropped some json from the README.
The removed portion of json seems innocuous though. I'd guess this might not be related to your README content, but rather to the rendering engine GitHub relies on.
I'd strongly suggest you to report this weird behavior to support#github.com (maybe linking to the PR which demonstrates the potential rendering issue).

Display error in | Error message |in Specflow Nunit

I am writing in Feature file where I need to display error message
Here is my code:
Scenario: Registration of Client with alphanumeric ClientName
Given I have logged in as Administrator user
And I have entered
| Field | Value |
| Client Name | ClientName2 |
When I goto Password
Then I should see :
| Client Name |
| ClientName2 |
Scenario: Registration of Client with ClientName containing symbols
Given I have logged in as Administrator user
And I have entered
| Field | Value |
| Client Name | Client#Name |
When I goto Password
Then I should see :
| Error Message |
| Please enter only Alphanumeric characters |
I think it using like this will be easy in step definition
Please let me know can I use error message in table like client Name
Or is it against the specflow rules?
It seems to me that your step is a little too specific for each case. Its not exactly clear what the filed name is meant to mean in your scenario.
you have this step:
Then I should see :
| Client Name |
| ClientName2 |
Which seems to imply that the tile (Client Name) is the field you want to look in and 'ClientName2' is the value you are looking for, and then you have this in the error case:
Then I should see :
| Error Message |
| Please enter only Alphanumeric characters |
Does this imply that there is a field called Error Message? If this is the case then I would set it up like you have done for the Given step and this as your first Then step:
Then I should see :
| Field | Value |
| Client Name | ClientName2 |
And this as your second Then step:
Then I should see :
| Field | Value |
| Error Message | Please enter only Alphanumeric characters |
If this does not represent a filed to look in then I would instead encode the different place to look in the actual step, and have a different step for checking for an error, like this:
Then I should see the client name 'ClientName2'
and
Then I should see the error message 'Please enter only Alphanumeric characters'
and make the implementation of these steps look in the correct elements on the page. This second approach has the advantage that if you decide to change how error messages are displayed (say they are warned on a popup) then you only need to change the implementation of the step which deals with the error message and you don't need to change every single step that uses an error message.
Ideally you would make your steps ignorant of the implementation. This makes the steps much more likely to be reusable.

Doxygen Table drawing

I would like to insert a ASCII art table (as below) in the documentation.
The Markdown feature of doxygen comes in the way and messes it all up.
I've tried to the HTML table and they are fine but the source document becomes unreadable then.
Can I somehow get doxygen not to process a section but still include it in the output file?
Similar to here where 4 blanks allow to to inserted already formatted text in fixed width font.
|-------------|-------------------------|---------------|
|AUTO_NEW_OFF | Entry action | LED_FLASH |
| | | SEQ_OFF |
|-------------|-------------------------|---------------|
| | eXit action | |
|-------------|-------------------------|---------------|
| | | |
|-------------|-------------------------|---------------|
| OFF | SEQ complete | |
|-------------|-------------------------|---------------|
I think I can answer this myself already.
The Fenced Code Blocks ( 3 x ~) feature seems to work ok
~~~
|-------------|-------------------------|---------------|
| MAN_NEW_OFF | Entry action | LED_FLASH |
| | | SEQ_OFF |
|-------------|-------------------------|---------------|
~~~
An improvement on fenced code would be to surround the table with the doxygen commands #verbatim and #endverbatim.
If you use a "code" style, be that markdown's ~~~ or doxygen's #code, there's a chance that current or future versions of Doxygen will start trying to colour it in syntactically.