{"id":17677435,"url":"https://github.com/unadlib/marten","last_synced_at":"2025-05-12T21:28:25.995Z","repository":{"id":57291529,"uuid":"134018715","full_name":"unadlib/marten","owner":"unadlib","description":" A Process Controller Library","archived":false,"fork":false,"pushed_at":"2019-01-12T07:57:44.000Z","size":209,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-26T03:23:14.763Z","etag":null,"topics":["e2e-tests","test-runner","testing-tools"],"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/unadlib.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":"2018-05-19T01:20:38.000Z","updated_at":"2019-08-07T06:09:06.000Z","dependencies_parsed_at":"2022-08-27T12:20:19.249Z","dependency_job_id":null,"html_url":"https://github.com/unadlib/marten","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/unadlib%2Fmarten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fmarten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fmarten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fmarten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unadlib","download_url":"https://codeload.github.com/unadlib/marten/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243208736,"owners_count":20254092,"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":["e2e-tests","test-runner","testing-tools"],"created_at":"2024-10-24T07:28:41.468Z","updated_at":"2025-03-12T11:30:42.868Z","avatar_url":"https://github.com/unadlib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marten\nA Process Controller Library.\n\n#### Solution Goal\n\n* High-quality reusable code by steps.\n* Maintainable decoupled process steps.\n* Process steps runner with multiple granularity control.\n\n#### Features\n* Composable\n\u003eSeparate combination of steps.\n* Inheritable \u0026 extensible\n\u003eSupport for object-oriented programming. \n* Customizable\n\u003eAt run time, the arguments of any step are passed, the steps execution sequence can be customized, and the combination of any child steps is made.\n* Controllable\n\u003eThe execution granularity and position of the free control steps.\n* Context by arguments\n\u003eMerge the results of all step execution through context passing.\n\n## APIs\n- [function: generate](#function-generate)\n- [function: createProcess](#function-createProcess)\n- [class: Steps](#class-steps)\n  * [steps.reset()](#stepsreset)\n  * [steps.skip([step])](#stepsskipstep)\n  * [steps.exec()[return Promise]](#stepsexec)\n  * [steps.execTo(step)[return Promise]](#stepsexectostep)\n  * [steps.execBefore(step)[return Promise]](#stepsexecbeforestep)\n\n#### function: generate\nIf you need to control every step of the process, it is a useful process middleware.\n\n```javascript\nconst createProcess = generate({\n  async before({\n    step,\n    context,\n    options,\n  }) {\n    console.log(step.name);\n  },\n  async after({\n    step,\n    context,\n    options,\n  }) {\n    console.log(step.name);\n  }\n});\n```\n\n#### function: createProcess\nBy sequence, it can be redefined the combined sequence steps for steps runner.\n\n```javascript\n(async (context) =\u003e {\n  const process = createProcess(\n      Login,\n      Navigation,\n      Setting,\n      MakeCalls,\n    )\n    const instance = process(context);\n    await instance.execTo(Navigation);\n    await instance.execBefore(Setting.callingSetting);\n    await instance.exec();\n})();\n```\n\n#### class: Steps\nSteps Runner can be controlled the operation of the current sub steps by free.\n\n##### steps.reset()\n\nReset all steps ignore in the process and initialize process.\n\n##### steps.skip([step])\n- `step` \u003c`function`\u003e\n\nSet skip some steps in the process.\n\n##### steps.exec()\n- **return** \u003c`Promise`\u003e\n\nExecute the process by set sequence and skip setting.\n\n##### steps.execTo(step)\n- `step` \u003c`function|class`\u003e\n- **return** \u003c`Promise`\u003e\n\nExecute steps until a step position.\n\n##### steps.execBefore(step)\n- `step` \u003c`function|class`\u003e\n- **return** \u003c`Promise`\u003e\n\nExecute steps before a step position.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funadlib%2Fmarten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funadlib%2Fmarten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funadlib%2Fmarten/lists"}