{"id":13610474,"url":"https://github.com/abhishekswain/jasmine2-protractor-utils","last_synced_at":"2025-04-12T22:34:00.833Z","repository":{"id":57279423,"uuid":"47194090","full_name":"abhishekswain/jasmine2-protractor-utils","owner":"abhishekswain","description":"Utilities for Protractor with jasmine2 [HTML Reports, Screenshot, Browser Console log]","archived":false,"fork":false,"pushed_at":"2017-12-20T06:02:32.000Z","size":571,"stargazers_count":18,"open_issues_count":13,"forks_count":31,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T04:33:02.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/abhishekswain.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":null}},"created_at":"2015-12-01T14:20:00.000Z","updated_at":"2022-01-22T18:46:02.000Z","dependencies_parsed_at":"2022-09-18T17:04:03.974Z","dependency_job_id":null,"html_url":"https://github.com/abhishekswain/jasmine2-protractor-utils","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekswain%2Fjasmine2-protractor-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekswain%2Fjasmine2-protractor-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekswain%2Fjasmine2-protractor-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekswain%2Fjasmine2-protractor-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhishekswain","download_url":"https://codeload.github.com/abhishekswain/jasmine2-protractor-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642223,"owners_count":21138348,"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":[],"created_at":"2024-08-01T19:01:45.037Z","updated_at":"2025-04-12T22:34:00.586Z","avatar_url":"https://github.com/abhishekswain.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/dm/jasmine2-protractor-utils.svg?style=flat-square)](https://www.npmjs.com/package/jasmine2-protractor-utils)\n[![npm](https://img.shields.io/npm/dt/jasmine2-protractor-utils.svg?style=flat-square)](https://www.npmjs.com/package/jasmine2-protractor-utils)\n\n[![npm](https://img.shields.io/npm/v/jasmine2-protractor-utils.svg?style=flat-square)](https://www.npmjs.com/package/jasmine2-protractor-utils)\n[![npm](https://img.shields.io/npm/l/jasmine2-protractor-utils.svg?style=flat-square)](https://www.npmjs.com/package/jasmine2-protractor-utils)\n\n# jasmine2-protractor-utils\nUtilities for Protractor with jasmine2 [Screenshot, Browser Console log and more]\n\n1. This plugin can take a screenshot for each Jasmine2 expect failure\n2. It can take screenshot for each spec failure as well\n3. It can fail your spec/test if browser console has errors\n4. It can generate beautiful readable HTML reports\n5. TODO: It can output browser console logs on failure(Done) or always(TODO) :)\n\n# Usage\n\n## How to install\n\nnpm install jasmine2-protractor-utils -g\n\n*To install a particular version:* npm install jasmine2-protractor-utils@version\n\n\nAdd this plugin to the protractor config file:\n```js\nexports.config = {\n      plugins: [{\n        package: 'jasmine2-protractor-utils',\n        disableHTMLReport: {Boolean},\n        disableScreenshot: {Boolean},\n        screenshotOnExpectFailure: {Boolean}    (Default - false),\n        screenshotOnSpecFailure: {Boolean}      (Default - false),\n        screenshotPath: {String}                (Default - 'reports/screenshots')\n        clearFoldersBeforeTest: {Boolean}       (Default - false),\n        htmlReportDir:  {String}                (Default - './reports/htmlReports')\n        failTestOnErrorLog: {\n                    failTestOnErrorLogLevel: {Number},  (Default - 900)\n                    excludeKeywords: {A JSON Array}\n                }\n      }]\n    };\n```\n\nExample:\n\n```js\nexports.config = {\n      plugins: [{\n        package: 'jasmine2-protractor-utils',\n        disableHTMLReport: false,\n        disableScreenshot: false,\n        screenshotPath:'./reports/screenshots',\n        screenshotOnExpectFailure:true,\n        screenshotOnSpecFailure:true,\n        clearFoldersBeforeTest: true,\n        htmlReportDir: './reports/htmlReports',\n        failTestOnErrorLog: {\n                    failTestOnErrorLogLevel: 900,\n                    excludeKeywords: ['keyword1', 'keyword2']\n                }\n      }]\n    };\n```\n\n\n**Please Note**\n\nIf you are using **failTestOnErrorLog** feature, there should be an **onPrepare:** block in your Protractor config which returns a promise.\nIf not present , please add the following to the config file:\n\n```js\n onPrepare: function () {\n\n        // returning the promise makes protractor wait for the reporter config before executing tests\n        return global.browser.getProcessedConfig().then(function (config) {\n\n        });\n        }\n```\n\n## package\n\n This is the plugin package name , same as of npm module name for the plugin , 'jasmine2-protractor-utils' usually and preferably\n\n\n## disableHTMLReport\n\n If set to 'true', disables HTML report generation.\n\n Valid Options: true/false\n\n\n## disableScreenshot\n\n If set to 'true' , disables screenshot generation.\n\n Valid Options: true/false\n\n\n## screenshotOnExpectFailure\n\n Takes a screenshot for each Jasmine2 expect failure, is set true.\n Screenshot will be taken in 'png' format and file name would be: description+spec description+index.png\n\n Default: false\n\n\n## screenshotOnSpecFailure\n\n Take screenshot for each spec failure , if set to true.\n Screenshot will be taken in 'png' format and file name would be: description+spec description.png\n\n Default: false\n\n\n## screenshotPath\n\n Path where screenshots will be saved. If path does not exist , will be created.\n e.g './reports/something/savehere/' , please take care of './' and '/' at the beginning and end.\n\n Default: 'reports/screenshots'\n\n## clearFoldersBeforeTest\n\n If this flag set to true, screenshot and html report directories will be emptied before generating new reports and screenshots\n\n Default: false\n\n## htmlReportDir\n\n Path where HTML report will be saved. If path does not exist , will be created.\n e.g './reports/something/savehere/'\n\n If you want to use the default location , never mention 'htmlReportDir' with the plug in configuration. Where as 'disableHTMLReport' must be set to false.\n\n Default: 'reports/htmlReports'\n\n## failTestOnErrorLog (Chrome only)\n\nContains a set of configuration for console log. When browser console has errors of a certain log level (default:\u003e900), the spec/test is marked failed along with log in the error report/stacktrace.\n\n### failTestOnErrorLogLevel\n\nLog level, test fails of the browser console log has logs **more than** this specified level.\n\nDefault: 900\n\n### excludeKeywords\n\nAn array of keywords to be excluded , while searching for error logs. i.e If a log contains any of these keywords , spec/test will not be marked failed.\n\nPlease do not specify this flag , if you don't supply any such keywords.\n\n\n## TODO\n\nIt can output browser console logs on failure(done) or always(TODO) :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekswain%2Fjasmine2-protractor-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishekswain%2Fjasmine2-protractor-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekswain%2Fjasmine2-protractor-utils/lists"}