Skip to content

Commit

Permalink
"${var}" / "${expr}" 形式の、文字列への値の埋め込み 対応
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-wataru-kashii committed Sep 27, 2024
1 parent 8dfeee5 commit 1490074
Show file tree
Hide file tree
Showing 37 changed files with 122 additions and 122 deletions.
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/AbstractAdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function goPage($url, $pageTitle = '')
return $this->atPage($pageTitle);
} else {
$this->tester->wait(5);
$this->tester->waitForJS("return location.pathname + location.search == '${adminUrl}'");
$this->tester->waitForJS("return location.pathname + location.search == '{$adminUrl}'");
}

return $this;
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/ApiWebHookPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function 削除($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]/div/div[2]//a[contains(@class, 'action-delete')]"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
return $this;
}
}
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/AuthorityManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function 行削除($rowNum)

public function 入力($rowNum, $role, $url)
{
$this->tester->selectOption(['css' => "form #table-authority tbody tr:nth-child(${rowNum}) td:nth-child(1) select"], $role);
$this->tester->fillField(['css' => "form #table-authority tbody tr:nth-child(${rowNum}) td:nth-child(2) input"], $url);
$this->tester->selectOption(['css' => "form #table-authority tbody tr:nth-child({$rowNum}) td:nth-child(1) select"], $role);
$this->tester->fillField(['css' => "form #table-authority tbody tr:nth-child({$rowNum}) td:nth-child(2) input"], $url);

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/BlockManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public function 新規入力()
public function 編集($rowNum)
{
$rowNum++;
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) a[data-bs-original-title=編集]");
$this->tester->click(".c-contentsArea .list-group > li:nth-child({$rowNum}) a[data-bs-original-title=編集]");
}

public function 削除($rowNum)
{
$rowNum++;
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) [data-bs-original-title=削除] a");
$this->tester->click(".c-contentsArea .list-group > li:nth-child({$rowNum}) [data-bs-original-title=削除] a");
return $this;
}

Expand Down
6 changes: 3 additions & 3 deletions codeception/_support/Page/Admin/CategoryManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public function カテゴリ作成()

public function 一覧_選択($rowNum)
{
$this->tester->click("body > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col.d-flex.align-items-center > a");
$this->tester->click("body > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child({$rowNum}) > div > div.col.d-flex.align-items-center > a");

return $this;
}

public function 一覧_編集($rowNum)
{
$this->tester->click("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-end > a:nth-child(3)");
$this->tester->click("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child({$rowNum}) > div > div.col-auto.text-end > a:nth-child(3)");

return $this;
}
Expand All @@ -80,7 +80,7 @@ public function 一覧_インライン編集_決定($rowNum)

public function 一覧_削除($rowNum)
{
$this->tester->click("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-end > div > a");
$this->tester->click("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child({$rowNum}) > div > div.col-auto.text-end > div > a");

return $this;
}
Expand Down
14 changes: 7 additions & 7 deletions codeception/_support/Page/Admin/ClassCategoryManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,28 @@ public function 分類作成()

public function 一覧_編集($rowNum)
{
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) a:nth-child(3)");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) a:nth-child(3)");

return $this;
}

public function 一覧_入力_分類名($row, $value)
{
$this->tester->fillField(['css' => "ul.list-group > li:nth-child(${row}) form input[type=text]"], $value);
$this->tester->fillField(['css' => "ul.list-group > li:nth-child({$row}) form input[type=text]"], $value);

return $this;
}

public function 一覧_分類作成($row)
{
$this->tester->click("ul.list-group > li:nth-child(${row}) form button[type=submit]");
$this->tester->click("ul.list-group > li:nth-child({$row}) form button[type=submit]");

return $this;
}

public function 一覧_削除($rowNum)
{
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) > div > div.col-auto.text-end > div > a");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) > div > div.col-auto.text-end > div > a");

return $this;
}
Expand Down Expand Up @@ -99,21 +99,21 @@ public function CSV出力項目設定()

public function 一覧_上に($rowNum)
{
$this->tester->dragAndDropBy("ul.list-group > li:nth-child(${rowNum})", 0, -60);
$this->tester->dragAndDropBy("ul.list-group > li:nth-child({$rowNum})", 0, -60);

return $this;
}

public function 一覧_下に($rowNum)
{
$this->tester->dragAndDropBy("ul.list-group > li:nth-child(${rowNum})", 0, 60);
$this->tester->dragAndDropBy("ul.list-group > li:nth-child({$rowNum})", 0, 60);

return $this;
}

public function 一覧_名称($rowNum)
{
return "ul.list-group > li:nth-child(${rowNum}) > div > div.col.d-flex.align-items-center";
return "ul.list-group > li:nth-child({$rowNum}) > div > div.col.d-flex.align-items-center";
}

public static function XPathでタグを取得する($textEl)
Expand Down
14 changes: 7 additions & 7 deletions codeception/_support/Page/Admin/ClassNameManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ public function 規格作成()

public function 規格編集($rowNum)
{
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) > form > div:nth-child(6) > button");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) > form > div:nth-child(6) > button");

return $this;
}

public function 一覧_名称($rowNum)
{
return "ul.list-group > li:nth-child(${rowNum}) > div > div.col.d-flex.align-items-center > a";
return "ul.list-group > li:nth-child({$rowNum}) > div > div.col.d-flex.align-items-center > a";
}

public function 一覧_分類登録($rowNum)
{
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) > div > div.col.d-flex.align-items-center > a");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) > div > div.col.d-flex.align-items-center > a");

return $this;
}
Expand All @@ -88,15 +88,15 @@ public function 一覧_分類登録2()

public function 一覧_編集($rowNum)
{
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) > div > div.col-auto.text-end > a.action-edit");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) > div > div.col-auto.text-end > a.action-edit");

return $this;
}

public function 一覧_削除($rowNum)
{
++$rowNum;
$this->tester->click("ul.list-group > li:nth-child(${rowNum}) > div > div.col-auto.text-end > div > a");
$this->tester->click("ul.list-group > li:nth-child({$rowNum}) > div > div.col-auto.text-end > div > a");

return $this;
}
Expand Down Expand Up @@ -124,14 +124,14 @@ public function CSV出力項目設定()

public function 一覧_上に($rowNum)
{
$this->tester->dragAndDropBy("ul.list-group > li:nth-child(${rowNum})", 0, -60);
$this->tester->dragAndDropBy("ul.list-group > li:nth-child({$rowNum})", 0, -60);

return $this;
}

public function 一覧_下に($rowNum)
{
$this->tester->dragAndDropBy("ul.list-group > li:nth-child(${rowNum})", 0, 60);
$this->tester->dragAndDropBy("ul.list-group > li:nth-child({$rowNum})", 0, 60);

return $this;
}
Expand Down
16 changes: 8 additions & 8 deletions codeception/_support/Page/Admin/CustomerManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function 詳細検索_電話番号($value = '')
*/
public function 一覧_編集($rowNum)
{
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2) > a");
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td:nth-child(2) > a");

return $this;
}
Expand All @@ -105,12 +105,12 @@ public function 一覧_編集($rowNum)
*/
public function 一覧_削除($rowNum, $execute = true)
{
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pe-3 > div > div > a");
$this->tester->waitForElementVisible("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pe-3 > div > div.modal");
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td.align-middle.pe-3 > div > div > a");
$this->tester->waitForElementVisible("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td.align-middle.pe-3 > div > div.modal");
if ($execute) {
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pe-3 > div > div.modal a.btn-ec-delete");
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td.align-middle.pe-3 > div > div.modal a.btn-ec-delete");
} else {
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pe-3 > div > div.modal button.btn-ec-sub");
$this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td.align-middle.pe-3 > div > div.modal button.btn-ec-sub");
}

return $this;
Expand All @@ -121,7 +121,7 @@ public function 一覧_削除($rowNum, $execute = true)
*/
public function 一覧_仮会員メール再送($rowNum, $execute = true)
{
$this->tester->click(['xpath' => "//*[@id='search_form']//div/table/tbody/tr[${rowNum}]/td[6]/div/div[1]/a"]);
$this->tester->click(['xpath' => "//*[@id='search_form']//div/table/tbody/tr[{$rowNum}]/td[6]/div/div[1]/a"]);
$this->tester->wait(5);
if ($execute) {
$this->tester->click('送信');
Expand All @@ -134,7 +134,7 @@ public function 一覧_仮会員メール再送($rowNum, $execute = true)

private function 一覧_メニュー($rowNum)
{
$this->tester->click("#search_form > div.row > div > div > div.box-body > div.table_list > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > a");
$this->tester->click("#search_form > div.row > div > div > div.box-body > div.table_list > div > table > tbody > tr:nth-child({$rowNum}) > td.icon_edit > div > a");

return $this;
}
Expand All @@ -156,7 +156,7 @@ public function CSV出力項目設定()
*/
public function 一覧_会員ID($rowNum)
{
return $this->tester->grabTextFrom("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.ps-3");
return $this->tester->grabTextFrom("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child({$rowNum}) > td.align-middle.ps-3");
}

public function assertSortedIdList($order)
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/DeliveryEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function 入力_名称($value)
public function 入力_支払方法選択($array)
{
foreach ($array as $id) {
$this->tester->checkOption(['id' => "delivery_payments_${id}"]);
$this->tester->checkOption(['id' => "delivery_payments_{$id}"]);
}

return $this;
Expand Down
10 changes: 5 additions & 5 deletions codeception/_support/Page/Admin/FileManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ public function 一覧_パスをコピー($rowNum)

public function 一覧_ファイル名_クリック($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2) a");
$this->tester->click("#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(2) a");

return $this;
}

public function 一覧_削除($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-delete");
$this->tester->click("#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(5) a.action-delete");

return $this;
}

public function 一覧_削除_accept($rowNum)
{
$this->tester->waitForElementVisible("#confirmModal-${rowNum} div.modal-footer a.btn-ec-delete");
$this->tester->click("#confirmModal-${rowNum} div.modal-footer a.btn-ec-delete");
$this->tester->waitForElementVisible("#confirmModal-{$rowNum} div.modal-footer a.btn-ec-delete");
$this->tester->click("#confirmModal-{$rowNum} div.modal-footer a.btn-ec-delete");

return $this;
}
Expand All @@ -115,6 +115,6 @@ public function 一覧_削除_accept($rowNum)
*/
public function パンくず($index)
{
return "//*[@id=\"bread\"]/li[${index}]";
return "//*[@id=\"bread\"]/li[{$index}]";
}
}
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/LayoutEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public function 登録()
public function ブロックを移動($blockName, $dest, $timeout = 10)
{
$this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='{$blockName}']]]]"], $timeout);
$this->tester->dragAndDrop(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]"], $dest);
$this->tester->dragAndDrop(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='{$blockName}']]]]"], $dest);

return $this;
}

public function コンテキストメニューを開く($blockName)
{
$this->tester->click(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]/div/div[2]"]);
$this->tester->click(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='{$blockName}']]]]/div/div[2]"]);

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/LayoutManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function go($I)

public function レイアウト編集($layoutName)
{
$this->tester->click(['xpath' => "//*[@id=\"page_admin_content_layout\"]/div[1]/div[3]/div[2]/div/div//div/a[translate(text(), ' \r\n', '')='${layoutName}']"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_content_layout\"]/div[1]/div[3]/div[2]/div/div//div/a[translate(text(), ' \r\n', '')='{$layoutName}']"]);
}

public function 削除($layoutName)
Expand Down
12 changes: 6 additions & 6 deletions codeception/_support/Page/Admin/MailMagazineHistoryPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ public static function go(\AcceptanceTester $I)

public function プレビュー($i)
{
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[1]/a"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[1]/a"]);
return $this;
}
public function 配信条件($i)
{
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[2]/a"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[2]/a"]);
return $this;
}

public function 配信結果($i)
{
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[3]/a"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[3]/a"]);
}

public function 削除($i)
{
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[4]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[8]/div/div[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[4]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"form1\"]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[8]/div/div[4]//button[contains(@class, 'btn-ec-delete')]"]);
return $this;
}
}
10 changes: 5 additions & 5 deletions codeception/_support/Page/Admin/MailMagazineTemplatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ public function 新規作成()

public function 編集($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[${i}]/td[3]/a"]);
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[{$i}]/td[3]/a"]);
return $this;
}
public function 削除($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[${i}]/td[4]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[${i}]/td[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[${i}]/td[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[{$i}]/td[4]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[{$i}]/td[4]//button[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[{$i}]/td[4]//button[contains(@class, 'btn-ec-delete')]"]);
return $this;
}

public function プレビュー($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[${i}]/td[5]/a"]);
$this->tester->click(['xpath' => "//*[@id=\"page_plugin_mail_magazine_template\"]/div//table/tbody/tr[{$i}]/td[5]/a"]);
return $this;
}
}
Loading

0 comments on commit 1490074

Please sign in to comment.