Skip to content

Commit eed94f0

Browse files
committed
auto updated documentation
1 parent 9dbbc5c commit eed94f0

File tree

5 files changed

+398
-68
lines changed

5 files changed

+398
-68
lines changed

docs/modules/AMQP.md

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,60 @@ To use this module with Composer you need <em>"videlalvaro/php-amqplib": "*"</em
5858

5959
### Actions
6060

61+
#### bindQueueToExchange
62+
63+
Binds a queue to an exchange
64+
65+
This is an alias of method `queue_bind` of `PhpAmqpLib\Channel\AMQPChannel`.
66+
67+
{% highlight php %}
68+
69+
<?php
70+
$I->bindQueueToExchange(
71+
'nameOfMyQueueToBind', // name of the queue
72+
'transactionTracking.transaction', // exchange name to bind to
73+
'your.routing.key' // Optionally, provide a binding key
74+
//.. see the original method for more options
75+
)
76+
77+
{% endhighlight %}
78+
79+
80+
#### declareExchange
81+
82+
Declares an exchange
83+
84+
This is an alias of method `exchange_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
85+
86+
{% highlight php %}
87+
88+
<?php
89+
$I->declareExchange(
90+
'nameOfMyExchange', // exchange name
91+
'topic' // exchange type
92+
//.. see the original method for more options
93+
)
94+
95+
{% endhighlight %}
96+
97+
98+
#### declareQueue
99+
100+
Declares a queue
101+
102+
This is an alias of method `queue_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
103+
104+
{% highlight php %}
105+
106+
<?php
107+
$I->declareQueue(
108+
'nameOfMyQueue', // exchange name
109+
//.. see the original method for more options
110+
)
111+
112+
{% endhighlight %}
113+
114+
61115
#### grabMessageFromQueue
62116

63117
Takes last message from queue.
@@ -131,51 +185,6 @@ $I->pushToQueue('queue.jobs', new AMQPMessage('create'));
131185
* `param` $message string|AMQPMessage
132186

133187

134-
#### declareExchange
135-
136-
Declares an exchange. This is an alias of method `exchange_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
137-
138-
{% highlight php %}
139-
140-
<?php
141-
$I->declareExchange(
142-
'nameOfMyExchange', // exchange name
143-
'topic' // exchange type
144-
//.. see the original method for more options
145-
)
146-
147-
{% endhighlight %}
148-
149-
#### declareQueue
150-
151-
Declares a queue. This is an alias of method `queue_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
152-
153-
{% highlight php %}
154-
155-
<?php
156-
$I->declareQueue(
157-
'nameOfMyQueue', // exchange name
158-
//.. see the original method for more options
159-
)
160-
161-
{% endhighlight %}
162-
163-
#### bindQueueToExchange
164-
165-
Binds a queue to an exchange. This is an alias of method `queue_bind` of `PhpAmqpLib\Channel\AMQPChannel`.
166-
167-
{% highlight php %}
168-
169-
<?php
170-
$I->bindQueueToExchange(
171-
'nameOfMyQueueToBind', // name of the queue
172-
'transactionTracking.transaction', // exchange name to bind to
173-
'your.routing.key' // Optionally, provide a binding key
174-
//.. see the original method for more options
175-
)
176-
177-
{% endhighlight %}
178-
179188
#### seeMessageInQueueContainsText
180189

181190
Checks if message containing text received.

docs/modules/AngularJS.md

Lines changed: 131 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,20 @@ $I->clickWithRightButton(['css' => '.checkout'], 20, 50);
331331
@throws \Codeception\Exception\ElementNotFound
332332

333333

334+
#### closeTab
335+
336+
Closes current browser tab and switches to previous active tab.
337+
338+
{% highlight php %}
339+
340+
<?php
341+
$I->closeTab();
342+
343+
{% endhighlight %}
344+
345+
Can't be used with PhantomJS
346+
347+
334348
#### debugWebDriverLogs
335349

336350
Print out latest Selenium Logs in debug mode
@@ -455,6 +469,7 @@ $I->dontSeeElement('input', ['value' => '123456']);
455469
Opposite of `seeElementInDOM`.
456470

457471
* `param` $selector
472+
* `param array` $attributes
458473

459474

460475
#### dontSeeInCurrentUrl
@@ -687,13 +702,6 @@ $I->fillField(['name' => 'email'], 'jon@mail.com');
687702
* `param` $value
688703

689704

690-
#### getVisibleText
691-
692-
Grabs all visible text from the current page.
693-
694-
* `return` string
695-
696-
697705
#### grabAttributeFrom
698706

699707
Grabs the value of the given attribute value from the given element.
@@ -874,6 +882,23 @@ $I->moveMouseOver(['css' => '.checkout'], 20, 50);
874882
@throws \Codeception\Exception\ElementNotFound
875883

876884

885+
#### openNewTab
886+
887+
Opens a new browser tab (wherever it is possible) and switches to it.
888+
889+
{% highlight php %}
890+
891+
<?php
892+
$I->openNewTab();
893+
894+
{% endhighlight %}
895+
Tab is opened by using `window.open` javascript in a browser.
896+
Please note, that adblock can restrict creating such tabs.
897+
898+
Can't be used with PhantomJS
899+
900+
901+
877902
#### pauseExecution
878903

879904
Pauses test execution in debug mode.
@@ -883,6 +908,57 @@ This method is useful while writing tests,
883908
since it allows you to inspect the current page in the middle of a test case.
884909

885910

911+
#### performOn
912+
913+
Waits for element and runs a sequence of actions inside its context.
914+
Actions can be defined with array, callback, or `Codeception\Util\ActionSequence` instance.
915+
916+
Actions as array are recommended for simple to combine "waitForElement" with assertions;
917+
`waitForElement($el)` and `see('text', $el)` can be simplified to:
918+
919+
{% highlight php %}
920+
921+
<?php
922+
$I->performOn($el, ['see' => 'text']);
923+
924+
{% endhighlight %}
925+
926+
List of actions can be pragmatically build using `Codeception\Util\ActionSequence`:
927+
928+
{% highlight php %}
929+
930+
<?php
931+
$I->performOn('.model', ActionSequence::build()
932+
->see('Warning')
933+
->see('Are you sure you want to delete this?')
934+
->click('Yes')
935+
);
936+
937+
{% endhighlight %}
938+
939+
Actions executed from array or ActionSequence will print debug output for actions, and adds an action name to
940+
exception on failure.
941+
942+
Whenever you need to define more actions a callback can be used. A WebDriver module is passed for argument:
943+
944+
{% highlight php %}
945+
946+
<?php
947+
$I->performOn('.rememberMe', function (WebDriver $I) {
948+
$I->see('Remember me next time');
949+
$I->seeElement('#LoginForm_rememberMe');
950+
$I->dontSee('Login');
951+
});
952+
953+
{% endhighlight %}
954+
955+
In 3rd argument you can set number a seconds to wait for element to appear
956+
957+
* `param` $element
958+
* `param` $actions
959+
* `param int` $timeout
960+
961+
886962
#### pressKey
887963

888964
Presses the given key on the given element.
@@ -1102,6 +1178,7 @@ $I->seeElementInDOM('//form/input[type=hidden]');
11021178
{% endhighlight %}
11031179

11041180
* `param` $selector
1181+
* `param array` $attributes
11051182

11061183

11071184
#### seeInCurrentUrl
@@ -1236,6 +1313,8 @@ as created by `window.alert`|`window.confirm`|`window.prompt`, contains the give
12361313

12371314
* `param` $text
12381315

1316+
@throws \Codeception\Exception\ModuleException
1317+
12391318

12401319
#### seeInSource
12411320

@@ -1588,6 +1667,46 @@ $I->switchToIFrame();
15881667
* `param string|null` $name
15891668
15901669
1670+
#### switchToNextTab
1671+
1672+
Switches to next browser tab.
1673+
An offset can be specified.
1674+
1675+
{% highlight php %}
1676+
1677+
<?php
1678+
// switch to next tab
1679+
$I->switchToNextTab();
1680+
// switch to 2nd next tab
1681+
$I->switchToNextTab(2);
1682+
1683+
{% endhighlight %}
1684+
1685+
Can't be used with PhantomJS
1686+
1687+
* `param int` $offset 1
1688+
1689+
1690+
#### switchToPreviousTab
1691+
1692+
Switches to next browser tab.
1693+
An offset can be specified.
1694+
1695+
{% highlight php %}
1696+
1697+
<?php
1698+
// switch to previous tab
1699+
$I->switchToNextTab();
1700+
// switch to 2nd previous tab
1701+
$I->switchToNextTab(-2);
1702+
1703+
{% endhighlight %}
1704+
1705+
Can't be used with PhantomJS
1706+
1707+
* `param int` $offset 1
1708+
1709+
15911710
#### switchToWindow
15921711
15931712
Switch to another window identified by name.
@@ -1613,7 +1732,9 @@ $I->switchToWindow();
16131732
16141733
{% endhighlight %}
16151734
1616-
If the window has no name, the only way to access it is via the `executeInSelenium()` method, like so:
1735+
If the window has no name, match it by switching to next active tab using `switchToNextTab` method.
1736+
1737+
Or use native Selenium functions to get access to all opened windows:
16171738
16181739
{% highlight php %}
16191740
@@ -1636,6 +1757,8 @@ Enters text into a native JavaScript prompt popup, as created by `window.prompt`
16361757
16371758
* `param` $keys
16381759
1760+
@throws \Codeception\Exception\ModuleException
1761+
16391762
16401763
#### uncheckOption
16411764

docs/modules/REST.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ $I->sendPOST('some-other-page.php');
9797
{% endhighlight %}
9898

9999
* `param string` $name the name of the header to delete.
100+
* `[Part]` json
101+
* `[Part]` xml
102+
103+
104+
#### dontSeeBinaryResponseEquals
105+
106+
Checks if the hash of a binary response is not the same as provided.
107+
108+
{% highlight php %}
109+
110+
<?php
111+
$I->dontSeeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded");
112+
?>
113+
114+
{% endhighlight %}
115+
Opposite to `seeBinaryResponseEquals`
116+
117+
* `param` $hash the hashed data response expected
118+
* `param` $algo the hash algorithm to use. Default md5.
119+
* `[Part]` json
120+
* `[Part]` xml
100121

101122

102123
#### dontSeeHttpHeader
@@ -318,6 +339,49 @@ $I->haveHttpHeader('Content-Type', 'application/json');
318339
* `[Part]` xml
319340

320341

342+
#### seeBinaryResponseEquals
343+
344+
Checks if the hash of a binary response is exactly the same as provided.
345+
Parameter can be passed as any hash string supported by hash(), with an
346+
optional second parameter to specify the hash type, which defaults to md5.
347+
348+
Example: Using md5 hash key
349+
350+
{% highlight php %}
351+
352+
<?php
353+
$I->seeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded");
354+
?>
355+
356+
{% endhighlight %}
357+
358+
Example: Using md5 for a file contents
359+
360+
{% highlight php %}
361+
362+
<?php
363+
$fileData = file_get_contents("test_file.jpg");
364+
$I->seeBinaryResponseEquals(md5($fileData));
365+
?>
366+
367+
{% endhighlight %}
368+
Example: Using sha256 hsah
369+
370+
{% highlight php %}
371+
372+
<?php
373+
$fileData = '/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k='; // very small jpeg
374+
$I->seeBinaryResponseEquals(hash("sha256", base64_decode($fileData)), 'sha256');
375+
?>
376+
377+
{% endhighlight %}
378+
379+
* `param` $hash the hashed data response expected
380+
* `param` $algo the hash algorithm to use. Default md5.
381+
* `[Part]` json
382+
* `[Part]` xml
383+
384+
321385
#### seeHttpHeader
322386

323387
Checks over the given HTTP header and (optionally)

0 commit comments

Comments
 (0)