{"id":20560145,"url":"https://github.com/RahulARanger/WTicks","last_synced_at":"2025-05-09T17:33:02.497Z","repository":{"id":168778569,"uuid":"644054034","full_name":"RahulARanger/WTicks","owner":"RahulARanger","description":"A tool for converting recorded selenium script to standalone webdriverio script","archived":false,"fork":false,"pushed_at":"2023-06-17T20:19:22.000Z","size":1059,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-16T03:53:18.227Z","etag":null,"topics":["code-export","selenium-ide","webdriverio"],"latest_commit_sha":null,"homepage":"https://wticks.vercel.app/converter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RahulARanger.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-22T18:03:33.000Z","updated_at":"2023-06-23T02:10:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb8864c4-d961-46df-8b09-59aa74f8f134","html_url":"https://github.com/RahulARanger/WTicks","commit_stats":null,"previous_names":["rahularanger/wticks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulARanger%2FWTicks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulARanger%2FWTicks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulARanger%2FWTicks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulARanger%2FWTicks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RahulARanger","download_url":"https://codeload.github.com/RahulARanger/WTicks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253295799,"owners_count":21885696,"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":["code-export","selenium-ide","webdriverio"],"created_at":"2024-11-16T03:53:14.509Z","updated_at":"2025-05-09T17:33:02.491Z","avatar_url":"https://github.com/RahulARanger.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Miscellaneous"],"readme":"# WTicks\n\n[![Regression Tests](https://github.com/RahulARanger/WTicks/actions/workflows/test-execution.yaml/badge.svg)](https://github.com/RahulARanger/WTicks/actions/workflows/test-execution.yaml)\n[![Tested with webdriver.io](https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906)](https://webdriver.io/)\n\nWTicks enables you to convert the selenium recorded scripts to simple standalone webdriverio scripts.\n\nTo Get Started, you can simply upload the [.side](https://www.selenium.dev/selenium-ide/docs/en/introduction/getting-started) file [here](https://wticks.vercel.app/converter).\nSelect the Test case / suite, and then WTicks will fetch all the locators used, name those locators and then you can have your generated script.\n\nPlease refer to the output structure and suggest if required.\n\n## Output structure\n\n-   Suite = Object with List of Test Cases\n-   Test Case = Object with List of Commands\n\n### Parsing the Test Cases\n\nHere we detect all the locators used by the user. it will assume the a particular command's comment as the name of the locator used in it.\n\nLet's say if the script has:\n\n-   `{target: \"#foo\", command: \"verifyText\", comment: \"fooButton\", value: \"foo\"}`\n-   `{target: \"#foo\", command: \"click\", comment: \"since we verified the fooButton now we can click it\"}`\n-   `{target: \"#foo\", command: \"verifyText\", comment: \"registeredButton\", value: \"registered\"}`\n\nIt will assume the name of the locator: \"#foo\" as \"fooButton\" but not as \"since we....\" / \"registeredButton\". as it first appeared.\n\nTest Cases are parsed in the order as arranged in recorder.\n\n### Requesting for user input\n\n-   First we request for the Test Case / Suite after the selection, we would fetch its associated locators and for which,\n-   we would request you to fill the name for the locators before generating the script if not found the file that was uploaded. so assign them a valid js variable / function name. [NOTE: duplicate names are not allowed]\n\n### Parsing the commands\n\nNow we map each command inside the script to a webdriverio command then finally we combine to generate the script.\n\n#### Supported Mappings:\n\n| Selenium Command                                | WebdriverIO Command                                         |\n| ----------------------------------------------- | ----------------------------------------------------------- |\n| click                                           | `$(...).click()`                                            |\n| type                                            | `$(...).setValue()`                                         |\n| echo                                            | `console.log(...)`                                          |\n| uncheck                                         | `if $(...).isSelected() $(...).click()`                     |\n| check                                           | `if !$(...).isSelected() $(...).click()`                    |\n| open                                            | `browser.url(...)`                                          |\n| pause                                           | `browser.pause(...)`                                        |\n| sendKeys                                        | `browser.sendKeys([Key....,...])`                           |\n| debugger                                        | `browser.debug()`                                           |\n| setWindowSize                                   | `browser.size(..., ...)`                                    |\n| runScript                                       | `browser.script(...)`                                       |\n| assertText or verifyText                        | `expect($(...)).toHaveText(...)`                            |\n| assertTitle or verifyTitle                      | `expect(browser).toHaveTitle(...)`                          |\n| assertElementPresent or verifyElementPresent    | `expect($(...)).toBePresent()`                              |\n| assertEditable or verifyEditable                | `expect($(...)).toBeEnabled()`                              |\n| assertChecked or verifyChecked                  | `expect($(...)).toBeChecked()`                              |\n| assertValue or verifyValue                      | `expect($(...)).toHaveValue(...)`                           |\n| assertNotText or verifyNotText                  | `expect($(...)).not.toHaveText(...)`                        |\n| assertNotTitle or verifyNotTitle                | `expect(browser).not.toHaveTitle(...)`                      |\n| assertElementNotPresent or verifyElementPresent | `expect($(...)).not.toBePresent()`                          |\n| assertNotEditable or verifyNotEditable          | `expect($(...)).not.toBeEnabled()`                          |\n| assertNotChecked or verifyNotChecked            | `expect($(...)).not.toBeChecked()`                          |\n| assertNotValue or verifyNotValue                | `expect($(...)).not .toHaveValue(...)`                      |\n| waitForElementEditable                          | `$(...).waitForEnabled({ timeout: ..., reverse: false })`   |\n| waitForElementNotEditable                       | `$(...).waitForEnabled({ timeout: ..., reverse: true })`    |\n| waitForElementPresent                           | `$(...).waitForExist({ timeout: ..., reverse: false})`      |\n| waitForElementNotPresent                        | `$(...).waitForExist({ timeout: ..., reverse: true})`       |\n| waitForElementVisible                           | `$(...).waitForDisplayed({ timeout: ..., reverse: false })` |\n| waitForElementNotVisible                        | `$(...).waitForDisplayed({ timeout: ..., reverse: true })`  |\n\n### Example Output:\n\n```js\nimport { remote, Key } from \"webdriverio\"; // Key is for sendKeys command\nimport { expect } from \"expect-webdriverio\";\n// above lines for the imports required for performing assertions and running a standalone runner\n\n// if you are using browser runner to execute the scripts then you can ignore the below configuration for the browser\nconst browser = await remote({\n\tcapabilities: {\n\t\tbrowserName: \"chrome\",\n\t\t\"goog:chromeOptions\": {\n\t\t\targs: process.env.CI ? [\"headless\", \"disable-gpu\"] : [],\n\t\t},\n\t},\n});\n\nclass Locators {\n\t$(location) {\n\t\treturn browser.$(location); // you can either have it like this or simply $(location)\n\t}\n\tget search_bar_location() {\n\t\treturn this.$(\"#\\\\:Ril56\\\\:-label\");\n\t}\n\tget youtube_search_bar() {\n\t\treturn this.$(\"#\\\\:Ril56\\\\:\");\n\t}\n\tget search_bar_icon() {\n\t\treturn this.$(\".MuiInputAdornment-root \u003e span\");\n\t}\n\tget tooltip() {\n\t\treturn this.$(\".MuiTooltip-tooltip\"); // $(\".MuiTooltip-tooltip\"); would do if you are running in WDIO Test runner: https://webdriver.io/docs/setuptypes/#the-wdio-testrunner\n\t}\n\tget body() {\n\t\t// name of the function = name of the locator associated with it\n\t\treturn this.$(\"#__next\"); // locator\n\t}\n}\n//\n\nconst pageClass = new Locators();\n\n// TEST CASE\nasync function validating_the_search_bar() {\n\t// name of the function = name of the test case\n\tawait browser.url(\"https://yticks.vercel.app/video\"); // mapped webdriverio commands\n\tawait browser.setWindowSize(518, 480);\n\tawait expect(pageClass.search_bar_location).toHaveText(\n\t\t\"Paste a valid Youtube URL\"\n\t);\n\tawait expect(pageClass.youtube_search_bar).toBePresent();\n\tawait pageClass.youtube_search_bar.click();\n\tawait expect(pageClass.search_bar_icon).toBePresent();\n\tawait pageClass.search_bar_icon.click();\n\tawait browser.pause(600);\n\tawait pageClass.search_bar_icon.click();\n\tawait expect(pageClass.tooltip).toHaveText(\"Invalid Input\");\n\tawait pageClass.youtube_search_bar.click();\n\tawait pageClass.body.click();\n\tawait pageClass.youtube_search_bar.setValue(\"checking\");\n\tawait expect(pageClass.search_bar_location).toHaveText(\n\t\t\"Paste a valid Youtube URL\"\n\t);\n\tawait pageClass.search_bar_icon.click();\n\tawait expect(pageClass.tooltip).toBePresent();\n\tawait pageClass.youtube_search_bar.click();\n}\n\n(async () =\u003e {\n\t// list of test cases to run in case of the suite, it will list all the names of the test cases to run here\n\tawait validating_the_search_bar();\n\n\tawait browser.deleteSession(); // deletes the session after executing the cases\n\t// not required if used in the WDIO Test Runner\n})();\n```\n\n## Setup\n\n-   Create a npm package `npm init` on a directory\n-   In package.json mention `type: \"module\"`\n-   Create a file, copy the generated script, run it.\n\n### Missing Pieces\n\nThere are several commands I missed as mentioned here: https://www.selenium.dev/selenium-ide/docs/en/api/commands, part of the reason is because i am looking for the expected webdriverio command or else it is selenium specific, either way I might have missed too, Happy to take note some critical misses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRahulARanger%2FWTicks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRahulARanger%2FWTicks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRahulARanger%2FWTicks/lists"}