You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take a look at Codeception's architecture. We'll assume that you have already [installed](http://codeception.com/install) it
8
+
Let's take a look at Codeception's architecture. We'll assume that you have already [installed](https://codeception.com/install) it
9
9
and bootstrapped your first test suites. Codeception has generated three of them: unit, functional, and acceptance.
10
-
They are well described in the [previous chapter](http://codeception.com/docs/01-Introduction). Inside your __/tests__ folder you will have three `.yml` config files and three directories
10
+
They are well described in the [previous chapter](https://codeception.com/docs/01-Introduction). Inside your __/tests__ folder you will have three `.yml` config files and three directories
11
11
with names corresponding to these suites: `unit`, `functional`, `acceptance`. Suites are independent groups of tests with a common purpose.
12
12
13
13
## The Codeception Syntax
@@ -49,7 +49,7 @@ One of the main concepts of Codeception is representation of tests as actions of
49
49
who tests the application as a whole, with knowledge of its internals. Lastly we have an AcceptanceTester, a user who works with our application
50
50
through an interface that we provide.
51
51
52
-
Methods of actor classes are generally taken from [Codeception Modules](http://codeception.com/docs/06-ModulesAndHelpers). Each module provides predefined actions for different testing purposes, and they can be combined to fit the testing environment.
52
+
Methods of actor classes are generally taken from [Codeception Modules](https://codeception.com/docs/06-ModulesAndHelpers). Each module provides predefined actions for different testing purposes, and they can be combined to fit the testing environment.
53
53
Codeception tries to solve 90% of possible testing issues in its modules, so you don't have to reinvent the wheel.
54
54
We think that you can spend more time on writing tests and less on writing support code to make those tests run.
55
55
By default, AcceptanceTester relies on PhpBrowser module, which is set in the `tests/acceptance.suite.yml` configuration file:
@@ -263,7 +263,7 @@ class TaskCrudCest
263
263
264
264
{% endhighlight %}
265
265
266
-
Learn more about the [Cest format](http://codeception.com/docs/07-AdvancedUsage#Cest-Classes) in the Advanced Testing section.
266
+
Learn more about the [Cest format](https://codeception.com/docs/07-AdvancedUsage#Cest-Classes) in the Advanced Testing section.
267
267
268
268
## Interactive Pause
269
269
@@ -325,7 +325,7 @@ Now you can execute all the commands of a corresponding Actor class and see the
325
325
## BDD
326
326
327
327
Codeception allows execution of user stories in Gherkin format in a similar manner as is done in Cucumber or Behat.
328
-
Please refer to [the BDD chapter](http://codeception.com/docs/07-BDD) to learn more.
328
+
Please refer to [the BDD chapter](https://codeception.com/docs/07-BDD) to learn more.
329
329
330
330
## Configuration
331
331
@@ -392,7 +392,7 @@ php vendor/bin/codecept run tests/acceptance/backend:^login
392
392
393
393
{% endhighlight %}
394
394
395
-
To execute a group of tests that are not stored in the same directory, you can organize them in [groups](http://codeception.com/docs/07-AdvancedUsage#Groups).
395
+
To execute a group of tests that are not stored in the same directory, you can organize them in [groups](https://codeception.com/docs/07-AdvancedUsage#Groups).
Copy file name to clipboardExpand all lines: docs/03-AcceptanceTests.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ $I->see('Welcome, Davert!');
39
39
| JavaScript | No | Yes |
40
40
| `see`/`seeElement` checks if… | …text is present in the HTML source | …text is actually visible to the user |
41
41
| Access to HTTP response headers and status codes | Yes | No |
42
-
| System requirements | PHP with [ext-curl](http://php.net/manual/book.curl.php) | Chrome or Firefox; optionally with Selenium Standalone Server |
42
+
| System requirements | PHP with [ext-curl](https://php.net/manual/book.curl.php) | Chrome or Firefox; optionally with Selenium Standalone Server |
43
43
| Speed | Fast | Slow |
44
44
45
45
We will start writing our first acceptance tests with PhpBrowser.
@@ -48,7 +48,7 @@ We will start writing our first acceptance tests with PhpBrowser.
48
48
49
49
This is the fastest way to run acceptance tests since it doesn't require running an actual browser.
50
50
We use a PHP web scraper, which acts like a browser: It sends a request, then receives and parses the response.
51
-
Codeception uses [Guzzle](http://guzzlephp.org) and [Symfony BrowserKit](http://symfony.com/doc/current/components/browser_kit.html) to interact with HTML web pages.
51
+
Codeception uses [Guzzle](https://guzzlephp.org) and [Symfony BrowserKit](https://symfony.com/doc/current/components/browser_kit.html) to interact with HTML web pages.
52
52
53
53
Common PhpBrowser drawbacks:
54
54
@@ -91,7 +91,7 @@ class SigninCest
91
91
{% endhighlight %}
92
92
93
93
The `$I` object is used to write all interactions.
94
-
The methods of the `$I` object are taken from the [PhpBrowser Module](http://codeception.com/docs/modules/PhpBrowser). We will briefly describe them here:
94
+
The methods of the `$I` object are taken from the [PhpBrowser Module](https://codeception.com/docs/modules/PhpBrowser). We will briefly describe them here:
There is a special class [`Codeception\Util\Locator`](http://codeception.com/docs/reference/Locator)
146
+
There is a special class [`Codeception\Util\Locator`](https://codeception.com/docs/reference/Locator)
147
147
which may help you to generate complex XPath locators.
148
148
For instance, it can easily allow you to click an element on the last row of a table:
149
149
@@ -447,8 +447,8 @@ Now, you are ready to run WebDriver tests using Codeception.
447
447
448
448
> Alternatively, Selenium Server can be installed manually. [Download it](https://www.selenium.dev/downloads/) from the official site and launch a server with Java: `java -jar selenium-server-....jar`. In this case ChromeDriver and GeckoDriver must be installed separately.
449
449
450
-
* For more information refer to [Installation Instructions](http://codeception.com/docs/modules/WebDriver#Selenium)
451
-
* Enable [RunProcess](http://codeception.com/extensions#RunProcess) extension to start/stop Selenium automatically *(optional)*.
450
+
* For more information refer to [Installation Instructions](https://codeception.com/docs/modules/WebDriver#Selenium)
451
+
* Enable [RunProcess](https://codeception.com/extensions#RunProcess) extension to start/stop Selenium automatically *(optional)*.
452
452
453
453
454
454
### Configuration
@@ -469,7 +469,7 @@ modules:
469
469
470
470
{% endhighlight %}
471
471
472
-
See [WebDriver Module](http://codeception.com/docs/modules/WebDriver) for details.
472
+
See [WebDriver Module](https://codeception.com/docs/modules/WebDriver) for details.
473
473
474
474
Please note that actions executed in a browser will behave differently. For instance, `seeElement` won't just check that the element exists on a page,
475
475
but it will also check that element is actually visible to the user:
@@ -501,8 +501,8 @@ $I->click('#agree_button');
501
501
{% endhighlight %}
502
502
503
503
In this case, we are waiting for the 'agree' button to appear and then click it. If it didn't appear after 30 seconds,
504
-
the test will fail. There are other `wait` methods you may use, like [waitForText](http://codeception.com/docs/modules/WebDriver#waitForText),
505
-
[waitForElementVisible](http://codeception.com/docs/modules/WebDriver#waitForElementVisible) and others.
504
+
the test will fail. There are other `wait` methods you may use, like [waitForText](https://codeception.com/docs/modules/WebDriver#waitForText),
505
+
[waitForElementVisible](https://codeception.com/docs/modules/WebDriver#waitForElementVisible) and others.
506
506
507
507
If you don't know what exact element you need to wait for, you can simply pause execution with using `$I->wait()`
508
508
@@ -517,7 +517,7 @@ $I->wait(3); // wait for 3 secs
517
517
518
518
It is possible to wait for elements pragmatically.
519
519
If a test uses element which is not on a page yet, Codeception will wait for few extra seconds before failing.
520
-
This feature is based on [Implicit Wait](http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#implicit-waits) of Selenium.
520
+
This feature is based on [Implicit Wait](https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#implicit-waits) of Selenium.
521
521
Codeception enables implicit wait only when searching for a specific element and disables in all other cases. Thus, the performance of a test is not affected.
522
522
523
523
SmartWait can be enabled by setting `wait` option in WebDriver config. It expects the number of seconds to wait. Example:
@@ -624,7 +624,7 @@ Keep in mind, that you can change retry policy dynamically for each test.
624
624
625
625
#### Wait and Act
626
626
627
-
To combine `waitForElement` with actions inside that element you can use the [performOn](http://codeception.com/docs/modules/WebDriver#performOn) method.
627
+
To combine `waitForElement` with actions inside that element you can use the [performOn](https://codeception.com/docs/modules/WebDriver#performOn) method.
628
628
Let's see how you can perform some actions inside an HTML popup:
For more options see [`performOn()` reference](http://codeception.com/docs/modules/WebDriver#performOn).
653
+
For more options see [`performOn()` reference](https://codeception.com/docs/modules/WebDriver#performOn).
654
654
655
655
#### A/B Testing
656
656
@@ -756,20 +756,20 @@ class AcceptanceTester extends \Codeception\Actor
756
756
Some environments are hard to be reproduced manually, testing Internet Explorer 6-8 on Windows XP may be a hard thing,
757
757
especially if you don't have Windows XP installed. This is where Cloud Testing services come to help you.
758
758
Services such as [SauceLabs](https://saucelabs.com), [BrowserStack](https://www.browserstack.com/)
759
-
and [others](http://codeception.com/docs/modules/WebDriver#Cloud-Testing) can create virtual machines on demand
759
+
and [others](https://codeception.com/docs/modules/WebDriver#Cloud-Testing) can create virtual machines on demand
760
760
and set up Selenium Server and the desired browser. Tests are executed on a remote machine in a cloud,
761
761
to access local files cloud testing services provide a special application called **Tunnel**.
762
762
Tunnel operates on a secured protocol and allows browsers executed in a cloud to connect to a local web server.
763
763
764
764
Cloud Testing services work with the standard WebDriver protocol. This makes setting up cloud testing really easy.
765
-
You just need to set the [WebDriver configuration](http://codeception.com/docs/modules/WebDriver#Cloud-Testing) to:
765
+
You just need to set the [WebDriver configuration](https://codeception.com/docs/modules/WebDriver#Cloud-Testing) to:
766
766
767
767
* specify the host to connect to (depends on the cloud provider)
768
768
* authentication details (to use your account)
769
769
* browser
770
770
* OS
771
771
772
-
We recommend using [params](http://codeception.com/docs/06-ModulesAndHelpers#Dynamic-Configuration-With-Params)
772
+
We recommend using [params](https://codeception.com/docs/06-ModulesAndHelpers#Dynamic-Configuration-With-Params)
773
773
to provide authorization credentials.
774
774
775
775
It should be mentioned that Cloud Testing services are not free. You should investigate their pricing models
@@ -793,8 +793,8 @@ PhpBrowser will store the HTML code and WebDriver will save a screenshot of the
793
793
794
794
Additional debugging features by Codeception:
795
795
796
-
* [Interactive Pause](http://codeception.com/docs/02-GettingStarted#Interactive-Pause) is a REPL that allows to type and check commands for instant feedback.
797
-
* [Recorder Extension](http://codeception.com/addons#CodeceptionExtensionRecorder) allows to record tests step-by-steps and show them in slideshow
796
+
* [Interactive Pause](https://codeception.com/docs/02-GettingStarted#Interactive-Pause) is a REPL that allows to type and check commands for instant feedback.
797
+
* [Recorder Extension](https://codeception.com/addons#CodeceptionExtensionRecorder) allows to record tests step-by-steps and show them in slideshow
798
798
799
799
### Common Cases
800
800
@@ -838,7 +838,7 @@ $I->login('miles', '123456');
838
838
{% endhighlight %}
839
839
840
840
However, implementing all actions for reuse in a single actor class may lead to
841
-
breaking the [Single Responsibility Principle](http://en.wikipedia.org/wiki/Single_responsibility_principle).
841
+
breaking the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle).
842
842
843
843
#### Single Login
844
844
@@ -882,16 +882,16 @@ Note that session restoration only works for `WebDriver` modules
882
882
883
883
By default, WebDriver module is configured to automatically start browser before the test and stop afterward.
884
884
However, this can be switched off with `start: false` module configuration.
885
-
To start a browser you will need to write corresponding methods in Acceptance [Helper](http://codeception.com/docs/06-ModulesAndHelpers#Helpers).
885
+
To start a browser you will need to write corresponding methods in Acceptance [Helper](https://codeception.com/docs/06-ModulesAndHelpers#Helpers).
886
886
887
887
WebDriver module provides advanced methods for the browser session, however, they can only be used from Helpers.
888
888
889
-
* [_initializeSession](http://codeception.com/docs/modules/WebDriver#_initializeSession) - starts a new browser session
890
-
* [_closeSession](http://codeception.com/docs/modules/WebDriver#_closeSession) - stops the browser session
891
-
* [_restart](http://codeception.com/docs/modules/WebDriver#_restart) - updates configuration and restarts browser
892
-
* [_capabilities](http://codeception.com/docs/modules/WebDriver#_capabilities) - set [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities) programmatically.
889
+
* [_initializeSession](https://codeception.com/docs/modules/WebDriver#_initializeSession) - starts a new browser session
890
+
* [_closeSession](https://codeception.com/docs/modules/WebDriver#_closeSession) - stops the browser session
891
+
* [_restart](https://codeception.com/docs/modules/WebDriver#_restart) - updates configuration and restarts browser
892
+
* [_capabilities](https://codeception.com/docs/modules/WebDriver#_capabilities) - set [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities) programmatically.
893
893
894
-
Those methods can be used to create custom commands like `$I->startBrowser()` or used in [before/after](http://codeception.com/docs/06-ModulesAndHelpers#Hooks) hooks.
894
+
Those methods can be used to create custom commands like `$I->startBrowser()` or used in [before/after](https://codeception.com/docs/06-ModulesAndHelpers#Hooks) hooks.
0 commit comments