Search code examples
javascriptseleniumtestingconnectioncucumber

How to use javascript to run automated tests in browser using selenium+CUCUMBER


Well, I am kinda new to this. First of all, my main goal is to execute a simple cucumber example which tests automatically something extremely simple as well.By doing this I will try to get the idea of how should i do other kind of autmated test. So, I wrote some scenarios, and I want to test them somehow on a site(e.g. google.com). The site is written in JS and therefore I need to write JavaScript code to "connect" the scenarios with the language.

I google searched things like: "How to automatically test a site using cucumber" "How to automatically run scenarios with selenium-javascript" and so on...

Any ideas? No hatefull comments please :/ Thanks in advance!

DL.


Solution

  • I wrote some scenarios,

    When you say that I believe you are able to execute your testcases with cucumber

    The site is written in JS and therefore I need to write JavaScript code to "connect" the scenarios with the language.

    thats not necessary, if you are site is based on javascript like AngularJS you can still use simple java + selenium but protractor is recommended for same as it have wrapper. protractor is a nodejs based project to deal with sites based on AngularJS.

    https://www.protractortest.org/#/

    How to automatically test a site using cucumber

    You can use a CI/CD tool like jenkins which you can trigger manually or you can put an scheduler who will run all your test script against your website on it. You can also turn on the notification so when ever the test complete it will shoot an email to respective individuals

    Refer:

    https://jenkins.io/

    You can get n number of tutorial regarding same. example:

    Click Here