{"id":21173901,"url":"https://github.com/simple-automation-testing/protractor-parallel-retrier","last_synced_at":"2025-03-14T18:16:46.655Z","repository":{"id":65476635,"uuid":"293042512","full_name":"Simple-Automation-Testing/protractor-parallel-retrier","owner":"Simple-Automation-Testing","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-22T09:47:42.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T12:05:03.272Z","etag":null,"topics":["automation-test","parallel-execution","protractor-flaky","protractor-parallel","tetry-tests"],"latest_commit_sha":null,"homepage":"","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/Simple-Automation-Testing.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-05T09:19:25.000Z","updated_at":"2021-01-22T09:47:44.000Z","dependencies_parsed_at":"2023-01-25T06:25:17.284Z","dependency_job_id":null,"html_url":"https://github.com/Simple-Automation-Testing/protractor-parallel-retrier","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/Simple-Automation-Testing%2Fprotractor-parallel-retrier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simple-Automation-Testing%2Fprotractor-parallel-retrier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simple-Automation-Testing%2Fprotractor-parallel-retrier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simple-Automation-Testing%2Fprotractor-parallel-retrier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simple-Automation-Testing","download_url":"https://codeload.github.com/Simple-Automation-Testing/protractor-parallel-retrier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243624103,"owners_count":20321029,"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":["automation-test","parallel-execution","protractor-flaky","protractor-parallel","tetry-tests"],"created_at":"2024-11-20T16:52:37.687Z","updated_at":"2025-03-14T18:16:46.632Z","avatar_url":"https://github.com/Simple-Automation-Testing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protractor-parallel-retrier\n\n🛠 Development in progress, beta version\n\n![npm downloads](https://img.shields.io/npm/dm/protractor-parallel-retrier.svg?style=flat-square)\n\n## This library is a wrapper around ```process-rerun```\n\n### The purpose of this library is - build simple and flexible interface for protractor framework parallel execution with rerun (on fail) possibility\n\n[Usage and Example](#usage)\n\n\u003cbr\u003e\n\n[Documentation](#documentation)\n* [buildExecutor](#buildexecutor)\n* [byIt](#byit)\n* [byFile](#byit)\n* [asQueue](#asqueue)\n* [executor](#executor)\n* [execute](#execute)\n\n### usage\n\n```js\nconst {buildExecutor} = require('protractor-parallel-retrier');\n\nexecuteAsQueue();\nasync function executeAsQueue() {\n\n  const testCaseRegPattern = /(?\u003c=it\\(').+(?=')/ig;\n  const cwd = process.cwd();\n\n  const result = await buildExecutor(resolve(cwd, './protractor.conf.js'), resolve(cwd, './built/specs'))\n    .asQueue(testCaseRegPattern, ['test case it name 1', 'test case it name 2', 'test case it name 3'])\n    .command({'--process-argument': 'process-argument-value'}, {ENV_VARIABLE: 'en-varialbe-value'})\n    .executor({attemptsCount: 2, maxThreads: 1, logLevel: 'VERBOSE', longestProcessTime: 60 * 1000, pollTime: 100})\n    .execute();\n\n  console.log(result);\n  if(result.retriable.length || result.notRetriable.length) {\n    process.exit(1);\n  }\n}\n\nexecuteOnlyRequiredCases();\nasync function executeAsQueue() {\n\n  const testCaseRegPattern = /(?\u003c=it\\(').+(?=')/ig;\n  const cwd = process.cwd();\n\n  const result = await buildExecutor(resolve(cwd, './protractor.conf.js'), resolve(cwd, './built/specs'))\n    .asQueue(testCaseRegPattern, ['test case it name 1', 'test case it name 2', 'test case it name 3'])\n    .command({'--process-argument': 'process-argument-value'}, {ENV_VARIABLE: 'en-varialbe-value'})\n    .executor({attemptsCount: 2, maxThreads: 10, logLevel: 'VERBOSE', longestProcessTime: 60 * 1000, pollTime: 100})\n    .execute();\n\n  console.log(result);\n  if(result.retriable.length || result.notRetriable.length) {\n    process.exit(1);\n  }\n}\n\nexecuteByFile();\nasync function executeByFile() {\n  const cwd = process.cwd();\n  const result = await buildExecutor(resolve(cwd, './protractor.conf.js'), resolve(cwd, './built/specs'))\n    .byFile()\n    .command({'--process-argument': 'process-argument-value'}, {ENV_VARIABLE: 'en-varialbe-value'})\n    .executor({attemptsCount: 2, maxThreads: 5, logLevel: 'VERBOSE', longestProcessTime: 60 * 1000, pollTime: 100})\n    .execute();\n\n  console.log(result);\n  if(result.retriable.length || result.notRetriable.length) {\n    process.exit(1);\n  }\n}\n\n\nexecuteByIt();\nasync function executeByIt() {\n  const cwd = process.cwd();\n  const testCaseRegPattern = /(?\u003c=it\\(').+(?=')/ig;\n  const result = await buildExecutor(resolve(cwd, './protractor.conf.js'), resolve(cwd, './built/specs'))\n    .byIt(testCaseRegPattern)\n    .command({'--process-argument': 'process-argument-value'}, {ENV_VARIABLE: 'en-varialbe-value'})\n    .executor({attemptsCount: 2, maxThreads: 2, logLevel: 'VERBOSE', longestProcessTime: 60 * 1000, pollTime: 100})\n    .execute();\n\n  console.log(result);\n  if(result.retriable.length || result.notRetriable.length) {\n    process.exit(1);\n  }\n}\n```\n\n## Documentation\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## buildExecutor\n\n**`buildExecutor('./path/to/protractor.conf.js', './path/to/specs/folder')`**\n\narguments | description\n--- | ---\n**`pathToProtractorConfigFile`** | Type: `string` \u003cbr\u003e Path to protractor config file\n**`pathToSpecFolderOrSpecsFilesList`** | Type: `string` or `string[]` \u003cbr\u003e Path to specs folder, or list (array) with specs files path;\n\n**`returns {byIt: function; byFile: function; asQueue: function}`**\n\n## byIt\n\n**`buildExecutor(...args).byIt(/(?\u003c=it\\(').+(?=')/ig) or .byIt()`**\n\narguments | description\n--- | ---\n**`itPattern`** | Type: OPTIONAL `RegEx` \u003cbr\u003e RegEx for it title. example it('test item'); -\u003e itRegEx = /(?\u003c=it\\(').+(?=')/ig; \u003cbr\u003e in case of undefined library will define ***itPattern*** based on first symbol in it title;\n**`pathToSpecFolderOrSpecsFilesList`** | Type: `string` or `string[]` \u003cbr\u003e Path to specs folder, or list (array) with specs files path;\n\n**`returns {command: function}`**\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## byFile\n\n**`buildExecutor(...args).byFile()`**\n\n#### no arguments here\n\n**`returns {command: function}`**\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## asQueue\n\n**`buildExecutor(...args).asQueue(/(?\u003c=it\\(').+(?=')/ig, ['test1', 'test2', 'test 10']) or buildExecutor(...args).asQueue(['test1', 'test2', 'test 10'])`**\n\narguments | description\n--- | ---\n**`itPattern`** | Type: OPTIONAL `RegEx` \u003cbr\u003e RegEx for it title. example it('test item'); -\u003e itRegEx = /(?\u003c=it\\(').+(?=')/ig; \u003cbr\u003e in case of undefined library will define ***itPattern*** based on first symbol in it title;\n**`casesList`** | Type: `string[]` \u003cbr\u003e List with tests what should be executed one by on `can be first argument, because itPattern is an optional`\n\n**`returns {command: function}`**\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## command\n\n**`buildExecutor(...args).asQueue(...args1).command({'--test': 'test'}, {ENV: 'test'}) or buildExecutor(...args).asQueue(...args1).command()`**\n\narguments | description\n--- | ---\n**`processArgs`** | Type: `undefined` or `null` or `{[prop: string]: string}` \u003cbr\u003e Object with required process argumentss, use format prop name with - or --, example '--prop' or '-p'\n**`processEnvVars`** | Type: `undefined` or `null` or `{[prop: string]: string}` \u003cbr\u003e Object with required process env variables, use format prop name upper snake_case, LOG_LEVEL\n\n**`returns {executor: function}`**\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## executor\n\n**`buildExecutor(...args).asQueue(...args1).command().executor({maxThreads: 1, attemptsCount: 2, logLevel: 'ERROR'})`**\n\narguments | description\n--- | ---\n**`buildOpts`** | Type: `object` \u003cbr\u003e Options for executor\n**`buildOpts.maxThreads`** | Type: `number`,  \u003cbr\u003e How many threads can be executed in same time \u003cbr\u003e **Default threads count is 5**\n**`buildOpts.attemptsCount`** | Type: `number`,  \u003cbr\u003e How many times can we try to execute command for success result **in next cycle will be executed only faild command, success commands will not be reexecuted** \u003cbr\u003e **Default attempts count is 2**\n**`buildOpts.pollTime`** | Type: `number` ,  \u003cbr\u003e Period for recheck about free thread \u003cbr\u003e **Default is 1 second**\n**`buildOpts.logLevel`** | Type: `string`, one of 'ERROR', 'WARN', 'INFO', 'VERBOSE', \u003cbr\u003e ERROR - only errors, WARN -  errors and warnings, INFO - errors, warnings and information, VERBOSE - full logging \u003cbr\u003e **Default is 'ERROR'**\n**`buildOpts.currentExecutionVariable`** | Type: `string`, will be execution variable with execution index for every cycle will be ++ \u003cbr\u003e\n**`buildOpts.everyCycleCallback`** | Type: `function`,  \u003cbr\u003e Optional. everyCycleCallback will be executed after cycle, before next execution cycle.\u003cbr\u003e **Default is false**\n**`buildOpts.processResultAnalyzer`** | Type: `function`,  \u003cbr\u003e Optional. processResultAnalyzer is a function where arguments are original command, execution stack trace and notRetriable array processResultAnalyzer should return a new command what will be executed in next cycle or **null** - if satisfactory result \u003cbr\u003e\n**`buildOpts.longestProcessTime`** | Type: `number`,  \u003cbr\u003e In case if command execution time is longer than longest Process Time - executor will kill it automatically and will try to execute this command again. \u003cbr\u003e **Default time is 45 seconds**\n\n**`returns {execute: async function}`**\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## execute\n\n**`buildExecutor(...args).asQueue(...args1).command().executor(...args2).execute()`**\n\n#### no arguments here\n\n**`returns {retriable: string[]; notRetriable: string[]}`**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-automation-testing%2Fprotractor-parallel-retrier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimple-automation-testing%2Fprotractor-parallel-retrier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-automation-testing%2Fprotractor-parallel-retrier/lists"}