{"id":16372864,"url":"https://github.com/igniteram/protractor-cucumber-allure","last_synced_at":"2025-03-21T01:31:45.966Z","repository":{"id":73413104,"uuid":"60198668","full_name":"igniteram/protractor-cucumber-allure","owner":"igniteram","description":"e2e kickstarter framework for using protractorJS with cucumberJS and allure jenkins CI reports","archived":false,"fork":false,"pushed_at":"2018-01-15T17:01:47.000Z","size":2140,"stargazers_count":48,"open_issues_count":4,"forks_count":45,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-17T19:39:50.830Z","etag":null,"topics":["allure-report","cucumberjs","protractor"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igniteram.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/ElementHelper.js","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-01T17:48:50.000Z","updated_at":"2025-01-04T21:50:16.000Z","dependencies_parsed_at":"2023-02-28T00:16:30.581Z","dependency_job_id":null,"html_url":"https://github.com/igniteram/protractor-cucumber-allure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-allure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-allure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-allure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-allure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igniteram","download_url":"https://codeload.github.com/igniteram/protractor-cucumber-allure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244721232,"owners_count":20498914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure-report","cucumberjs","protractor"],"created_at":"2024-10-11T03:12:36.993Z","updated_at":"2025-03-21T01:31:45.960Z","avatar_url":"https://github.com/igniteram.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3\u003eProtractor-Cucumber-Allure Setup Guide\u003c/h3\u003e\n\n\u003cp\u003e\n\u003ca href=\"https://circleci.com/gh/igniteram/protractor-cucumber-allure/tree/master\"\u003e\u003cimg alt=\"circleCI Status\" src=\"https://circleci.com/gh/igniteram/protractor-cucumber-allure.svg?style=shield\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codeclimate.com/github/igniteram/protractor-cucumber-allure\"\u003e\u003cimg alt=\"code climate status\" src=\"https://codeclimate.com/github/igniteram/protractor-cucumber-allure/badges/gpa.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg alt=\"MIT License\" src=\"https://img.shields.io/dub/l/vibe-d.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\n\u003ci\u003e\u003cstrong\u003eThis project demonstrates the basic protractor-cucumber framework project setup with Jenkins CI and Allure Reports integration\u003c/strong\u003e\u003c/i\u003e\n\u003c/p\u003e\n\n---\n\n\n### Features\n* Crisp \u0026 Clear folder structures\n* Page Object design pattern implementation\n* Extensive hooks implemented for BeforeAll, After etc.\n* MultiCapabalities and Test Sharding example\n* Screenshots on failure feature scenarios\n* PosgreSQL database connection feature example - see [Database](#database)\n* Support for cucumber-html-reports\n* Support for CI and Cucumber-Allure-Jenkins reports - check the [Caveat](#caveat) section below\n\n### To Get Started\n\n#### Pre-requisites\n1.NodeJS installed globally in the system.\nhttps://nodejs.org/en/download/\n\n**Note** Min node version 6.9.x\n\n2.Chrome or Firefox browsers installed.\n\n3.Text Editor(Optional) installed--\u003eSublime/Visual Studio Code.\n\n#### Run Scripts\n* Clone the repository into a folder\n* Go inside the folder and run following command from terminal/command prompt which would then install all the dependencies from package.json\n\n```\nnpm install\n```\n\n* 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 \u0026 gecko driver** binaries locally for you!\n\n```\nnpm run webdriver-update\n``` \n\n* Then you should start your selenium server!\n```\nnpm run webdriver-start\n```\n\n* Following command will launch the chrome browser and run the scripts\n\n```\nnpm test\n```\n\n#### Writing Features\n\n``` \nFeature: To search allure reports in google\n    @AllureScenario\n    Scenario: Allure Reports Google\n        Given I am on google page\n        When I type \"allure reports\"\n        Then I click search button\n        Then I clear search textbox\n```\n\n#### Writing Step Definitions\n\n```\n\"use strict\";\n\"use strict\";\nconst search = require(\"../pages/searchPage\");\nconst { Given } = require(\"cucumber\");\n\n  Given(/^I am on google page$/, function() {\n    return expect(browser.getTitle()).to.eventually.equal(\"Google\");\n  });\n```\n\n#### Writing Page Objects\n\n```\nfunction googleSearch() {\n  this.searchTextBox = $(\"#lst-ib\");\n  this.searchButton = $(\"input[value='Google Search']\");\n}\nmodule.exports = new googleSearch();\n```\n\n#### Cucumber Hooks\nFollowing method takes screenshot on failure of each scenario\n\n```     \n     \nAfter(function(scenario) {\n    if (scenario.result.status === Status.FAILED) {\n    const attach = this.attach; // cucumber's world object has attach function which should be used\n        return browser.takeScreenshot().then(function(png) {\n        const decodedImage = new Buffer(png, \"base64\");\n        return attach(decodedImage, \"image/png\");\n    });\n}\n       \n```\n\n#### CucumberOpts Tags\nFollowing configuration shows to call specific tags from feature files\n\n```     \ncucumberOpts: {\n    strict: true,\n    format: 'json:./reports/json/cucumber_report.json',\n    require: [\"../stepDefinitions/*.js\", \"../support/*.js\"],\n    tags: \"(@AllureScenario or @CucumberScenario or @ProtractorScenario)\"\n}\n```\n\n#### Database\nYou need to install PostgreSQL nodejs modulewith this framework.\n\n```\nnpm install -D pg\n```\n\ndatabase feature file elaborates the connection and how the query results are retrieved.\n \n```    \nconst pg = require('pg');\nconst connectDB = function() {\nconst conString = \"postgres://username:password@localhost:5432/database_name\";\nthis.client = new pg.Client(conString);\nthis.client.connect(function(err){\n    if(err){\n        return console.error('could not connect to postgres', err);\n    }\n    });\n};\n```\n\n#### HTML Reports\nCurrently 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.\nThey can be customized according to user's specific needs-\n* [cucumber-html-reporter](https://github.com/gkushang/cucumber-html-reporter)\n* [cucumber-html-report](https://github.com/leinonen/cucumber-html-report)\n\n![cucumberreporterscreen](https://raw.githubusercontent.com/igniteram/protractor-cucumber-allure/master/images/cucumberReporter.PNG)\n![cucumberreportscreen](https://raw.githubusercontent.com/igniteram/protractor-cucumber-allure/master/images/cucumberReport.png)\n\n#### Allure Reports\n\n##### Caveat\n\nThese reports do not support latest **cucumber 2.0 version**, however they work with older **version cucumber 1.3.5 \u0026 less**. You would have to use the older cucumber syntax as well.\n\nThe 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\n\nHow to setup Jenkins and Allure framework : http://wiki.qatools.ru/display/AL/Allure+Jenkins+Plugin\n\u003e      \n    const reporter = require('cucumberjs-allure-reporter');\n     reporter.config(\n     {\n        targetDir:'./reports/'\n     }\n     );\n    module.exports = reporter;\n\n![allurereportscreen](https://raw.githubusercontent.com/igniteram/protractor-cucumber-allure/master/images/allureReport.png)\n![alluregraphscreen](https://raw.githubusercontent.com/igniteram/protractor-cucumber-allure/master/images/allureReportGraph.png)\n\n## Contributions\nFor 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fprotractor-cucumber-allure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figniteram%2Fprotractor-cucumber-allure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fprotractor-cucumber-allure/lists"}