How to use import/code suggestion in VS Code [Protractor tutorial] | LetCode

preview_player
Показать описание
#letcode #protractorb #babel
In this video, I have discussed the common problem that is how to get the code suggestion or vs code IntelliSense in a javascript file or our test script
by using import in the test script.

How to use import - code suggestion in VS Code
------------------------------------------------------------------------------

require("babel-register")({
presets: ["es2015"]
});
------------------------------------------------------------------------------
"devDependencies": {
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0"
}

congratulations, You're ready to use import statement in js
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Music credit:
Song: Wonki - Sunset Paradise
Music provided by Vlog No Copyright Music.

Behind the screen,

Join our Facebook group,

Protractor from scratch with JavaScript & TypeScript

JavaScript tutorial from basic to advance level for test automation

TypeScriptJava tutorial from basic to advance level for test automation

Chrome extension development tutorial - XPath Tool

Selenium - Java, not the basic stuff (weird)

Fun time videos, enjoy coding :)

Thanks for watching :)
Intro & Outro
music credit
song: To my soul

Channel search
letcode "letcode koushik" LetCode "letcode automation" "letcode javascript" "letcode chrome extension" "letcode protractor" "letcode testing" "letcode selenium" selenium protractor javascript "chrome extension" java "letcode java"
Рекомендации по теме
Комментарии
Автор

You are the savior of Protractor + vs code! I was searching like mad but no where got the solution.
Super thanks....
However while doing this I got an update fix for the same.
Instead of using babel-preset-es2015 which is deprecated, we should use babel-preset-env, as this is the latest one and is suggested by babel
So the updated code would be:
Install:
1- uninstall babel-es2015
npm uninstall babel-preset-es2015
2- install latest babel env
npm --save-dev babel-preset-env
3- Install babel-register ( ignore if already installed)
npm --save-dev babel-register
add this conf.js
require("babel-register")({
presets: ["env"]
});
add import { browser, element, by } from "protractor" to your spec/js/ts files.
Hope this helps.

avishekbehera
Автор

thanks a lot .Rectified my error which i was struggling to get it resolved from long.

heenamehra
Автор

Hi Koushik thanks a lot for this video, i was not getting auto suggestion and here i got solution.

swethaputti
Автор

Hi Koushik ...am not able to import element and by ...why ??? I have just entered those two keys in import statement but it is not working

swathys
Автор

your video is very helpful...thanks....

venkatadanthuluri
Автор

Hey koushik,
I have this doubt . I am storing the spec file inside one folder, so after installing babel , i still get error over browser, protractor. But when i copied same file and pasted out side the folder on root level, error disappeared. Can you tell why it works like that.

ThePunitichauhan
Автор

Didnt work, firstly when I try to install both packages it gives error asking to me to configure in npm installed in program files. Also tried adding require statement in config file, there also got error saying error in config file

spidyniks