accessing tags in the code always yields undefined - cypress-cucumber-preprocessor

According to the docs from #badeball one can access the tags used in .feature files from within the code using the Cypress environment variable tags or TAGS.
Example for a tag: #TEST_FOO-42
However I only get empty log lines for:
cy.log(Cypress.env('tags'));
cy.log(Cypress.env('TAGS'));
And
cy.log(typeof Cypress.env('tags'));
cy.log(typeof Cypress.env('TAGS'));
Yields undefined. What do I miss?

It turns out this is not possible. Cypress.env('tags') does not access the tags of a test but instead yields the runtime tags argument as in cypress run -e tags='#foo and #bar'. See also:
https://github.com/badeball/cypress-cucumber-preprocessor/issues/774#issuecomment-1193914180

Related

testcase failed when getting variable output from bot using botium box

I am using botium-box. I have the following convo file:
Here the date is a variable and changes everyday so I have to change it everyday in convo file otherwise the testcase is failing.
I have tried few solutions:
setting SCRIPTING_ENABLE_MEMORY to true in advance settings and using
placeholder for variables. For eg.
I tried setting INTENT_CONFIDENCE to 70 in advance settings and using
in convo file. For eg:
I tried INTENT_CONFIDENCE directly in convo file without setting it in advance capabilities. For eg.
I tried using %s in place of variable. For eg.
Testcases are still failing. Is it a bug? Do I have to change any Botium settings? How can I do partial matching of responses?
Solution 1 should be working (see here and here). If it doesn't work, please attach log file for analysis.
Options 2 and 3 are for something totally different (verification of intent resolution confidence), and Option 4 is not a Botium feature.
What you can try as well: Botium by default does substring matching for assertions, so your convo file could look something like this:
#me
what is the date today ?
#bot
Today is

Access to the jEdit variables from SuperAbbrevs template

I wonder if there is any way how to access jEdit variables (like the buffer variable) from the beanshell inside SuperAbbrevs plugin template.
When I try to expand following template, the error Attempt to resolve method: getName() on undefined variable or class name: buffer appears int Activity log.
<#= buffer.getName() #>
When I try to run this code in the BeanShell console then it displays the current buffer name:
buffer.getName()
Is it possible to access buffer name from the SuperAbbrevs template?
As far as I can see from a quick look at that plugins sources, those variables are not forwarded to the templates. Only the variables you define in the options of the plugin and additionally filename and selection.
In your example filename is exactly what you want, so <#= filename #> works for inserting the name of the file. If you would need more, you would probably need to issue a plugin feature request.

how to verify text present in placeholder in selenium IDE

I want to verify the text present in placeholder. I have located the element and i am using Assert text command. I've entered the same string in value. On executing it is showing actual value did not match
Use assertAttribute or verifyAttribute command.
Example:
verifyAttribute | css=#search#placeholder | Sample String
Notes:
In the Target column of Selenium IDE, you need to provide the proper path of the element followed by an # sign
and then the name of the attribute. (placeholder in your case)
Using
verifyAttibute will still continue running the test case once an
error is detected while using assertAttribute doesn't.
You need to understand that assertText function can only check static text on your webpage.
You must be getting an error message.
This is perfectly normal.
What can help in this situation is using the assertAttribute or verifyAttribute functions.
Both these functions perform the same task; the former stops the test after receiving an error message in the text box while verifyValue just records the error in the log and runs the next commands.
While giving the target, either specify the XPath or refer by using the name=name#placeholder format.
You can find the name value by inspecting the box with a firefox addon called Firepath which runs with another firefox tool called Firebug. Install them if you don't already have.
Hope this helps!
Xpath contains() is the best way.
driver.find_element_by_xpath('//input[contains(#placeholder,"email")]')
Format : '//tag[contains(#attribute,"value")]'

$this->request->getArgument('group'); not working outside the plugin for breadcrums

I building an TYPO3 extension, withs contains a frond-end plugin. In the fluid template I'm using the following link. This links contains the argument named "group" to send the value "3" to the page.
<f:link.action pageUid="1" pluginName="PluginAds" controller="Ads" arguments="{group: 3}">
In the controller "PluginAds" under "AdsController" it works ok to get the value with the following action:
$this->request->getArgument('group');
But I also want to use the argument "group" for generating the correct breadcrums link. But when I use the same code in a different controller I'm getting the error that the argument does not exists. Can anyone help on this?
Inspect with browser tools how does f:link.action constructs prefixes for params of your plugin, it's i.e.: tx_extkey_pluginsname[myparam]
Within the plugin's actions you can get myparam by
$this->request->getArgument('myparam')
anyway anywhere else you need to get it as normal GET array, so it will be something like:
$pluginsParams = GeneralUtility::_GET('tx_extkey_pluginsname');
$myParam = $pluginsParams['myparam'];
Other thing is that you should always check if:
$this->request->hasArgument('group')
Before trying using it, otherwise it can lead you to null pointer exception.

Karma html2js doesn't seem to have created any __html__ array

I am attempting to set up tests for a Polymer application using Karma. However an essential element of those tests is the basic html fixture.
However, when I get to the code that tries to read the __html__ array. this gives an undefined.
I have included all the key files in a gist
https://gist.github.com/akc42/121c619ef2476ce82086
Because polymer.js needs to be loaded as the first script in head, and because Karma includes all the files as script tags, I have a PolymerTests.js script which adds the Polymer element to the head. It also defines a load fixtures function which should read one of the files that have been placed in __html__ and adds it to a container div in the main body of the test page.
var container; //Used to hold fixture
PolymerTests.loadFixture = function(fixture,done) {
container = document.createElement("div");
container.innerHTML = __html__[fixture];
document.body.appendChild(container);
waits(0);
done();
};
This is called in a beforeEach routine for a specific test.
However when I get there, I get undefined.
EDITED
The question of course is has anyone any idea how to work out what I am doing wrong. I tried a debug session, but can't see window.__html__ defined anywhere.
In order for the pre-processor to actually put files into the __html__ array is is necessary to ensure the files are also included in the "files" section of the karma configuration file. If there are not included there, they won't be put into the array.
Probably you also use ng-html2js preprocessor. And they have ugly thing in index.js:
// TODO(vojta): remove this in 0.11
'preprocessor:html2js': ['factory', require('./html2js')]
After removing it, it will work.