1111 * file that was distributed with this source code.
1212 */
1313
14+ use _generated \AcceptanceTesterActions ;
15+ use Codeception \Actor ;
16+ use Codeception \Lib \Friend ;
1417use Codeception \Scenario ;
18+ use Codeception \Step \Action ;
19+ use Codeception \Step \Assertion ;
20+ use Codeception \Step \Condition ;
1521use Codeception \Util \Fixtures ;
1622use Eccube \Common \Constant ;
23+ use Facebook \WebDriver \Remote \RemoteWebDriver ;
1724use Facebook \WebDriver \WebDriverBy ;
1825use Interactions \DragAndDropBy ;
1926use Symfony \Component \Filesystem \Exception \FileNotFoundException ;
3037 * @method void am($role)
3138 * @method void lookForwardTo($achieveValue)
3239 * @method void comment($description)
33- * @method \Codeception\Lib\ Friend haveFriend($name, $actorClass = null)
40+ * @method Friend haveFriend($name, $actorClass = null)
3441 *
3542 * @SuppressWarnings(PHPMD)
3643 */
37- class AcceptanceTester extends Codeception \ Actor
44+ class AcceptanceTester extends Actor
3845{
39- use _generated \ AcceptanceTesterActions;
46+ use AcceptanceTesterActions;
4047
4148 public function getScenario (): Scenario
4249 {
@@ -225,7 +232,7 @@ public function dontSeeElements($arrayOfSelector)
225232
226233 public function dragAndDropBy ($ selector , $ x_offset , $ y_offset )
227234 {
228- $ this ->executeInSelenium (function (Facebook \ WebDriver \ Remote \ RemoteWebDriver $ webDriver ) use ($ selector , $ x_offset , $ y_offset ) {
235+ $ this ->executeInSelenium (function (RemoteWebDriver $ webDriver ) use ($ selector , $ x_offset , $ y_offset ) {
229236 $ node = $ webDriver ->findElement (WebDriverBy::cssSelector ($ selector ));
230237 $ action = new DragAndDropBy ($ webDriver , $ node , $ x_offset , $ y_offset );
231238 $ action ->perform ();
@@ -257,7 +264,7 @@ public function compressPlugin($pluginDirName, $destDir)
257264 public function see ($ text , $ selector = null ): void
258265 {
259266 $ this ->wait (0.1 ); // XXX 画面遷移直後は selector の参照に失敗するため wait を入れる
260- $ this ->getScenario ()->runStep (new Codeception \ Step \ Assertion ('see ' , func_get_args ()));
267+ $ this ->getScenario ()->runStep (new Assertion ('see ' , func_get_args ()));
261268 }
262269
263270 /**
@@ -268,7 +275,7 @@ public function see($text, $selector = null): void
268275 public function seeInField ($ field , $ value ): void
269276 {
270277 $ this ->wait (0.1 ); // XXX 画面遷移直後は selector の参照に失敗するため wait を入れる
271- $ this ->getScenario ()->runStep (new Codeception \ Step \ Assertion ('seeInField ' , func_get_args ()));
278+ $ this ->getScenario ()->runStep (new Assertion ('seeInField ' , func_get_args ()));
272279 }
273280
274281 /**
@@ -279,7 +286,7 @@ public function seeInField($field, $value): void
279286 public function waitForText (string $ text , int $ timeout = 10 , $ selector = null ): void
280287 {
281288 $ this ->wait (0.1 ); // XXX 画面遷移直後は selector の参照に失敗するため wait を入れる
282- $ this ->getScenario ()->runStep (new Codeception \ Step \ Action ('waitForText ' , func_get_args ()));
289+ $ this ->getScenario ()->runStep (new Action ('waitForText ' , func_get_args ()));
283290 }
284291
285292 /**
@@ -290,7 +297,20 @@ public function waitForText(string $text, int $timeout = 10, $selector = null):
290297 public function amOnPage ($ page ): void
291298 {
292299 $ this ->wait (1 ); // XXX WebDriver::amOnPage() の前に wait を入れないと画面遷移しない場合がある
293- $ this ->getScenario ()->runStep (new Codeception \ Step \ Condition ('amOnPage ' , func_get_args ()));
300+ $ this ->getScenario ()->runStep (new Condition ('amOnPage ' , func_get_args ()));
294301 $ this ->wait (1 ); // XXX 画面遷移直後は selector の参照に失敗する場合があるため wait を入れる
295302 }
303+
304+ /**
305+ * AcceptanceTesterActions から移植
306+ *
307+ * @param string|array $link
308+ *
309+ * @see \Codeception\Module\WebDriver::click()
310+ */
311+ public function click ($ link , $ context = null ): void
312+ {
313+ $ this ->getScenario ()->runStep (new Action ('click ' , func_get_args ()));
314+ $ this ->wait (1 ); // XXX click 直後は selector の参照に失敗するため wait を入れる
315+ }
296316}
0 commit comments