From 74ce74fe82b80d8a4373caa0a28e7ad274d6f1b8 Mon Sep 17 00:00:00 2001 From: Grzegorz Rola <grola@seostudio.pl> Date: Thu, 17 Aug 2023 14:36:43 +0200 Subject: [PATCH] feature(init): init --- src/Shopify.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Shopify.php b/src/Shopify.php index db6e113..7647816 100644 --- a/src/Shopify.php +++ b/src/Shopify.php @@ -4,14 +4,15 @@ declare(strict_types=1); namespace Octolize\Shopify\Codeception; +use Codeception\Module\WebDriver; use Exception; -class Shopify extends \Codeception\Module +class Shopify extends WebDriver { public function loginAsAdmin() { - $i = $this->getModule('WebDriver'); + $i = $this; $isPl = false; if ($i->loadSessionSnapshot('admin')) { return; @@ -28,7 +29,7 @@ class Shopify extends \Codeception\Module $i->waitForText('Kontynuuj z Google', 30); $isPl = true; } - $i->click($isPl?'Kontynuuj z Google':'Continue with Google'); + $i->click($isPl ? 'Kontynuuj z Google' : 'Continue with Google'); try { $i->seeInCurrentUrl(parse_url($this->config['admin_url'], PHP_URL_PATH)); $i->dontSeeInCurrentUrl('google.com'); @@ -58,6 +59,7 @@ class Shopify extends \Codeception\Module } } } + $i->wait(rand(1, 5)); $i->saveSessionSnapshot('admin'); } -- GitLab