Using JIRA

Overview JIRA

What is a Board ?

A board displays issues from one or more projects, giving you a flexible way of viewing, managing, and reporting on work in progress. There are two types of boards in Jira Software:

  • Scrum board: For teams that plan their work in sprints. Includes a backlog.
  • Kanban board: For teams that focus on managing and constraining their work-in-progress. Includes the option of a Kanban backlog.

What is a Epic ?

An epic captures a large body of work. It is essentially a large user story that can be broken down into a number of smaller stories. It may take several sprints to complete an epic.

What is a Sprint ?

A sprint — also known as an iteration — is a short (ideally two to four week) period in which the development team implements and delivers a discrete product increment, e.g. a working milestone version.

Introduction to JIRA & Agile Project Management

  • Introduction to JIRA & Agile Project Management
  • Install JIRA

    Downlaod JIRA

    Install JIRA on Windows 7

    D:\Program Files\Atlassian\JIRA\bin> dir \software
    20.01.2018  15:16       350.857.328  atlassian-jira-software-7.7.0-x64.exe
    
    As Administrator run: atlassian-jira-software-7.7.0-x64.exe
    Select: 
      Advanced Mode for installation 
      Ports 9080 9005     [ change Ports if needed ]
      Start as a service  [ Start JIRA as a service ]
    Login: 
      Email: 	   Helmut.Hutzler@gmail.com
      Benutzer:  Helmut.Hutzler
      Password:  .....it
    Config: 
      Running the Setup Wizard 
    

    Reference JIRA Installation

    Run JIRA on our local System JIRA

    • Note the Link below: http://localhost:9080/secure/Dashboard.jspa works ONLY on my local System !
    • Run JIRA Dashbaord

    Working with JIRA

    Create a Board using multiple Projects

    Create an Agile Board from Existing Projects
    Image jira_img1.jpg NOT Found
    Add multiple projects to the Board
    Image jira_img2.jpg NOT Found

    Add a new Project to an existing Board

    Boards -> View All Boards -> Configure -> Edit Filter Query -> Press Left Menu Button -> Add/Delete Projects
    Image jira_img3.jpg NOT Found

    Reconfigure JIRA by running Setup Wizard again

    Stop JIRA 
    D:\Program Files\Atlassian\JIRA\bin> stop-jira.bat
    
    Delete dbconfig.xml 
    D:\Program Files\Atlassian\Application Data\JIRA> del dbconfig.xml
    
    Delete Database Files 
    D:\Program Files\Atlassian\Application Data\JIRA\database> dir
    21.01.2018  10:16         2.838.528 h2db.mv.db
    21.01.2018  09:18            16.208 h2db.trace.db
                   2 Datei(en),      2.854.736 Bytes
                   2 Verzeichnis(se), 82.347.048.960 Bytes frei
    
    D:\Program Files\Atlassian\Application Data\JIRA\database> del *.db
    Möchten Sie "D:\Program Files\Atlassian\Application Data\JIRA\database\*" löschen (J/N)? j
    
    Open JIRA Baseurl to restart the configuration process: http://localhost:9080/
    

    Reference

    Using Mocha and Selenium

    Install Mocha, Chai, Selenium and Chromdriver

    Init local Repository

    D:\xampp\htdocs\pvdata\testSelenium\test> npm init
    ..
    package name: (test) testselenium
    version: (1.0.0)
    description: test Selenium and Mocha
    entry point: (googlePage.js) test_s5.js
    test command:
    git repository:
    keywords:
    author: Helmut
    license: (ISC)
    About to write to D:\xampp\htdocs\pvdata\testSelenium\test\package.json:
    
    {
      "name": "testselenium",
      "version": "1.0.0",
      "description": "test Selenium and Mocha",
      "main": "test_s5.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "author": "Helmut",
      "license": "ISC"
    }
    
    Is this ok? (yes)
    ..
    

    Install local Nodejs Modules

    D:\xampp\htdocs\pvdata\testSelenium\test > npm install chromedriver@2.34.1 --save
    
    > chromedriver@2.34.1 install D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\chromedriver
    > node install.js
    
    Downloading https://chromedriver.storage.googleapis.com/2.34/chromedriver_win32.zip
    Saving to D:\Users\helmut\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
    Received 781K...
    Received 1568K...
    Received 2352K...
    Received 3136K...
    Received 3222K total.
    Extracting zip contents
    Copying to target path D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\chromedriver\lib\chromedriver
    Done. ChromeDriver binary available at D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
    npm notice created a lockfile as package-lock.json. You should commit this file.
    npm WARN testselenium@1.0.0 No repository field.
    
    + chromedriver@2.34.1
    added 96 packages in 14.552s
    
    D:\xampp\htdocs\pvdata\testSelenium\test> npm install selenium-webdriver@3.6.0 --save
    npm WARN testselenium@1.0.0 No repository field.
    
    + selenium-webdriver@3.6.0
    added 14 packages in 4.256s
    
    D:\xampp\htdocs\pvdata\testSelenium\test> npm install chai --save
    npm WARN testselenium@1.0.0 No repository field.
    
    + chai@4.1.2
    added 7 packages in 2.129s
    

    Verify Local Module Status

    D:\xampp\htdocs\pvdata\testSelenium\test> npm  list --depth=0
    testselenium@1.0.0 D:\xampp\htdocs\pvdata\testSelenium\test
    +-- chai@4.1.2
    +-- chromedriver@2.34.1
    `-- selenium-webdriver@3.6.0
    

    Install Mocha as a Global Nodejs Module

    D:\xampp\htdocs\pvdata\testSelenium\test> npm -g install mocha@4.1
    D:\Users\helmut\AppData\Roaming\npm\mocha -> D:\Users\helmut\AppData\Roaming\npm\node_modules\mocha\bin\mocha
    D:\Users\helmut\AppData\Roaming\npm\_mocha -> D:\Users\helmut\AppData\Roaming\npm\node_modules\mocha\bin\_mocha
    + mocha@4.1.0
    updated 1 package in 4.61s
    

    Verify Global Package Status

    D:\xampp\htdocs\pvdata\testSelenium\test> npm  list --depth=0  -g
    D:\Users\helmut\AppData\Roaming\npm
    +-- eslint@4.16.0
    `-- mocha@4.1.0
    

    Testscripts

    Script: test_s4.js

    require('chromedriver');
    var assert = require('chai').assert;
    var selenium = require('selenium-webdriver');
    var test = require('selenium-webdriver/testing');
    var driver;
    var GooglePage = require('./googlePage.js');
    
    const timeOut = 15000;
     
    test.describe('Testing Google Search Page', function() {
      test.beforeEach(function() {
      	dumpMessage("-> beforeEach Hook");
        this.timeout(timeOut);
        driver = new selenium.Builder()
        	.forBrowser('chrome')
        	.build();
      	var googlePage = new GooglePage(driver);
        googlePage.view();
    
      });
      
      test.it( 'Working TestCase' , function(){  
        this.timeout(timeOut);
      	driver.getTitle().then(function(title){
      		dumpMessage("Found Page Title: " + title);
      		assert.equal("Google",title );
    	});
    	dumpMessage("--> Start Processing" ); 
    	driver.findElement(selenium.By.name('q')).sendKeys('webdriver');           // Fill in the  Search String for Google Search 
    	driver.findElement(selenium.By.name('btnK')).click();					   // Start the Google Search 	
        dumpMessage("--> Leaving Processing" ); 
      });
      
        test.it( 'Failing TestCase' , function(){  
        this.timeout(timeOut);
      	driver.getTitle().then(function(title){
      		dumpMessage("Found Page Title: " + title);
      		assert.equal("xGoogle",title );
    	});
    	dumpMessage("--> Start Processing" ); 
    	driver.findElement(selenium.By.name('q')).sendKeys('webdriver');           // Fill in the  Serach String to the 
    	driver.findElement(selenium.By.name('btnK')).click();					   	// Start the Google Search 	
        dumpMessage("--> Leaving Processing" ); 
      });
                
      test.afterEach(function() {
      	  var promise;
      	  var waitTime = 2000;       // Keep the browser window 2 seconds open before calling driver.quit()
      	  this.timeout(10000);       // Increase Timeout ot avoid Error: Timeout of 2000ms exceeded. 
    								 // If returning a Promise, ensure it resolves.        
        	promise = new Promise(function(resolve, reject){
            	setTimeout(function(){
               		dumpMessage("-> afterEach Hook Promise called - WaitTime: " +  waitTime );
               		driver.quit();
                	resolve();
            	}, waitTime);
     		});
        	// mocha will wait for the promise to be resolved before exiting
        	return promise;      		
      	dumpMessage("-> afterEach Hook");
      });
    
    });
    															 		// Helper Functions 							
    function dumpMessage(mesg) {                                        // console.log at top level will create a undefined message
    	console.log(getTime() + mesg);                                  // Provide a wrapper function which returns some data 
    	return "---------------------------------------------------";	
    }
    
    function getTime() {
    	var ts = new Date();
        return ts.toLocaleTimeString()+ ":" + ts.getMilliseconds() + "  ";
    }
    

    Script: googlePage.js

    var webdriver = require('selenium-webdriver');
     
    GooglePage = function GooglePage(driver) {
      this.driver = driver;
      this.url = "http://www.google.com/ncr";
    };
     
    GooglePage.prototype.view = function() {
      this.driver.get(this.url);
      return webdriver.promise.fulfilled(true);
    };
     
    module.exports = GooglePage;                     // export the module so in an be imported with the require syntax
    

    Running the Mocha/Selenium Testcase

    Testcase Overview

    • Testcase consists out of 2 tests !
    • Both tests starts and closes the Chromedriver
    • Testcase 1 should work !
    • Testcase 2 should fail !

    Testcase Details

    Command: mocha test_s5.js
    Image mocha_img4.jpg NOT Found

    A more complete Testcase

    NetBeans Output

    Press F6 in Netbeans to Start Test Scripts
    Image mocha_img10.jpg NOT Found

    Reference

    Using Selenium Webdriver with Javascript

    Introduction Selenium-WebDriver

    • The WebDriverJS library uses a promise manager to ease the pain of working with a purely asynchronous API
    • Rather than writing a long chain of promises allows you to write synchronous code by using a blocking API

    Sample using a chain of promises [asynchronous Mode]

    const {Builder, By, until} = require('selenium-webdriver');
    new Builder()
        .forBrowser('firefox')
        .build()
        .then(driver => {
          return driver.get('http://www.google.com/ncr')
            .then(_ => driver.findElement(By.name('q')).sendKeys('webdriver'))
            .then(_ => driver.findElement(By.name('btnK')).click())
            .then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000))
            .then(_ => driver.quit());
        });
    

    Sample using a chain of promises [synchronous Mode]

    const {Builder, By, until} = require('selenium-webdriver');
    
    let driver = new Builder()
        .forBrowser('firefox')
        .build();
    
    driver.get('http://www.google.com/ncr');
    driver.findElement(By.name('q')).sendKeys('webdriver');
    driver.findElement(By.name('btnK')).click();
    driver.wait(until.titleIs('webdriver - Google Search'), 1000);
    driver.quit();
    

    Understanding the Promises Chain

    Selenium Code:
    driver.sleep(4000);                       // Let the chromedriver Browser open for 4 seconds to review results
    driver.quit();
    
    Logger Output:
    [2018-01-17T09:37:13Z] [WARNING] [promise.ControlFlow] Detected scheduling of an unchained task.
        When the promise manager is disabled, unchained tasks will not wait for
        previously scheduled tasks to finish before starting to execute.
        New task: Task: WebDriver.quit()
            at thenableWebDriverProxy.schedule (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
            at thenableWebDriverProxy.quit (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:840:23)
            at Object. (D:\xampp\htdocs\pvdata\testSelenium\test\testSelenium.js:31:8)
            at Module._compile (module.js:635:30)
            at Object.Module._extensions..js (module.js:646:10)
            at Module.load (module.js:554:32)
            at tryModuleLoad (module.js:497:12)
            at Function.Module._load (module.js:489:3)
            at Function.Module.runMain (module.js:676:10)
            at startup (bootstrap_node.js:187:16)
        Previous task: Task: WebDriver.sleep(4000)
            at ControlFlow.timeout (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\promise.js:2510:17)
            at thenableWebDriverProxy.sleep (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:956:23)
            at Object. (D:\xampp\htdocs\pvdata\testSelenium\test\testSelenium.js:30:8)
            at Module._compile (module.js:635:30)
            at Object.Module._extensions..js (module.js:646:10)
            at Module.load (module.js:554:32)
            at tryModuleLoad (module.js:497:12)
            at Function.Module._load (module.js:489:3)
            at Function.Module.runMain (module.js:676:10)
            at startup (bootstrap_node.js:187:16)                                                                                                                                                              
    
    • The Task: WebDriver.quit() is scheduled after WebDriver.sleep(4000);
    • This is called the Promises Chain

    Logging with Webdriver-Selenium

    Selenium Code: 
    var {Builder, By, until, logging } = require('selenium-webdriver');
    //
    // Enable Logging 
    logging.installConsoleHandler();
    logging.getLogger('promise.ControlFlow').setLevel(logging.Level.ALL);
    
    Logger Output:
            at Function.Module._load (module.js:489:3)
    [2018-01-17T09:37:13Z] [WARNING] [promise.ControlFlow] Detected scheduling of an unchained task.
        When the promise manager is disabled, unchained tasks will not wait for
        previously scheduled tasks to finish before starting to execute.
        New task: Task: WebDriver.getTitle()
            at thenableWebDriverProxy.schedule (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
            at thenableWebDriverProxy.getTitle (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:1000:17)
            at Object. (D:\xampp\htdocs\pvdata\testSelenium\test\testSelenium.js:12:8)
            at Module._compile (module.js:635:30)
            at Object.Module._extensions..js (module.js:646:10)
            at Module.load (module.js:554:32)
            at tryModuleLoad (module.js:497:12)
            at Function.Module._load (module.js:489:3)
            at Function.Module.runMain (module.js:676:10)
            at startup (bootstrap_node.js:187:16)
        Previous task: Task: WebDriver.navigate().to(http://www.google.com/ncr)
            at thenableWebDriverProxy.schedule (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
            at Navigation.to (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:1133:25)
            at thenableWebDriverProxy.get (D:\xampp\htdocs\pvdata\testSelenium\test\node_modules\selenium-webdriver\lib\webdriver.js:988:28)
            at Object. (D:\xampp\htdocs\pvdata\testSelenium\test\testSelenium.js:11:8)
            at Module._compile (module.js:635:30)
            at Object.Module._extensions..js (module.js:646:10)
            at Module.load (module.js:554:32)
            at tryModuleLoad (module.js:497:12)
            at Function.Module._load (module.js:489:3)
            at Function.Module.runMain (module.js:676:10)
    

    Install Selenium-WebDriver /Chromedriver locally

    • npm install selenium-webdriver@3.6.0
    • npm install chromedriver@2.34.1

    Verify Installation

    D:\xampp\htdocs\pvdata\testSelenium\test>npm list --depth=0
    D:\xampp\htdocs\pvdata\testSelenium\test
    +-- chromedriver@2.34.1
    `-- selenium-webdriver@3.6.0
    

    Testing a Google Search with Selenium Webdriver

    Create a JavaScript file testSelenium.js

    require('chromedriver');
    var {Builder, By, until, logging } = require('selenium-webdriver');
    //
    // Enable Logging 
    // logging.installConsoleHandler();
    //logging.getLogger('promise.ControlFlow').setLevel(logging.Level.ALL);
    
    var  driver = new Builder()
        .forBrowser('chrome')
        .build();
    dumpMessage( "--- Script Start ---");
    
    driver.get('http://www.google.com/ncr');
    driver.getTitle().then(function (titleName ) {	dumpMessage("Initial Google Page load - Page Title: ---" + titleName + "---" ); });
    
    driver.findElement(By.name('q')).sendKeys('webdriver');            	// Fill in the  Serach String to the 
    driver.findElement(By.name('btnK')).click();					   	// Star the Google Searcht 	
    
    var searchTitle = 'webdriver - Google Search';                    	// The New Page Title  
    driver.wait(until.titleIs(searchTitle), 10000)						// Wait Google Search List becomes availabe
    	.then(function (titleName ) { console.log(getTime() + "Title Element now Visible in DOM ? : " + titleName)});
    
    var xPathElem =  '//*[@id="rso"]/div/div/div[1]/div/div/h3/a';      // xPAth to the  first Item from Google Search Results  
    driver.wait(until.elementLocated( { xpath: xPathElem }),20000)      // Wait until Goggle Search Results becomes available 
    	.then(function () { dumpMessage("XPath wait finished : Element  Found in DOM - xPath :  " + xPathElem );
    		}); 
    
    driver.findElement( { xpath: xPathElem }).click()                   // Click ON the for Search Result   
    	.then(function (  ) { dumpMessage("xPath  Element  Found in DOM: Triggering a Click Event on first Element of Google Search List !" );
    		});
    			
    driver.sleep(4000);                                               	// Let the chromedriver Browser open for 4 seconds to review results
    driver.quit();                                                    	// Finally Quit the driver 
    
    dumpMessage( "--- Script End ---");                              	// Note as all functions are async wer 
    
    															 		// Helper Functions 							
    function dumpMessage(mesg) {                                        // console.log at top level will create a undefined message
    	console.log(getTime() + mesg);                                  // Provide a wrapper function which returns some data 
    	return "---------------------------------------------------";	
    }
    
    function getTime() {
    	var ts = new Date();
        return ts.toLocaleTimeString()+ ":" + ts.getMilliseconds() + "  ";
    }
    

    Run first Selenium-Webdriver Script: testSelenium.js

    D:\xampp\htdocs\pvdata\testSelenium\test> node testSelenium.js
    

    Script Output

    D:\xampp\htdocs\pvdata\testSelenium\test> node testSelenium.js
    10:40:29:745  --- Script Start ---
    10:40:29:745  --- Script End ---
    
    DevTools listening on ws://127.0.0.1:12790/devtools/browser/aa1d4440-591b-45dd-8332-f590848ec58c
    10:40:34:359  Initial Google Page load - Page Title: ---Google---
    10:40:35:173  Title Element now Visible in DOM ? : true
    10:40:35:187  XPath wait finished : Element  Found in DOM - xPath :  //*[@id="rso"]/div/div/div[1]/div/div/h3/a
    10:40:36:320  xPath  Element  Found in DOM: Triggering a Click Event on first Element of Google Search List !
    

    Understanding the Script Output

    • The Script end is reached in less then 1ms [ due to the Asyn Mode of Node.js ]
    • All driver calls are scheduled via chains of promises for later execution
    • After about 5 seconds the ChromeDriver is started and initial Google Search Mask gets displayed [ Page Title : Google ]
    • About 1 second later the Google Search List gets displayed [ Page Title: webdriver Google-Search ]
    • Again 1 second later the 1 entry of our Google Search List gets displayed

    Reference