Snap shot of framework which we will be designing.
Things required for Automation script to work
- Download WebStorm IDE:-
- Download Node JS:-
- Download JDK(Java):-
Things required for setting up webstrom IDE
- Open Webstorm IDE and go to “File” and “open” Folder “PartnerPortal” root directory( download link is shared at the last).
- Click on the “Edit Config” and enter the details as mentioned in the (Step 03)
- Click on the “Node.js” to link to CLI file from NPM module as mentioned in the(Step 04).
4. Give the Name “ProtactorPartner” portal(any unique name) and set the properties as mentioned below.
- Node interpreter: – C:\Program Files\nodejs\node.exe
- Working director: – C:\protractor\Website.Tests
- Java Script File: C:\Users\##### \AppData\Roaming\npm\node_modules\protractor\built\cli.js
(Appdata is hidden folder under your user name folder)
- Application parameters: – ./Website.Tests/conf/conf.js (we have to specify the project config file path here)
5. Restart your Webstorm to see the changes like below.
Running your first Test
- Start Selenium server Before you start a test be sure you have Selenium standalone server running. You can do this by opening a new cmd prompt window and entering following command:
When you see ‘Selenium started’ message in cmd prompt window this means Selenium works fine. Be sure to leave the window open! It runs the selenium-standanlone server.
2. Running tests by using ‘protractor’ commands. Open a new commandline, go to the “PartnerPortal” root directory and do one of the following things:
- Run all test scripts with command:
- Run specific test scripts with command:
- You can find the available test suites in the conf.js file.
Testing in specific environment from command line
By default tests are running in acceptance environment. If you want to change this you need to do following:
Testing in specific browser
By default tests are running in Chrome. If you want to be able to run tests also in Internet explorer and firefox you need to install the specific browser drivers for it. Once you install one of them you also need to install the chrome driver to be able to keep tests in chrome working.
- For Internet Explorer: Install Selenium IE driver by downloading .exe file from https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver (click on downloads link, then select latest version folder and select IEDriverServer_Win32_3.3.0.zip or IEDriverServer_x64_3.3.0.zip). Add .exe file somewhere on your system (for instance C:/windows/system32) and also add it to your path file.
- For Firefox: Install Selenium Geckodriver by downloading .exe file from https://github.com/mozilla/geckodriver/releases. Add .exe file somewhere on your system (for instance C:/windows/system32) and also add it to your path file.
- For Chrome: Install Selenium Chromedriver by downloading .exe file from https://sites.google.com/a/chromium.org/chromedriver/downloads (Click on latest release link and download .zip file). Add .exe file somewhere on your system (for instance C:/windows/system32) and also add it to your path file.
for testing in specific browsers enter following in command line (by default tests will run in Chrome):
when running one or more tests a report of these tests will be created. You can find the report in following folder \PartnerPortal\Reports\ htmlReports
When you did not run any tests yet, this folder won’t exists yet, because it is being generated.
Reports are browser specific and created in XML and HTML format.
Once you ran a test you will also see a ReportToMail.zip being added to the reports folder. This can be used to send to the stakeholders at the end of the sprint, so they will also be able to see the regression test results.