Skip to content

Commit

Permalink
Merge branch '4.2' into feat_search_product_date
Browse files Browse the repository at this point in the history
  • Loading branch information
dotani1111 committed May 26, 2023
2 parents bee3862 + 800915d commit 65c20db
Show file tree
Hide file tree
Showing 20 changed files with 186 additions and 152 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master

- name: Install fonts
run: sudo apt install fonts-ipafont fonts-ipaexfont

- name: Run chromedriver
run: |
export DISPLAY=:99
Expand Down
1 change: 1 addition & 0 deletions codeception/_envs/github_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ modules:
chromeOptions:
prefs:
download.default_directory: '%GITHUB_WORKSPACE%/codeception/_support/_downloads'
wait: 30
MailCatcher:
url: '127.0.0.1'
port: 1080
1 change: 1 addition & 0 deletions codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function logoutAsMember()
{
$I = $this;
$I->amOnPage('/');
$I->waitForElement('.ec-headerNaviRole .ec-headerNav .ec-headerNav__item:nth-child(3) a');
$isLogin = $I->grabTextFrom('.ec-headerNaviRole .ec-headerNav .ec-headerNav__item:nth-child(3) a');
if ($isLogin == 'ログアウト') {
$I->wait(1);
Expand Down
1 change: 1 addition & 0 deletions codeception/_support/Page/AbstractPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct(\AcceptanceTester $I)
protected function goPage($url, $pageTitle = '')
{
$this->tester->amOnPage($url);
$this->tester->waitForJS("return location.pathname + location.search == '${url}'", 30);

return $this;
}
Expand Down
8 changes: 6 additions & 2 deletions codeception/_support/Page/Admin/AbstractAdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ abstract class AbstractAdminPage extends AbstractPage
protected function goPage($url, $pageTitle = '')
{
$config = Fixtures::get('config');
$this->tester->amOnPage('/'.$config['eccube_admin_route'].$url);
$adminUrl = '/'.$config['eccube_admin_route'].$url;
$this->tester->amOnPage($adminUrl);

if ($pageTitle) {
return $this->atPage($pageTitle);
} else {
$this->tester->wait(5);
$this->tester->waitForJS("return location.pathname + location.search == '${adminUrl}'");
}

return $this;
Expand All @@ -47,7 +51,7 @@ protected function goPage($url, $pageTitle = '')
*/
protected function atPage($pageTitle)
{
$this->tester->see($pageTitle, '.c-container .c-pageTitle__titles');
$this->tester->waitForText($pageTitle, 10, '.c-container .c-pageTitle__titles');

return $this;
}
Expand Down
1 change: 1 addition & 0 deletions codeception/_support/Page/Admin/MasterDataManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function 選択($option)
{
$this->tester->selectOption(['id' => 'admin_system_masterdata_masterdata'], $option);
$this->tester->click('#form1 button');
$this->tester->waitForElement(['xpath' => "//select[@id='admin_system_masterdata_masterdata']/option[@selected][contains(text(), '${option}')]"]);

return $this;
}
Expand Down
3 changes: 2 additions & 1 deletion codeception/_support/Page/Admin/OrderEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public function 商品検索($value = '')
public function 商品検索結果_選択($rowNum)
{
$rowNum = $rowNum * 2;
$this->tester->click("#searchProductModalList > table > tbody > tr:nth-child(${rowNum}) > td.text-end > button");
$this->tester->click(['css' => "#searchProductModalList > table > tbody > tr:nth-child(${rowNum}) > td.text-end > button"]);
$this->tester->waitForElementNotVisible(['id' => 'searchProductModalList']);

return $this;
}
Expand Down
4 changes: 3 additions & 1 deletion codeception/_support/Page/Admin/ShippingEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function 商品検索($value = '')
{
$this->tester->scrollTo(['css' => '#shipping-product_1 > div > button'], 0, -50);
$this->tester->click(['css' => '#shipping-product_1 > div > button']);
$this->tester->waitForElementVisible(['id' => 'addProduct']);
$this->tester->waitForElementVisible(['id' => 'admin_search_product_id']);
$this->tester->fillField(['id' => 'admin_search_product_id'], $value);
$this->tester->click('#searchProductModalButton');
$this->tester->waitForElementVisible('#searchProductModalList table');
Expand All @@ -185,6 +185,8 @@ public function 商品検索結果_選択($rowNum)
{
$rowNum = $rowNum * 2;
$this->tester->click("#searchProductModalList > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pe-3.text-end > button");
$this->tester->waitForElementNotVisible('#searchProductModalList');
$this->tester->wait(5);

return $this;
}
Expand Down
4 changes: 3 additions & 1 deletion codeception/_support/Page/Front/CartPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function 商品名($index)

public function 商品数量($index)
{
return $this->tester->grabTextFrom(['xpath' => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amount']"]);
$selector = ['xpath' => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amount']"];
$this->tester->waitForElement($selector);
return $this->tester->grabTextFrom($selector);
}

public function 明細数()
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Front/MyPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(\AcceptanceTester $I)
public static function go($I)
{
$page = new self($I);
$page->goPage('/mypage');
$page->goPage('/mypage/');

return $page;
}
Expand Down
2 changes: 2 additions & 0 deletions codeception/_support/Page/Front/ProductListPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ public function __construct(\AcceptanceTester $I)
public function 表示件数設定($num)
{
$this->tester->selectOption(['css' => "select[name = 'disp_number']"], "${num}");
$this->tester->waitForElement(['css' => "select[name='disp_number'] > option[value='${num}'][selected]"]);

return $this;
}

public function 表示順設定($sort)
{
$this->tester->selectOption(['css' => "select[name = 'orderby']"], $sort);
$this->tester->waitForElement(['xpath' => "//select[@name='orderby']/option[text()='${sort}']"]);

return $this;
}
Expand Down
2 changes: 2 additions & 0 deletions codeception/_support/Page/Front/ShoppingPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ public function 入力_姓($value)
public function 入力_利用ポイント($value)
{
$this->tester->executeJS("$('#shopping_order_use_point').val('{$value}').change()");
$this->tester->wait(5);

return $this;
}

public function 選択_配送方法($id)
{
$this->tester->selectOption(['id' => 'shopping_order_Shippings_0_Delivery'], $id);
$this->tester->wait(5);

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Install/InstallPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function go(\AcceptanceTester $I)
{
$page = new self($I);

return $page->goPage('/');
return $page->goPage('/install/step1');
}

public function step1_次へボタンをクリック()
Expand Down
2 changes: 1 addition & 1 deletion codeception/acceptance/EA04OrderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public function order_受注登録(AcceptanceTester $I)
->商品検索結果_選択(1)
->受注情報登録();

$I->see('保存しました', OrderEditPage::$登録完了メッセージ);
$I->waitForText('保存しました', 10, OrderEditPage::$登録完了メッセージ);
}

public function order_納品書の出力(AcceptanceTester $I)
Expand Down
Loading

0 comments on commit 65c20db

Please sign in to comment.