Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't log in with codeception and Selenium
    primarykey
    data
    text
    <p>I have a small issue, I'm trying to use Codeception to run my first test phase. To do this, I'm using a Selenium2 and PrestaShop. </p> <p>The first step I'm trying to achieve is to log in the backoffice of PrestaShop. </p> <p>But it seems that it does not want to connect to PrestaShop Backoffice. and I get redirected to the login page! </p> <p>Does anyone know where this can come from? It seems that there is something with cookies or session, but I don't know how to fix this!</p> <p>Edit : Here are my codes : </p> <p>Selenium.suite.yml : </p> <pre><code>class_name: SeleniumGuy modules: enabled: - SeleniumHelper - Selenium2 config: Selenium2: url: 'http://localhost/Sites/PrestaShop1.5.4/' browser: 'firefox' capabilities: unexpectedAlertBehaviour: 'accept' </code></pre> <p>codeception.yml</p> <pre><code>paths: tests: tests log: tests/_log data: tests/_data helpers: tests/_helpers settings: bootstrap: _bootstrap.php suite_class: \PHPUnit_Framework_TestSuite colors: false memory_limit: 1024M log: true modules: config: Db: dsn: '' user: 'root' password: 'root' dump: tests/_data/dump.sql </code></pre> <p>In the folder tests/Selenium I have PrestaShopGlobalCest.php</p> <pre><code> &lt;?php use \SeleniumGuy; class PrestaShopModuleListCest { // tests public function install_the_module(SeleniumGuy $I) { PrestaShopGlobalHelper::loginBackoffice($I); PrestaShopGlobalHelper::goToPage($I, 'modules'); } } </code></pre> <p>_bootstrap.php</p> <pre><code>&lt;?php Codeception\Util\Autoload::registerSuffix('Helper', __DIR__.'/../helpers/Selenium'); ?&gt; </code></pre> <p>In tests/helpers/Selenium I have </p> <p>PrestaShopGlobalHelper</p> <pre><code>&lt;?php use \SeleniumGuy; class PrestaShopGlobalHelper { static $mainTabID = array( 'modules' =&gt; 'maintab15' ); static $menuLink = array( 'modules' =&gt; '#maintab15 .submenu li:first' ); // tests static public function loginBackOffice(SeleniumGuy $I) { $I-&gt;wantTo('Login in Backoffice'); $I-&gt;amOnPage('/bb'); PrestaShopGlobalHelper::login($I); } static public function login(SeleniumGuy $I, $login = '****', $pass = '****') { $I-&gt;fillField('#email',$login); $I-&gt;fillField('#passwd',$pass); $I-&gt;click('Connexion'); } static public function goToPage(SeleniumGuy $I, $page) { $I-&gt;moveMouseOver('#'.self::$mainTabID[$page]); $I-&gt;click(self::$menuLink[$page]); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload