All Projects → igniteram → Protractor Cucumber Typescript

igniteram / Protractor Cucumber Typescript

Licence: mit
e2e kickstarter test framework which consists of protractor, cucumber frameworks using typescript lang!

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Protractor Cucumber Typescript

Codeceptjs
Supercharged End 2 End Testing Framework for NodeJS
Stars: ✭ 3,592 (+1751.55%)
Mutual labels:  protractor
Angular Webpack Starter
A complete Angular 6 and Webpack 4 starter seed with minimal and full featured branches. Full featured branch includes: Material Design 2 (Bootstrap 4 branch available as well), @ngrx, HMR, DLLs and optional use of Universal for server-side rendering - Supports AOT (offline) compilation, sync and lazy loading. Karma/Protractor for e2e/unit tests.
Stars: ✭ 911 (+369.59%)
Mutual labels:  protractor
Protractor Net
The .NET port of Protractor, an E2E test framework for Angular apps
Stars: ✭ 113 (-41.75%)
Mutual labels:  protractor
Generator M Ionic
Advanced workflows and setup for building rock-solid Ionic apps
Stars: ✭ 677 (+248.97%)
Mutual labels:  protractor
Cucumber Protractor Harness
Simple starter project for incorporating cucumber (2.3.1) with protractor
Stars: ✭ 9 (-95.36%)
Mutual labels:  protractor
Protractor Best Practices
Stars: ✭ 65 (-66.49%)
Mutual labels:  protractor
angular-webpack-skeleton
This project is deprecated. Please refer to https://github.com/Ks89/angular-cli-skeleton
Stars: ✭ 16 (-91.75%)
Mutual labels:  protractor
Generator Jhipster Ionic
Ionic for JHipster 💥
Stars: ✭ 147 (-24.23%)
Mutual labels:  protractor
Protractor Firefox Support
Custom implementation of Actions class functions for e2e testing with Protractor in Firefox
Stars: ✭ 20 (-89.69%)
Mutual labels:  protractor
Protractor Perf
E2E test framework to check for performance regressions in Angular apps
Stars: ✭ 95 (-51.03%)
Mutual labels:  protractor
Gulp Angular Protractor
Gulp plugin to run protractor tests
Stars: ✭ 25 (-87.11%)
Mutual labels:  protractor
Protractor Pretty Html Reporter
A jasmine reporter that produces an easy to use html report to analyze protractor test results.
Stars: ✭ 9 (-95.36%)
Mutual labels:  protractor
Protractor
E2E test framework for Angular apps
Stars: ✭ 8,792 (+4431.96%)
Mutual labels:  protractor
Serenity Js
A next generation, full-stack acceptance testing framework optimised for collaboration, speed and scale!
Stars: ✭ 346 (+78.35%)
Mutual labels:  protractor
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 (-40.72%)
Mutual labels:  protractor
Ionic Boilerplate
✨ An Ionic Starter kit featuring Tests, E2E, Karma, Protractor, Jasmine, Istanbul, Gitlab CI, Automatic IPA and APK, TypeScript 2, TsLint, Codelyzer, Typedoc, Yarn, Rollup, and Webpack 2
Stars: ✭ 309 (+59.28%)
Mutual labels:  protractor
Bxbot Ui Angular
An Angular app for administering BX-bot.
Stars: ✭ 21 (-89.18%)
Mutual labels:  protractor
Protractor Cucumber Framework
Cucumber framework plugin for Protractor
Stars: ✭ 191 (-1.55%)
Mutual labels:  protractor
Kakunin
An E2E testing framework
Stars: ✭ 141 (-27.32%)
Mutual labels:  protractor
Docker Protractor Headless
Protractor end to end testing for AngularJS - dockerised and headless with real Chrome.
Stars: ✭ 90 (-53.61%)
Mutual labels:  protractor

titleImage.png

This project demonstrates the basic protractor-cucumber-typescript framework project setup.

circleCI Status dependencies status contributors MIT License


Protractor-Cucumber-TypeScript Setup Guide

Medium Article

Please do checkout my medium article which would give you more insight on this setup. protractor-cucumber-typescript(Medium)

Features

  • No typings.json or typings folder, they have been replaced by better '@types' modules in package.json.
  • ts-node(typescript execution environment for node) in cucumberOpts.
  • All scripts written with > Typescript2.0 & Cucumber2.0.
  • Neat folder structures with transpiled js files in separate output folder.
  • Page Object design pattern implementation.
  • Extensive hooks implemented for BeforeFeature, AfterScenarios etc.
  • Screenshots on failure feature scenarios.

To Get Started

Pre-requisites

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

2.Chrome or Firefox browsers installed.

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

Setup Scripts

  • Clone the repository into a folder
  • Go inside the folder and run following command from terminal/command prompt
npm install 
  • All the dependencies from package.json and ambient typings would be installed in node_modules folder.

Run Scripts

  • 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
  • The below command would create an output folder named 'typeScript' and transpile the .ts files to .js.
npm run build
  • Now just run the test command which launches the Chrome Browser and runs the scripts.
npm test

result

Writing Features

Feature: To search typescript in google
@TypeScriptScenario

  Scenario: Typescript Google Search
    Given I am on google page
    When I type "Typescript"
    Then I click on search button
    Then I clear the search text

Writing Step Definitions

import { browser } from "protractor";
import { SearchPageObject } from "../pages/searchPage";
const { Given } = require("cucumber");
const chai = require("chai").use(require("chai-as-promised"));
const expect = chai.expect;

const search: SearchPageObject = new SearchPageObject();

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

Writing Page Objects

import { $ } from "protractor";

export class SearchPageObject {
    public searchTextBox: any;
    public searchButton: any;

    constructor() {
        this.searchTextBox = $("#lst-ib");
        this.searchButton = $("input[value='Google Search']");
    }
}

Cucumber Hooks

Following method takes screenshot on failure of each scenario

After(async function(scenario) {
    if (scenario.result.status === Status.FAILED) {
        // screenShot is a base-64 encoded PNG
         const screenShot = await browser.takeScreenshot();
         this.attach(screenShot, "image/png");
    }
});

CucumberOpts Tags

Following configuration shows to call specific tags from feature files

cucumberOpts: {
    compiler: "ts:ts-node/register",
    format: "json:./reports/json/cucumber_report.json",
    require: ["../../stepdefinitions/*.ts", "../../support/*.ts"],
    strict: true,
    tags: "@TypeScriptScenario or @CucumberScenario or @ProtractorScenario",
},

HTML Reports

Currently this project has been integrated with cucumber-html-reporter, which is generated in the reports folder when you run npm test. They can be customized according to user's specific needs.

cucumberreporterscreen

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.

Contributors


Ram Pasala

💻 📖 ⚠️ 🐛

Burk Hufnagel

💻

Alejandro

💻 🐛

David Jimenez

💻

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT License

Copyright (c) 2019 Ram Pasala
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].