Unresolved functions or methods using CodeceptJS in PhpStorm - intellij-idea

I've just followed the CodeceptJS Quickstart and opened first_test.js in the PhpStorm IDE (equivalent to WebStorm, IntelliJ, etc.).
For all the built-in functions, I'm getting "Unresolved function or method …":
I also don't get any autocompletion on I.
I've tried the following.
Looked for a CodeceptJS plugin. Didn't find any.
Enabled codeceptjs/node_modules in Settings -> Languages & Frameworks -> JavaScript -> Libraries.
Set JavaScript language version to ECMAScript 6.
Enabled the Node.js Core library.
Restarted PhpStorm.

Please run 'npm install codeceptjs'.

I had to follow the steps outlined in https://codecept.io/typescript/ to fully enable CodeceptJS in PHPStorm.
Steps
npm install codeceptjs typescript ts-node
Add require('ts-node/register') as first line in my codecept.conf.js file
Create a tsconfig.json in my project root folder
Run npx codeceptjs def to create the default steps.d.ts file
After that, autocompletion worked in my tests :)

Related

What configuration do I need to run TestCafe in WebStorm

I would like to run/debug TestCafe tests using WebStorm. Does anyone have
a suggested configuration I need to do this?
WebStorm doesn't provide any special support for TestCafe (if you miss it, please vote for WEB-30315); but you can use VS Code instructions to run/debug in WebStorm. Namely, you need Node.js Run configuration like the following:
where JavaScript file: is set to a path to your locally installed testcafe module, e.g. node_modules\testcafe\bin\testcafe.js, and Application parameters: are testcafe cli args, like chrome myTestFile.js

IntelliJ Angular project throwing TSLINT error for HTML files in WebStorm

What steps will reproduce the issue?
Create Angular project in IntelliJ via angular-cli (version 1.5)
Open the same project in WebStorm; open any of the HTML files.
It will throw TSLINT error
What Angular and Typescript version do you use? Looks similar to WEB-30045, caused by lack of TypeScript 2.6 support in Angular (https://github.com/angular/angular/issues/20146)
Another related problem is https://github.com/Microsoft/TypeScript/issues/18322
WebStorm TypeScript version should match the one used by Angular. The version of TypeScript used by Angular is set in
package.json
To do so, select
Prefereces... > Languages & Frameworks > TypeScript
and then, from the TypeScript dropdown, select the node_modules TypeScript installation instead of "Bundled".
Click OK and restart WebStorm.

How do I get WebdriverIO autocomplete on VS Code

Is there a way I can get autocomplete on VS Code for webdriverio?
Other code editors like Intellij provide something like Settings -> Preferences -> Languages & Frameworks -> JavaScript -> Libraries
From there we can add a directory with webdriverio commands
How can I do similar thing with VS Code?
my understanding is, vscode is built with typescript and by default it does not support autoComplete(Intellisense) on a package that is built with javascript. So all the js package creators would provide an #types file. These #types file help vscode to find all the function definitions, object properties. etc., etc., of your JS package and show as suggestions. Which in case here is webdriverio package.
So adding a #types dependency that is related to your JS package will mostly fix the issue.
i.e.,
npm install #types/webdriverio --save-dev
After adding the package, i started getting the browser object suggestions.
All the above works fine for v4 version of WDIO.
If you are using v5 version: Then as per their official documentation we need to create a jsconfig.json file on the root directory.
Above answer worked well :
you need to install below dependency :
if you are using webdriverio v4 (for cucumber BDD ) use below
npm install #types/webdriverio#4 --save-dev
or use :
npm install #types/webdriverio --save-dev
VSCode Intellisense
Using #types/webdriverio is not suggested by webdriverio and it is now deprecated:
npm WARN deprecated #types/webdriverio#5.0.0: This is a stub types definition. webdriverio provides its own type definitions, so you do not need this installed.
I would suggest to follow the official documentation by WebDriverIO here:

Compile Erlang in Intellij

I try compile erl files in Intellij with Erlang plugin. Everything is good with compilation but in out/production the folder does not create any files .beam and when I run console I get message:
exception error: undefined function.
When I use c("file"). everything is all right. Why does Intellij not create .beam files?
Try to fix it by going to Preferences -> Build, Execution, Deployment -> Erlang Compiler and check "Compile project with rebar".
Also, verify that rebar is installed and configured in IntelliJ by going to Preferences -> Other Settings -> Erlang External Tools and specifying the path to the rebar installation.
I was having the same issue ..
The problem is very strange erlang plugin doesn't compile and copy the files to out directories meanwhile if you compiled from terminal or command prompt (windows) it is working fine. this issue arose after installing IntelliJ Idea v 15.
What I have done here to fix the issue:
Uninstall Intellij Idea v 15
Downgrade IntelliJ Idead to version 14.1.4
Install Intellij Idea again (v. 0.5.11)
Configure SDK to reference src of erlang language.
Create a new test project and start making the project again .. it should work fine...
Hope this helps you

How to generate JavaScript files from CoffeeScript in IntelliJ IDEA?

I'm trying out CoffeeScript support in IntelliJ, and although the highlighting/completion/refactoring support looks great, I can't figure out a way to automatically compile my .coffee files to their .js counterparts in order to use them in web pages, unit tests, etc.
The documentation mentions using Node for this purpose, but I'm primarily interested in writing client side code. I'd probably be able to create a run configuration that would use Cake to create my JS files, but this won't integrate nicely with IDEA's integrated unit test support, etc.
So... any help?
Use the IntelliJ IDEA plugin: File Watchers.
You would need to install coffee-script package in the global directory. (npm install -g coffee-script).
While you are editing the CoffeeScript file in IntelliJ editor, there would be a notification showing on the top.
Click "Add watcher" and the IDE will compile your code for you on the fly.
More advanced options could be accessed via Project Settings/File Watchers.
See also the official document.