{"id":21347312,"url":"https://github.com/ziolko/wdio","last_synced_at":"2025-07-12T17:31:55.940Z","repository":{"id":8298369,"uuid":"57906104","full_name":"ziolko/wdio","owner":"ziolko","description":"Wrapper for webdriver.io allowing to write test in synchronous way","archived":false,"fork":false,"pushed_at":"2023-02-27T18:29:18.000Z","size":255,"stargazers_count":7,"open_issues_count":7,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T07:43:16.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ziolko.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-02T17:04:47.000Z","updated_at":"2022-02-11T10:34:24.000Z","dependencies_parsed_at":"2024-11-22T02:13:44.462Z","dependency_job_id":"127d45e3-bcfc-4064-a211-f9bdad610d4f","html_url":"https://github.com/ziolko/wdio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziolko/wdio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fwdio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fwdio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fwdio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fwdio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziolko","download_url":"https://codeload.github.com/ziolko/wdio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fwdio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265025506,"owners_count":23699760,"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-11-22T02:13:42.117Z","updated_at":"2025-07-12T17:31:55.691Z","avatar_url":"https://github.com/ziolko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Synchronous Javascript integration tests\r\n[Webdriver.io](http://webdriver.io/) does a great job providing intuitive Selenium bindings for NodeJS.\r\n It provides also a [test runner](http://webdriver.io/guide/testrunner/gettingstarted.html) allowing to write\r\n tests in a synchronous way. The problem with this test runner is that it does not work well with IntelliJ IDEA\r\n (e.g. you can't set a breakpoint and debug your code).\r\n\r\n With this library you can write tests in a synchronous manner while still using your favourite test runner.\r\n\r\n To preview how this library makes your life easier in IDE like IntelliJ IDEA or Webstorm watch [this video](https://www.youtube.com/watch?v=T3Oq4lpCGTs).\r\n \r\n \r\n \u003e __Important:__ This package supports v4 of Webdriver.io. Version 5 is not supported.\r\n \r\n# Usage\r\n```javascript\r\nconst wdio = require('wdio');\r\nconst assert = require('chai').assert;\r\n\r\ndescribe('Google web search engine', function() {\r\n    this.timeout(60000);\r\n\r\n    // Create a webdriver.io 'browser' object. Now you can call on this object every\r\n    // method described on http://webdriver.io/api.html\r\n    var browser = wdio.getBrowser({\r\n        desiredCapabilities: {\r\n            browserName: 'firefox'\r\n        }\r\n    });\r\n\r\n    // Initialize selenium standalone server if it is not started yet\r\n    before(wdio.initSelenium);\r\n\r\n    // Every code using the 'browser' object has to be wrapped by wdio.wrap\r\n    before(wdio.wrap(function() {\r\n        browser.init();\r\n    }));\r\n\r\n    after(wdio.wrap(function() {\r\n        browser.end();\r\n    }));\r\n\r\n    // If you use Mocha test framework then wrap every single test by wdio.wrap\r\n    // Important: Using wdio.wrap on 'describe' method is invalid.\r\n    // Use it only for: 'it', 'before', 'after', 'beforeEach' and 'afterEach'\r\n    it('Should return \"Google\" when asked about page title', wdio.wrap(function () {\r\n        browser.url('http://www.google.com');\r\n        assert.equal('Google', browser.getTitle());\r\n    }));\r\n});\r\n```\r\n\r\n# API\r\n```javascript\r\n\r\n/**\r\n* Run selenium standalone server. If port 4444 is busy it does nothing.\r\n* Otherwise it uses npm package `selenium-standalone` to run selenium\r\n* standalone process. The parameter 'option' is optional. If it exists\r\n* then options.install is passed to the method selenium.install and\r\n* options.start is passed to the method selenium.start.\r\n* Selenium.install and selenium.start are described on:\r\n* https://www.npmjs.com/package/selenium-standalone\r\n*/\r\nwdio.initSelenium = function([options], callback) { ... }\r\n\r\n/**\r\n * Return a webdriver.io browser instance. The options object as described on\r\n * http://webdriver.io/guide/getstarted/configuration.html\r\n * Returned object has all methods described on http://webdriver.io/api.html\r\n */\r\nwdio.getBrowser = function(options) { ... }\r\n\r\n/**\r\n * Wrapper for synchronous webdriver.io code. It returns another function\r\n * taking a callback as an argument.\r\n * The provided callback will be called once a test is done.\r\n * In case of error it will be called with the error as an argument.\r\n * This API makes wdio compatible with Mocha test framework.\r\n */\r\nwdio.wrap = function(code) { ... }\r\n\r\n/**\r\n * Runs synchronous webdriver.io code and calls a callbkack when finished\r\n */\r\nwdio.run = function(code, callback) { ... }\r\n```\r\n\r\n# Errors description\r\n### It seems you've forgotten to wrap a call to webdriver.io method into w wdio.wrap\r\nEach call to webdriver.io API has to be wrapped by _wdio.wrap_. If you use Mocha check\r\n that _it_, _before_, _after_, _beforeEach_ and _afterEach_ calls are wrapped by _wdio.wrap_ like\r\n on the example above.\r\n\r\n### No callback for the wdio.wrap provided.\r\nIt basically means you used _wdio.wrap_ in a wrong place (like _describe_ if you use Mocha). For Mocha\r\nensure that _wdio.wrap_ was used in _it_, _before_, _after_, _beforeEach_ or _afterEach_.\r\n\r\n### No callback for the wdio.run provided\r\nIf you use _wdio.run_ you have to pass two parameters - the code to run and a callback to\r\ncall once finished. Double check if you've passed both parameters.\r\n\r\n# License\r\nhttps://opensource.org/licenses/MIT\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziolko%2Fwdio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziolko%2Fwdio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziolko%2Fwdio/lists"}