{"id":13721128,"url":"https://github.com/igniteram/protractor-cucumber-typescript","last_synced_at":"2025-10-10T15:02:12.493Z","repository":{"id":10729619,"uuid":"66765982","full_name":"igniteram/protractor-cucumber-typescript","owner":"igniteram","description":"e2e kickstarter test framework which consists of protractor, cucumber frameworks using typescript lang!","archived":false,"fork":false,"pushed_at":"2023-03-03T21:17:25.000Z","size":2617,"stargazers_count":196,"open_issues_count":32,"forks_count":170,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-04-14T05:36:45.684Z","etag":null,"topics":["angular","bdd-framework","cucumber-framework","cucumber-js","nodejs","protractor","protractor-cucumber-typescript","testing","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hooks.ts","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-28T12:03:13.000Z","updated_at":"2024-05-09T12:54:48.409Z","dependencies_parsed_at":"2024-05-09T12:54:42.378Z","dependency_job_id":"49bb3e95-5b46-452b-84a5-b372a024aaff","html_url":"https://github.com/igniteram/protractor-cucumber-typescript","commit_stats":{"total_commits":49,"total_committers":5,"mean_commits":9.8,"dds":0.1428571428571429,"last_synced_commit":"dcbbc33b0aa3f9e68675f3e6dad8e9e240c4c2e5"},"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-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igniteram%2Fprotractor-cucumber-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igniteram","download_url":"https://codeload.github.com/igniteram/protractor-cucumber-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430864,"owners_count":20937874,"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":["angular","bdd-framework","cucumber-framework","cucumber-js","nodejs","protractor","protractor-cucumber-typescript","testing","typescript"],"created_at":"2024-08-03T01:01:12.735Z","updated_at":"2025-10-10T15:02:07.445Z","avatar_url":"https://github.com/igniteram.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Resources"],"sub_categories":["Guides"],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src= \"./images/protractor-typescript-cucumber.png\" height=300 alt=\"titleImage.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ci\u003e\u003cstrong\u003eThis project demonstrates the basic protractor-cucumber-typescript framework project setup.\n\u003c/strong\u003e\u003c/i\u003e\n\u003cp\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://circleci.com/gh/igniteram/protractor-cucumber-typescript/tree/master\"\u003e\u003cimg alt=\"circleCI Status\" src=\"https://circleci.com/gh/igniteram/protractor-cucumber-typescript/tree/master.svg?style=shield\"\u003e\u003c/a\u003e\n\u003ca href=\"https://david-dm.org/igniteram/protractor-cucumber-typescript\"\u003e\u003cimg alt=\"dependencies status\" src=\"https://david-dm.org/igniteram/protractor-cucumber-typescript.svg\"\u003e\u003c/a\u003e\n\u003ca href=#contributors\u003e\u003cimg alt=\"contributors\" src=\"https://img.shields.io/badge/all_contributors-4-orange.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\n---\n\n\n### Protractor-Cucumber-TypeScript Setup Guide   \n\n### Medium Article\nPlease do checkout my medium article which would give you more insight on this setup. [protractor-cucumber-typescript(Medium)](https://medium.com/@igniteram/e2e-testing-with-protractor-cucumber-using-typescript-564575814e4a)\n\n### Features\n* No typings.json or typings folder, they have been replaced by better **'@types'** modules in package.json.\n* ts-node(typescript execution environment for node) in cucumberOpts. \n* All scripts written with \u003e Typescript2.0 \u0026 Cucumber2.0.\n* Neat folder structures with transpiled js files in separate output folder.\n* Page Object design pattern implementation.\n* Extensive hooks implemented for BeforeFeature, AfterScenarios etc.\n* Screenshots on failure feature scenarios.\n\n\n### To Get Started\n\n#### Pre-requisites\n1.NodeJS installed globally in the system.\nhttps://nodejs.org/en/download/\n\n2.Chrome or Firefox browsers installed.\n\n3.Text Editor(Optional) installed--\u003eSublime/Visual Studio Code/Brackets.\n\n#### Setup Scripts\n* Clone the repository into a folder\n* Go inside the folder and run following command from terminal/command prompt\n```\nnpm install \n```\n* All the dependencies from package.json and ambient typings would be installed in node_modules folder.\n\n#### Run Scripts\n\n* 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* The below command would create an output folder named 'typeScript' and transpile the .ts files to .js.\n```\nnpm run build\n```\n\n* Now just run the test command which launches the Chrome Browser and runs the scripts.\n```\nnpm test\n```\n![result](https://raw.githubusercontent.com/igniteram/protractor-cucumber-typescript/master/images/protractor-cucumber-typescript-result.gif)\n\n#### Writing Features\n```\nFeature: To search typescript in google\n@TypeScriptScenario\n\n  Scenario: Typescript Google Search\n    Given I am on google page\n    When I type \"Typescript\"\n    Then I click on search button\n    Then I clear the search text\n```\n#### Writing Step Definitions\n    \n```\nimport { browser } from \"protractor\";\nimport { SearchPageObject } from \"../pages/searchPage\";\nconst { Given } = require(\"cucumber\");\nconst chai = require(\"chai\").use(require(\"chai-as-promised\"));\nconst expect = chai.expect;\n\nconst search: SearchPageObject = new SearchPageObject();\n\nGiven(/^I am on google page$/, async () =\u003e {\n    await expect(browser.getTitle()).to.eventually.equal(\"Google\");\n});\n```\n\n#### Writing Page Objects\n```\nimport { $ } from \"protractor\";\n\nexport class SearchPageObject {\n    public searchTextBox: any;\n    public searchButton: any;\n\n    constructor() {\n        this.searchTextBox = $(\"#lst-ib\");\n        this.searchButton = $(\"input[value='Google Search']\");\n    }\n}\n```\n#### Cucumber Hooks\nFollowing method takes screenshot on failure of each scenario\n```\nAfter(async function(scenario) {\n    if (scenario.result.status === Status.FAILED) {\n        // screenShot is a base-64 encoded PNG\n         const screenShot = await browser.takeScreenshot();\n         this.attach(screenShot, \"image/png\");\n    }\n});\n```\n#### CucumberOpts Tags\nFollowing configuration shows to call specific tags from feature files\n```\ncucumberOpts: {\n    compiler: \"ts:ts-node/register\",\n    format: \"json:./reports/json/cucumber_report.json\",\n    require: [\"../../stepdefinitions/*.ts\", \"../../support/*.ts\"],\n    strict: true,\n    tags: \"@TypeScriptScenario or @CucumberScenario or @ProtractorScenario\",\n},\n```\n#### HTML Reports\nCurrently this project has been integrated with [cucumber-html-reporter](https://github.com/gkushang/cucumber-html-reporter), which is generated in the `reports` folder when you run `npm test`.\nThey can be customized according to user's specific needs.\n\n![cucumberreporterscreen](https://raw.githubusercontent.com/igniteram/protractor-cucumber-typescript/master/images/cucumberReporter.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\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars1.githubusercontent.com/u/15998104?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRam Pasala\u003c/b\u003e\u003c/sub\u003e](https://in.linkedin.com/in/rpasala)\u003cbr /\u003e[💻](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=igniteram \"Code\") [📖](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=igniteram \"Documentation\") [⚠️](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=igniteram \"Tests\") [🐛](https://github.com/igniteram/protractor-cucumber-typescript/issues?q=author%3Aigniteram \"Bug reports\") | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/304328?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBurk Hufnagel\u003c/b\u003e\u003c/sub\u003e](https://github.com/BurkHufnagel)\u003cbr /\u003e[💻](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=BurkHufnagel \"Code\") | [\u003cimg src=\"https://avatars3.githubusercontent.com/u/6922793?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlejandro\u003c/b\u003e\u003c/sub\u003e](https://github.com/sanko1983)\u003cbr /\u003e[💻](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=sanko1983 \"Code\") [🐛](https://github.com/igniteram/protractor-cucumber-typescript/issues?q=author%3Asanko1983 \"Bug reports\") | [\u003cimg src=\"https://avatars0.githubusercontent.com/u/14068808?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDavid Jimenez\u003c/b\u003e\u003c/sub\u003e](https://github.com/runnerdave)\u003cbr /\u003e[💻](https://github.com/igniteram/protractor-cucumber-typescript/commits?author=runnerdave \"Code\") |\n| :---: | :---: | :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n```   \nMIT License\n\nCopyright (c) 2019 Ram Pasala\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fprotractor-cucumber-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figniteram%2Fprotractor-cucumber-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteram%2Fprotractor-cucumber-typescript/lists"}