Specflow Generate Step Definition is missing from the context menu - selenium-webdriver

I right click on my feature file I should get the option to Generate step definitions. It is not there in the context menu.
I did a search and it says to install specrun for nunit.
I tried installing SpecRun.Nunit from Manage NuGet Packages.
I get the error:
Severity Code Description Project File Line Suppression State
Error Unable to load the service index for source
http://packagesource.
An error occurred while sending the request.
The remote name could not be resolved: 'packagesource' 0
I have Visual Studio Enterprise 2017 isntalled.
I have installed Selenium-webdriver, Specflow
How can I solve this issue please, thanks.

You need to install the specflow nuget package as well as the Visual Studio integration package from the menu item Tools -> "Extensions and Updates..."

Here's what I have to do to make the option appear in the context menu in VS2019.
I installed Specflow normally, from Extensions-> Manage Extensions,
then searched for Specflow for Visual Studio 2019.
Installed the package and re-started VS.
Then I created a new project, a C# Test.
Once the initial setup is ready, from the context menu in the
Solution Explorer I went "Add->New Item..." and selected "SpecFlow
Feature File", I typed in the info I wanted in my Feature file.
Over any of the Gherkin lines, I right clicked to get the context
menu and selected "Go to Definition". A dialog displays, telling me
that there is not a match, but I can save the lines in clipboard. I
selected Yes.
Then again on the Solution Explorer (like step 4), Right Click
"Add->New Item...", but now selected "SpecFlow Step Definition". The
Step Definition will be that for the calculator test.
Now here's the trick:
Delete all of the steps, leaving the main class empty.
Like this:
using System;
using TechTalk.SpecFlow;
namespace SpecflowFirst
{
[Binding]
public class SpecFlowFeature1Steps
{
}
}
Then paste the snippet you got from the dialog box inside the main
class
Like this:
using System;
using TechTalk.SpecFlow;
namespace SpecflowFirst
{
[Binding]
public class SpecFlowFeature1Steps
{
[Given(#"I navigated to the github login page")]
public void GivenINavigatedToTheGithubLoginPage()
{
ScenarioContext.Current.Pending();
}
}
}
This will trigger errors in the compilation. If you point to the error in "ScenarioContext" and do "Show potential fixes", one of the fixes will be to install "Sprecflow extension". With this you install the remaining integration that will now display the option in the context menu.
That fixed the issue to me and now I can see in the context menu "Generate Step Definitions"

I followed Kyon's excellent walkthrough, but this didn't work for me. Even though SpecFlow was installed correctly, it didn't recognise the following library, or make any suggestions to "Fix this issue":
using TechTalk.Specflow
Then I noticed that, with the a brand-new MsTest project and the latest VS2019 (as of October 2020) you need to install a slightly-earlier version of SpecFlow (v2.1 compared to v2.4).
So, if you're also having problems getting this illusive "Generate Step Definitions" menu item to appear, check out your Dependencies\Packages for any exclamation marks.

Related

ToastContentBuilder could not be found

I'm trying to use toast notifications in my Windows app, and I'm using the following code...
new ToastContentBuilder()
.AddText("Hello");
But I'm getting the following error...
error CS0246: The type or namespace name 'ToastContentBuilder' could not be found (are you missing a using directive or an assembly reference?)
You need to install the Microsoft.Toolkit.Uwp.Notifications NuGet package!
In Visual Studio's solution explorer, right click your project, click "Manage NuGet Packages", search for "uwp notifications" and install the Microsoft.Toolkit.Uwp.Notifications package.
Then, IntelliSense should suggest adding the following using statement...
using Microsoft.Toolkit.Uwp.Notifications;
After that, everything should be working!

['type aliases' can only be used in a .ts file]

I use command react-native init "name project" then open vscode appear to have error message code. (image)
This is what you need to do with VS Code, observe the gif carefully
Steps to resolve error
1. Go to extension
2. Click on more (...) and select Show Built-in extension
3. Search "TypeScript and JavaScript Language Features" - yellow & blue icon
4. Click on Setting icon of extension and select Disable (workspace)
5. Click on Reload / Restart Required
If you are getting this in React Native its probably a known bug in VSCode, that when Google Flow (which competes with MS Typescript) is coded, shows errors erroneously mentioning Typescript.
Your current .js code is supposed to be preprocessed by Flow into another .js file with "proper" js.
So make sure Flow is installed and then disable the Typescript parsing support. Here's the official answer on the Flow installation webpage:
Set javascript.validate.enable option to false or completely disable
the built-in TypeScript extension for your project (see gif below)...
Otherwise, you may want to stay as is and just change your code as suggested by C2P1 on March 19, 2018 on the github issue 631
To disable the [js] parser (connected to Typescript),
In VSCode menu: File -> Preferences -> User settings, (or ctrl+,) and add the following line
"javascript.validate.enable": false,
This answer was completed after seeing Idan Dagan's answer (Not the accepted answer) here: js 'types' can only be used in a .ts file - Visual Studio Code using #ts-check
And here's an excellent albeit old page about setting up the react-native environment, from Hackernoon. (You also have the VSCode React-native-full plugin)
Just disable built-in extension for TypeScript in VSCode. On the VSCode Extensions choose "Show Built-in Extensions" and then search for "TypeScript and JavaScript Language Features", Click disable then reload the VSCode. It works for me
In VScode
Press
CTRL + SHIFT + P
Use this command
Open User Settings
copy and paste the next line in the search bar in settings
#ext:vscode.typescript-language-features
ready uncheck JavaScript validation
Helped me to resolve
To disable the [js] parser (connected to Typescript),
In VSCode menu: File -> Preferences -> User settings, (or ctrl+,) and add the following line
"javascript.validate.enable": false,
This is what you are looking for. Unfortunately I haven't Googled a proper solution but we have to disable some JS checking.
https://github.com/Microsoft/vscode-react-native/issues/631
I've solved this with a plugin for VSCode "Flow Language Support". It will control the errors of the code instead of the plug-in TS-JS (built-in plugin of VS Code). In Details of plugin, guides you how to disable the original plugin TS-JS VSCode.
instead of disabling Typescript and Javascript language features extension, you can go to the extension settings, find the option Javascript > Validate: Enable, and uncheck it to remove any warnings.

Class 'SqlFormatter' is missing CAKEPHP 3 DebugKit

I've just installed the latest Debugkit from https://github.com/cakephp/debug_kit.
Everything is working. However, when I clicked on the "SQL Log", the CakePHP logo keeps spinning. I tried to debug by opening up the console.log and saw an 500 error. It shows the below.
Error: Class 'SqlFormatter' not found
File /Applications/MAMP/htdocs/App/vendor/cakephp/debug_kit/src/Template/Element/sql_log_panel.ctp
Line: 24
From my understanding, SqlFormatter class is not found in sql_log_panel.ctp. How can I add/declare the SqlFormatter class?
Just install it via composer, problem very likely solved then.
https://getcomposer.org/doc/00-intro.md
http://book.cakephp.org/3.0/en/installation.html#installing-cakephp
I highly recommend you to become familiar with composer, it is a standard tool for php developers for some time now. Composer will automatically install the dependencies for you.
Your second best option would be to download the SqlFormatter package manually from where ever it comes from and set your autoloading or include manually up.

Android Studio: Register.Activity.class displays Register.Activity in RED even though code compiles

After generating Cloud code and adding this line to MainActivity:
Intent intent = new Intent(this, RegisterActivity.class);
Android Studio displays "RegisterActivity" in the color RED. Hovering yields "Cannot resolve
symbol 'RegisterActivity'
I ignored it, the code runs, but I wonder how to make it not RED and how to fix the "Cannot resolve"... error
thanks
-a
Usually clicking the Sync Project with Gradle Files button will solve this problem.
I have also faced the same problem earlier.
Solution : Add a dependency of your android module(eg : app) with the module which contains the Register activity(eg : app-endpoints).
* Dependancy can be added through module settings or clicking on the "help" popup bulb the comes in the left side of the erroneous code.
Note : Clean and re-build your project after adding dependency injection.

Missing Ubuntu.Components QML Module

I installed QTCreator and Ubuntu SDK as shown here.
When trying to run the code sample provided here, QTCreator tells me it can't find the Ubuntu.Components QML Module.
Notes:
The build-logs says:
file:///home/giladnaaman/Programming/Projects/CurrencyConverter/CurrencyConverter.qml:2 module "Ubuntu.Components" is not installed
But the directory /opt/qt5/imports/Ubuntu/Components
exists (and is full of files).
After adding importPaths: [ "/opt/qt5/imports" ] to the qmlproject file:
QML module does not contain information about components contained in plugins.
QMetaType::registerType: Binary compatibility break -- Type flags for 'QPaintBufferCacheEntry'[1024] don't match. Previously registered TypeFlags(0x103), now registering TypeFlags(0x3).
Do not add the importPaths property to the qmlproject.
Did you setup the QML Scene as your QML viewer?
In Qt Creator, go to Tools > Options…
Choose the External Tools tab, then in the pane select the Preview (qmlviewer) entry
On the Executable: field on the right, replace the contents with /opt/qt5/bin/qmlscene.
Optionally change the command name by double-clicking on the Preview (qmlviewer) entry from above. You can call it Preview (qmlscene).
Click on OK to save the changes.
you’ll be able to view your app through the Tools > External > Qt Quick > Preview (qmlscene)
The Ubuntu SDK is still using the older version of Qt Creator from QT4 it will not be able to locate the Ubuntu Components, and say the components are not found. But the QML Scene used for running the QML GUI will load it and run it without any problems.

Resources