Z
Z
Zimaell2019-08-07 18:23:08
PHP
Zimaell, 2019-08-07 18:23:08

How to use codeception in PHP?

After looking at the examples of using codeception, I did not understand how to use it in the code, for example, that phantom

require '/vendor/autoload.php';
$browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs');
$browserObj->setKeepalive(true);
$windowObj=$browserObj->getNewWindow();
$windowObj->setUserAgent($user_agent);
$windowObj->setUrl($url_login);
$content=$windowObj->getDom();
$windowObj->mouseEventOnElement("[id=ap_email]","leftclick");
$windowObj->sendKeyPresses($email);
..................

First, the composer connects the classes, then they are assigned to variables, follow the link and get its content...
But how to do it in codeception?
If you can give an example, otherwise I looked and I only had one thought that everything is done only from the command line ...
Can this be used in a php script and how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2019-08-07
@glaphire

I understood the question in such a way that you want to run tests with SeleniumWebDriver on codeception. An example of launching and writing is here Selenium WebDriver tests with Codeception

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question