All Projects → igniteram → protractor-cucumber-allure

igniteram / protractor-cucumber-allure

Licence: MIT license
e2e kickstarter framework for using protractorJS with cucumberJS and allure jenkins CI reports

Programming Languages

javascript
184084 projects - #8 most used programming language
Gherkin
971 projects

Projects that are alternatives of or similar to protractor-cucumber-allure

Kakunin
An E2E testing framework
Stars: ✭ 141 (+176.47%)
Mutual labels:  protractor
protractor-element-extend
Module, that helps you to extend ElementFinder in your own custom fragments
Stars: ✭ 22 (-56.86%)
Mutual labels:  protractor
after-work.js
[DEPRECATED] CLI for automated tests in web projects.
Stars: ✭ 56 (+9.8%)
Mutual labels:  protractor
Protractor Cucumber Framework
Cucumber framework plugin for Protractor
Stars: ✭ 191 (+274.51%)
Mutual labels:  protractor
allure-nunit
Archived - Allure adapter for NUnit framework.
Stars: ✭ 45 (-11.76%)
Mutual labels:  allure-report
protractor-flake
Rerun potentially flakey protractor tests before failing.
Stars: ✭ 82 (+60.78%)
Mutual labels:  protractor
Protractor Net
The .NET port of Protractor, an E2E test framework for Angular apps
Stars: ✭ 113 (+121.57%)
Mutual labels:  protractor
protractor-helper
Write robust and flakiness-free tests with Protractor.
Stars: ✭ 43 (-15.69%)
Mutual labels:  protractor
proxy-scraper
⭐️ A proxy scraper made using Protractor | Proxy list Updates every three hour 🔥
Stars: ✭ 201 (+294.12%)
Mutual labels:  protractor
protractor-cli
🎯 An Interactive command line interface & config helper for Protractor.js !
Stars: ✭ 14 (-72.55%)
Mutual labels:  protractor
Protractor Cucumber Typescript
e2e kickstarter test framework which consists of protractor, cucumber frameworks using typescript lang!
Stars: ✭ 194 (+280.39%)
Mutual labels:  protractor
Ng Pokedex
🐵 Pokedex progressive web app built with Angular
Stars: ✭ 245 (+380.39%)
Mutual labels:  protractor
Review System Demo
A Spring Boot and AngularJS boilerplate project.
Stars: ✭ 18 (-64.71%)
Mutual labels:  protractor
Generator Jhipster Ionic
Ionic for JHipster 💥
Stars: ✭ 147 (+188.24%)
Mutual labels:  protractor
python-appium-framework
Complete Python Appium framework in 360 degree
Stars: ✭ 43 (-15.69%)
Mutual labels:  allure-report
Query Selector Shadow Dom
querySelector that can pierce Shadow DOM roots without knowing the path through nested shadow roots. Useful for automated testing of Web Components. Production use is not advised, this is for test environments/tools such as Web Driver, Playwright, Puppeteer
Stars: ✭ 115 (+125.49%)
Mutual labels:  protractor
meazure
Screen magnification, measurement, capture and color sampling for Windows.
Stars: ✭ 55 (+7.84%)
Mutual labels:  protractor
testing-angular-applications
Project for the Testing Angular Applications book
Stars: ✭ 99 (+94.12%)
Mutual labels:  protractor
protractor-starter
#archived: protractor-starter end-to-end tests setup also for non angular application
Stars: ✭ 37 (-27.45%)
Mutual labels:  protractor
MasterSeleniumFramework
Automation Testing | Web | Java | OOPS | Selenium WebDriver | TestNG | Maven | ExtentReport | Allure Reports | Java mail API | Design Patterns (Page Object Model, Singleton) | Jenkins | Data-Driven Testing using JSON file
Stars: ✭ 52 (+1.96%)
Mutual labels:  allure-report

Protractor-Cucumber-Allure Setup Guide

circleCI Status code climate status MIT License

This project demonstrates the basic protractor-cucumber framework project setup with Jenkins CI and Allure Reports integration


Features

  • Crisp & Clear folder structures
  • Page Object design pattern implementation
  • Extensive hooks implemented for BeforeAll, After etc.
  • MultiCapabalities and Test Sharding example
  • Screenshots on failure feature scenarios
  • PosgreSQL database connection feature example - see Database
  • Support for cucumber-html-reports
  • Support for CI and Cucumber-Allure-Jenkins reports - check the Caveat section below

To Get Started

Pre-requisites

1.NodeJS installed globally in the system. https://nodejs.org/en/download/

Note Min node version 6.9.x

2.Chrome or Firefox browsers installed.

3.Text Editor(Optional) installed-->Sublime/Visual Studio Code.

Run Scripts

  • Clone the repository into a folder
  • Go inside the folder and run following command from terminal/command prompt which would then install all the dependencies from package.json
npm install
  • Then first step is to fire up the selenium server which could be done in many ways, webdriver-manager proves very handy for this.The below command should download the chrome & gecko driver binaries locally for you!
npm run webdriver-update
  • Then you should start your selenium server!
npm run webdriver-start
  • Following command will launch the chrome browser and run the scripts
npm test

Writing Features

Feature: To search allure reports in google
    @AllureScenario
    Scenario: Allure Reports Google
        Given I am on google page
        When I type "allure reports"
        Then I click search button
        Then I clear search textbox

Writing Step Definitions

"use strict";
"use strict";
const search = require("../pages/searchPage");
const { Given } = require("cucumber");

  Given(/^I am on google page$/, function() {
    return expect(browser.getTitle()).to.eventually.equal("Google");
  });

Writing Page Objects

function googleSearch() {
  this.searchTextBox = $("#lst-ib");
  this.searchButton = $("input[value='Google Search']");
}
module.exports = new googleSearch();

Cucumber Hooks

Following method takes screenshot on failure of each scenario

     
After(function(scenario) {
    if (scenario.result.status === Status.FAILED) {
    const attach = this.attach; // cucumber's world object has attach function which should be used
        return browser.takeScreenshot().then(function(png) {
        const decodedImage = new Buffer(png, "base64");
        return attach(decodedImage, "image/png");
    });
}
       

CucumberOpts Tags

Following configuration shows to call specific tags from feature files

cucumberOpts: {
    strict: true,
    format: 'json:./reports/json/cucumber_report.json',
    require: ["../stepDefinitions/*.js", "../support/*.js"],
    tags: "(@AllureScenario or @CucumberScenario or @ProtractorScenario)"
}

Database

You need to install PostgreSQL nodejs modulewith this framework.

npm install -D pg

database feature file elaborates the connection and how the query results are retrieved.

const pg = require('pg');
const connectDB = function() {
const conString = "postgres://username:password@localhost:5432/database_name";
this.client = new pg.Client(conString);
this.client.connect(function(err){
    if(err){
        return console.error('could not connect to postgres', err);
    }
    });
};

HTML Reports

Currently this project has been integrated with two types of cucumber HTML reports just for demo, which are generated when you run npm test in the reports folder. They can be customized according to user's specific needs-

cucumberreporterscreen cucumberreportscreen

Allure Reports

Caveat

These reports do not support latest cucumber 2.0 version, however they work with older version cucumber 1.3.5 & less. You would have to use the older cucumber syntax as well.

The reporter.js file in Support folder generates the target directory "Reports" in which the xml files are generated.For detail instructions on how it works, please refer the Allure-CucumberJS official repo : https://github.com/allure-framework/cucumberjs-allure-reporter

How to setup Jenkins and Allure framework : http://wiki.qatools.ru/display/AL/Allure+Jenkins+Plugin

const reporter = require('cucumberjs-allure-reporter');
 reporter.config(
 {
    targetDir:'./reports/'
 }
 );
module.exports = reporter;

allurereportscreen alluregraphscreen

Contributions

For contributors who want to improve this repo by contributing some code, reporting bugs, issues or improving documentation - PR's are highly welcome, please maintain the coding style , folder structure , detailed description of documentation and bugs/issues with examples if possible.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].