Prerequisite: Download and Setup Microsoft Visual Studio Code
Adding JavaScript Support to Microsoft Visual Studio Code
Setting up the Project
Adding JavaScript Support to Microsoft Visual Studio Code
Click on Help
under Customize section, click on Javascript
Setting up the Project
1.) Create a new Folder
2.) Under that folder lets create 2 Folders a.) conf b.) tests
Now for BDD tests in protractor we use Jasmine, Jasmine is an open source framework for JavaScript
3.) Go to the location(C:\Users\T460\AppData\Roaming\npm\node_modules\protractor\example)
Lets copy and paste conf.js and example_spec.js to our above created project
Under conf folder copy and paste-->conf.js
Under tests folder copy and paste--> example_spec.js
Under conf.js set Realtive path of example_spec.js
As our example_spec.js we have copied to tests folder, lest set relative path in conf.js to
specs: ['../tests/example_spec.js']
Running the Project in Visual Studio Code
Go to terminal and enter
PS C:\Users\T460\Desktop\Projects\ProtractorSample> protractor .\conf\conf.js
Install Code Runner Extension in Visual Studio Code
You will get Run button that will help running your code instantly
Now we are ready to write Test cases
Lets find out AngularJS Application, for this we need Addon (WhatRuns and Wappalyzer )
These 2 addons will tell you website is made on what TeckStack
Jasmine Cheat Sheet
This will help in writing test cases
Install Addon Protractor Snippets in Visual Studio Code
This addon will help in writting Test Cases with Snippet with shortcuts
No comments:
Post a Comment