From 01c4b1c7e05e98b9a4ad234864c25e6c2099c606 Mon Sep 17 00:00:00 2001 From: Davert Date: Fri, 4 Dec 2015 05:24:44 +0200 Subject: [PATCH] updated docs --- README.md | 45 ----------------- docs/helpers/FileSystem.md | 16 +++--- docs/helpers/WebDriverIO.md | 99 +++++++++++++++++++++++++++---------- lib/helper/WebDriverIO.js | 46 +++++++++++++++++ 4 files changed, 126 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 8b85efd05..a7c6aab36 100644 --- a/README.md +++ b/README.md @@ -255,51 +255,6 @@ Scenario('test some forms', (I, docsPage) => { }); ``` -## Connect through proxy - -CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will -need to update the `helpers.WebDriverIO.proxy` key. - -```js -{ - "helpers": { - "WebDriverIO": { - "proxy": { - "proxyType": "manual|pac", - "proxyAutoconfigUrl": "URL TO PAC FILE", - "httpProxy": "PROXY SERVER", - "sslProxy": "PROXY SERVER", - "ftpProxy": "PROXY SERVER", - "socksProxy": "PROXY SERVER", - "socksUsername": "USERNAME", - "socksPassword": "PASSWORD", - "noProxy": "BYPASS ADDRESSES" - } - } - } -} -``` - -For example, - -```js -{ - "helpers": { - "WebDriverIO": { - "proxy": { - "proxyType": "manual", - "httpProxy": "http://corporate.proxy:8080", - "socksUsername": "codeceptjs", - "socksPassword": "secret", - "noProxy": "127.0.0.1,localhost" - } - } - } -} -``` - -Please refer to [Selenium - Proxy Object](https://code.google.com/p/selenium/wiki/DesiredCapabilities#Proxy_JSON_Object) for more information. - ## Current State CodeceptJS is in its early days. Any feedback, issues, and pull requests are welcome. Try it, and if you like it - help us make it better! diff --git a/docs/helpers/FileSystem.md b/docs/helpers/FileSystem.md index ad446702b..3a5353943 100644 --- a/docs/helpers/FileSystem.md +++ b/docs/helpers/FileSystem.md @@ -1,6 +1,6 @@ # FileSystem -[lib/helper/FileSystem.js:22-87](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L22-L87 "Source code on GitHub") +[lib/helper/FileSystem.js:22-87](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L22-L87 "Source code on GitHub") Helper for testing filesystem. Can be easily used to check file structures: @@ -14,7 +14,7 @@ I.dontSeeInThisFile("WebDriverIO"); ## amInPath -[lib/helper/FileSystem.js:34-37](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L34-L37 "Source code on GitHub") +[lib/helper/FileSystem.js:34-37](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L34-L37 "Source code on GitHub") Enters a directory In local filesystem. Starts from a current directory @@ -25,7 +25,7 @@ Starts from a current directory ## dontSeeFileContentsEqual -[lib/helper/FileSystem.js:82-85](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L82-L85 "Source code on GitHub") +[lib/helper/FileSystem.js:82-85](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L82-L85 "Source code on GitHub") Checks that contents of file found by `seeFile` doesn't equal to text. @@ -36,7 +36,7 @@ Checks that contents of file found by `seeFile` doesn't equal to text. ## dontSeeInThisFile -[lib/helper/FileSystem.js:66-69](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L66-L69 "Source code on GitHub") +[lib/helper/FileSystem.js:66-69](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L66-L69 "Source code on GitHub") Checks that file found by `seeFile` doesn't include text. @@ -47,7 +47,7 @@ Checks that file found by `seeFile` doesn't include text. ## seeFile -[lib/helper/FileSystem.js:49-53](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L49-L53 "Source code on GitHub") +[lib/helper/FileSystem.js:49-53](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L49-L53 "Source code on GitHub") Checks that file exists @@ -57,7 +57,7 @@ Checks that file exists ## seeFileContentsEqual -[lib/helper/FileSystem.js:74-77](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L74-L77 "Source code on GitHub") +[lib/helper/FileSystem.js:74-77](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L74-L77 "Source code on GitHub") Checks that contents of file found by `seeFile` equal to text. @@ -68,7 +68,7 @@ Checks that contents of file found by `seeFile` equal to text. ## seeInThisFile -[lib/helper/FileSystem.js:58-61](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L58-L61 "Source code on GitHub") +[lib/helper/FileSystem.js:58-61](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L58-L61 "Source code on GitHub") Checks that file found by `seeFile` includes a text. @@ -79,7 +79,7 @@ Checks that file found by `seeFile` includes a text. ## writeToFile -[lib/helper/FileSystem.js:42-44](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/FileSystem.js#L42-L44 "Source code on GitHub") +[lib/helper/FileSystem.js:42-44](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/FileSystem.js#L42-L44 "Source code on GitHub") Writes test to file diff --git a/docs/helpers/WebDriverIO.md b/docs/helpers/WebDriverIO.md index ece41d247..3486979e4 100644 --- a/docs/helpers/WebDriverIO.md +++ b/docs/helpers/WebDriverIO.md @@ -1,6 +1,6 @@ # WebDriverIO -[lib/helper/WebDriverIO.js:36-438](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L36-L438 "Source code on GitHub") +[lib/helper/WebDriverIO.js:82-487](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L82-L487 "Source code on GitHub") WebDriverIO helper which wraps [webdriverio](http://webdriver.io/) library to manipulate browser using Selenium WebDriver or PhantomJS. @@ -27,13 +27,58 @@ This helper should be configured in codecept.json Additional configuration params can be used from + Connect through proxy + +CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will +need to update the `helpers.WebDriverIO.proxy` key. + +```js +{ + "helpers": { + "WebDriverIO": { + "proxy": { + "proxyType": "manual|pac", + "proxyAutoconfigUrl": "URL TO PAC FILE", + "httpProxy": "PROXY SERVER", + "sslProxy": "PROXY SERVER", + "ftpProxy": "PROXY SERVER", + "socksProxy": "PROXY SERVER", + "socksUsername": "USERNAME", + "socksPassword": "PASSWORD", + "noProxy": "BYPASS ADDRESSES" + } + } + } +} +``` + +For example, + +```js +{ + "helpers": { + "WebDriverIO": { + "proxy": { + "proxyType": "manual", + "httpProxy": "http://corporate.proxy:8080", + "socksUsername": "codeceptjs", + "socksPassword": "secret", + "noProxy": "127.0.0.1,localhost" + } + } + } +} +``` + +Please refer to [Selenium - Proxy Object](https://code.google.com/p/selenium/wiki/DesiredCapabilities#Proxy_JSON_Object) for more information. + **Parameters** - `config` ## amOnPage -[lib/helper/WebDriverIO.js:71-75](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L71-L75 "Source code on GitHub") +[lib/helper/WebDriverIO.js:120-124](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L120-L124 "Source code on GitHub") Opens a web page in a browser. Requires relative or absolute url. If url starts with `/`, opens a web page of a site defined in `url` config parameter. @@ -50,7 +95,7 @@ I.amOnPage('/login'); // opens a login page ## attachFile -[lib/helper/WebDriverIO.js:191-193](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L191-L193 "Source code on GitHub") +[lib/helper/WebDriverIO.js:240-242](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L240-L242 "Source code on GitHub") Attaches a file to element located by CSS or XPath @@ -61,7 +106,7 @@ Attaches a file to element located by CSS or XPath ## checkOption -[lib/helper/WebDriverIO.js:206-222](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L206-L222 "Source code on GitHub") +[lib/helper/WebDriverIO.js:255-271](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L255-L271 "Source code on GitHub") Selects a checkbox or radio button. Element is located by label or name or CSS or XPath. @@ -80,7 +125,7 @@ I.checkOption('I Agree to Terms and Conditions'); ## click -[lib/helper/WebDriverIO.js:100-113](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L100-L113 "Source code on GitHub") +[lib/helper/WebDriverIO.js:149-162](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L149-L162 "Source code on GitHub") Perform a click on a link or a button, given by a locator. If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. @@ -111,7 +156,7 @@ I.click({css: 'nav a.login'}); ## dontSee -[lib/helper/WebDriverIO.js:312-314](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L312-L314 "Source code on GitHub") +[lib/helper/WebDriverIO.js:361-363](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L361-L363 "Source code on GitHub") Opposite to `see`. Checks that a text is not present on a page. Use context parameter to narrow down the search. @@ -127,7 +172,7 @@ I.dontSee('Login'); // assume we are already logged in ## dontSeeElement -[lib/helper/WebDriverIO.js:333-337](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L333-L337 "Source code on GitHub") +[lib/helper/WebDriverIO.js:382-386](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L382-L386 "Source code on GitHub") Opposite to `seeElement`. Checks that element is not on page. @@ -137,7 +182,7 @@ Opposite to `seeElement`. Checks that element is not on page. ## dontSeeInCurrentUrl -[lib/helper/WebDriverIO.js:355-359](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L355-L359 "Source code on GitHub") +[lib/helper/WebDriverIO.js:404-408](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L404-L408 "Source code on GitHub") Checks that current url does not contain a provided fragment. @@ -147,7 +192,7 @@ Checks that current url does not contain a provided fragment. ## doubleClick -[lib/helper/WebDriverIO.js:118-120](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L118-L120 "Source code on GitHub") +[lib/helper/WebDriverIO.js:167-169](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L167-L169 "Source code on GitHub") Performs a double-click on an element matched by CSS or XPath. @@ -157,7 +202,7 @@ Performs a double-click on an element matched by CSS or XPath. ## executeAsyncScript -[lib/helper/WebDriverIO.js:375-377](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L375-L377 "Source code on GitHub") +[lib/helper/WebDriverIO.js:424-426](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L424-L426 "Source code on GitHub") Executes async script on page. Provided function should execute a passed callback (as first argument) to signal it is finished. @@ -168,7 +213,7 @@ Provided function should execute a passed callback (as first argument) to signal ## executeScript -[lib/helper/WebDriverIO.js:367-369](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L367-L369 "Source code on GitHub") +[lib/helper/WebDriverIO.js:416-418](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L416-L418 "Source code on GitHub") Executes sync script on a page. Pass arguments to function as additional parameters. @@ -181,7 +226,7 @@ In this case you should use generator and yield to receive results. ## fillField -[lib/helper/WebDriverIO.js:137-145](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L137-L145 "Source code on GitHub") +[lib/helper/WebDriverIO.js:186-194](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L186-L194 "Source code on GitHub") Fills a text field or textarea with the given string. Field is located by name, label, CSS, or XPath. @@ -204,7 +249,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John'); ## grabAttribute -[lib/helper/WebDriverIO.js:260-264](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L260-L264 "Source code on GitHub") +[lib/helper/WebDriverIO.js:309-313](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L309-L313 "Source code on GitHub") Retrieves an attribute from an element located by CSS or XPath and returns it to test. Resumes test execution, so **should be used inside a generator with `yield`** operator. @@ -220,7 +265,7 @@ let hint = yield I.grabAttributeFrom('#tooltip', 'title'); ## grabTextFrom -[lib/helper/WebDriverIO.js:232-236](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L232-L236 "Source code on GitHub") +[lib/helper/WebDriverIO.js:281-285](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L281-L285 "Source code on GitHub") Retrieves a text from an element located by CSS or XPath and returns it to test. Resumes test execution, so **should be used inside a generator with `yield`** operator. @@ -235,7 +280,7 @@ let pin = yield I.grabTextFrom('#pin'); ## grabTitle -[lib/helper/WebDriverIO.js:283-288](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L283-L288 "Source code on GitHub") +[lib/helper/WebDriverIO.js:332-337](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L332-L337 "Source code on GitHub") Retrieves a page title and returns it to test. Resumes test execution, so **should be used inside a generator with `yield`** operator. @@ -246,7 +291,7 @@ let title = yield I.grabTitle(); ## grabValueFrom -[lib/helper/WebDriverIO.js:246-250](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L246-L250 "Source code on GitHub") +[lib/helper/WebDriverIO.js:295-299](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L295-L299 "Source code on GitHub") Retrieves a value from a form element located by CSS or XPath and returns it to test. Resumes test execution, so **should be used inside a generator with `yield`** operator. @@ -261,7 +306,7 @@ let email = yield I.grabValueFrom('input[name=email]'); ## see -[lib/helper/WebDriverIO.js:300-302](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L300-L302 "Source code on GitHub") +[lib/helper/WebDriverIO.js:349-351](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L349-L351 "Source code on GitHub") Checks that a page contains a visible text. Use context parameter to narrow down the search. @@ -279,7 +324,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator ## seeElement -[lib/helper/WebDriverIO.js:324-328](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L324-L328 "Source code on GitHub") +[lib/helper/WebDriverIO.js:373-377](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L373-L377 "Source code on GitHub") Checks that element is present on page. Element is located by CSS or XPath. @@ -294,7 +339,7 @@ I.seeElement('#modal'); ## seeInCurrentUrl -[lib/helper/WebDriverIO.js:346-350](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L346-L350 "Source code on GitHub") +[lib/helper/WebDriverIO.js:395-399](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L395-L399 "Source code on GitHub") Checks that current url contains a provided fragment. @@ -308,7 +353,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page ## seeInTitle -[lib/helper/WebDriverIO.js:269-273](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L269-L273 "Source code on GitHub") +[lib/helper/WebDriverIO.js:318-322](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L318-L322 "Source code on GitHub") Checks that title contains text. @@ -318,7 +363,7 @@ Checks that title contains text. ## selectOption -[lib/helper/WebDriverIO.js:161-186](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L161-L186 "Source code on GitHub") +[lib/helper/WebDriverIO.js:210-235](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L210-L235 "Source code on GitHub") Selects an option in a drop-down select. Field is siearched by label | name | CSS | XPath. @@ -340,7 +385,7 @@ I.selectOption({css: 'form select[name=account]'}, 'Premium'); ## wait -[lib/helper/WebDriverIO.js:382-384](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L382-L384 "Source code on GitHub") +[lib/helper/WebDriverIO.js:431-433](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L431-L433 "Source code on GitHub") Pauses execution for a number of seconds. @@ -350,7 +395,7 @@ Pauses execution for a number of seconds. ## waitForElement -[lib/helper/WebDriverIO.js:399-402](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L399-L402 "Source code on GitHub") +[lib/helper/WebDriverIO.js:448-451](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L448-L451 "Source code on GitHub") Waits for element to be present on page (by default waits for 1sec). Element can be located by CSS or XPath. @@ -362,7 +407,7 @@ Element can be located by CSS or XPath. ## waitForEnabled -[lib/helper/WebDriverIO.js:390-393](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L390-L393 "Source code on GitHub") +[lib/helper/WebDriverIO.js:439-442](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L439-L442 "Source code on GitHub") Waits for element to become enabled (by default waits for 1sec). Element can be located by CSS or XPath. @@ -374,7 +419,7 @@ Element can be located by CSS or XPath. ## waitForText -[lib/helper/WebDriverIO.js:409-420](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L409-L420 "Source code on GitHub") +[lib/helper/WebDriverIO.js:458-469](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L458-L469 "Source code on GitHub") Waits for a text to appear (by default waits for 1sec). Element can be located by CSS or XPath. @@ -388,7 +433,7 @@ Narrow down search results by providing context. ## waitForVisible -[lib/helper/WebDriverIO.js:426-429](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L426-L429 "Source code on GitHub") +[lib/helper/WebDriverIO.js:475-478](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L475-L478 "Source code on GitHub") Waits for an element to become visible on a page (by default waits for 1sec). Element can be located by CSS or XPath. @@ -400,7 +445,7 @@ Element can be located by CSS or XPath. ## waitUntil -[lib/helper/WebDriverIO.js:434-437](https://github.com/Codeception/CodeceptJS/blob/478d1362d9a1755b85bc94e1f57b738d905fb6e5/lib/helper/WebDriverIO.js#L434-L437 "Source code on GitHub") +[lib/helper/WebDriverIO.js:483-486](https://github.com/Codeception/CodeceptJS/blob/d8291463c033201c9ee70f96b4ef33137782c548/lib/helper/WebDriverIO.js#L483-L486 "Source code on GitHub") Waits for a function to return true (waits for 1sec by default). diff --git a/lib/helper/WebDriverIO.js b/lib/helper/WebDriverIO.js index da452e49b..57acade02 100644 --- a/lib/helper/WebDriverIO.js +++ b/lib/helper/WebDriverIO.js @@ -29,9 +29,55 @@ let xpathLocator = require('../utils').xpathLocator; * * * `url` - base url of website to be tested * * `browser` - browser in which perform testing + * * * Additional configuration params can be used from http://webdriver.io/guide/getstarted/configuration.html * + * Connect through proxy + * + * CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will + * need to update the `helpers.WebDriverIO.proxy` key. + * + * ```js + * { + * "helpers": { + * "WebDriverIO": { + * "proxy": { + * "proxyType": "manual|pac", + * "proxyAutoconfigUrl": "URL TO PAC FILE", + * "httpProxy": "PROXY SERVER", + * "sslProxy": "PROXY SERVER", + * "ftpProxy": "PROXY SERVER", + * "socksProxy": "PROXY SERVER", + * "socksUsername": "USERNAME", + * "socksPassword": "PASSWORD", + * "noProxy": "BYPASS ADDRESSES" + * } + * } + * } + * } + * ``` + * + * For example, + * + * ```js + * { + * "helpers": { + * "WebDriverIO": { + * "proxy": { + * "proxyType": "manual", + * "httpProxy": "http://corporate.proxy:8080", + * "socksUsername": "codeceptjs", + * "socksPassword": "secret", + * "noProxy": "127.0.0.1,localhost" + * } + * } + * } + * } + * ``` + * + * Please refer to [Selenium - Proxy Object](https://code.google.com/p/selenium/wiki/DesiredCapabilities#Proxy_JSON_Object) for more information. + * */ class WebDriverIO extends Helper {