Javascript

  • 26
    Jul

    Registering multiple event listeners to WebDriver

    Read More
  • 13
    May

    Jasmine / Jest notes from net

    **** https://docs.wso2.com/display/TA100/Overview **** https://betsol.com/2017/08/how-to-get-started-selenium-automation-framework/ #1. Parameterized Jasmine tests: ——————————– https://medium.com/@nyablk97/parameterized-tests-with-jasmine-ecadb2856980 #2. Java Exception handling best practices: ——————————————– https://howtodoinjava.com/best-practices/java-exception-handling-best-practices/ #3. Sonar cube: —————- Introduction to SonarQube #4. WebDriverIO specifications: ——————————–...

    Read More
  • 17
    Apr

    getters / setters in JavaScript classes

    function myClass(){ this.name; } myClass.prototype.setName = function(Name){ this.name = Name; } myClass.prototype.getName = function(){ return this.name; } var x = new myClass(); x.setName(“Jackychan Adventures”) console.log(x.getName()) output: ——– Jackychan Adventures

    Read More
  • 17
    Apr

    Javascript classes – another example

    function MyClass(){ this.name = “Sheetal”; this.address = “12311, Springwater Pt.” }; MyClass.prototype.setName = function(name){ this.name = name; }; MyClass.prototype.getName = function(){ return this.name; }; var y = new MyClass();...

    Read More
  • 17
    Apr

    working with Javascript class

    Following code snippet demonstrates usage of class in JavaScript: —————————————————————– var MyClass = function() { this.name = ‘Shinchan’; this.type = ‘cartoon’; }; MyClass.prototype.setName = function(name) { this.name = name;...

    Read More
  • 16
    Apr

    How to differentiate outer variable with same name in javascript closures

    Suppose the variable name in outerfunction is same as in inner function function outer() { var b = 10; var a = 100; function inner() { b = 20;...

    Read More
  • 16
    Apr

    closures in javascripts

    A closure is an “Inner function” that has access to Outer function, it’s parameters / variables along with access to “Global variables”. eg. myGlobalVar = 99; function outerFunction() {...

    Read More
  • 15
    Apr

    Perform sort with callback function in JavaScript

    If you need to sort your Array in your javascript, you can use following code snippet: ————————————————————————————– describe(“Functions to sort an Array via Callback() in JavaScript”, function(){ var myArray...

    Read More
  • 15
    Apr

    Understanding callback functions in javascript

    Callback functions in javascript are also called “Higher order functions”. In our code, if we want to execute a function right after the return of some other function, then...

    Read More
  • 15
    Apr

    Validating boolean return type of a function in Jest

    Following code snippet demonstrates how to validate boolean return values from a custom function: ————————————————————————————————– describe(“Functions to test return value of function in JavaScript”, function(){ function fetchData() { var...

    Read More
  • 1
  • 2