Skip to content

Commit

Permalink
伝票番号チェックを注文一覧画面に移動
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Jul 20, 2018
1 parent 6fdf53a commit faad535
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 30 deletions.
30 changes: 30 additions & 0 deletions codeception/_support/Page/Admin/OrderManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ public function 検索($value = '')
return $this;
}

public function 詳細検索設定()
{
$this->tester->click(self::$詳細検索ボタン);
$this->tester->waitForElementVisible(['id' => 'searchDetail']);
$this->tester->wait(0.5);
return $this;
}

public function 入力_ご注文者お名前($value)
{
$this->tester->fillField(['id' => 'admin_search_order_name'], $value);
return $this;
}

public function 入力_ご注文者お名前フリガナ($value)
{
$this->tester->fillField(['id' => 'admin_search_order_kana'], $value);
return $this;
}

public function 詳細検索_電話番号($value = '')
{
$this->tester->click(self::$詳細検索ボタン);
Expand Down Expand Up @@ -181,4 +201,14 @@ public function 出荷済にする($rowNum)
$this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
return $this;
}

public function 取得_出荷伝票番号($rowNum)
{
return $this->tester->grabValueFrom("#search_result > tbody > tr:nth-child(${rowNum}) > td:nth-child(8) > div > input");
}

public function 取得_出荷日($rowNum)
{
return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child(${rowNum}) > td:nth-child(7)");
}
}
10 changes: 0 additions & 10 deletions codeception/_support/Page/Admin/ShippingManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,4 @@ public function 一覧_チェックボックス($rowNum)
{
$this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[1]/input"]);
}

public function 取得_出荷伝票番号($rowNum)
{
return $this->tester->grabTextFrom("#form_bulk table > tbody > tr:nth-child(${rowNum}) > td:nth-child(3)");
}

public function 取得_出荷日($rowNum)
{
return $this->tester->grabTextFrom("#form_bulk table > tbody > tr:nth-child(${rowNum}) > td:nth-child(7)");
}
}
41 changes: 21 additions & 20 deletions codeception/acceptance/EA09ShippingCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Eccube\Entity\Customer;
use Eccube\Entity\Order;
use Page\Admin\OrderEditPage;
use Page\Admin\OrderManagePage;
use Page\Admin\ShippingCsvUploadPage;
use Page\Admin\ShippingEditPage;
use Page\Admin\ShippingManagePage;
Expand Down Expand Up @@ -219,20 +220,20 @@ public function shipping_出荷CSV登録(\AcceptanceTester $I)
* 出荷再検索 出荷日/伝票番号が登録されていないことを確認
*/

$ShippingManagePage = ShippingManagePage::go($I)
$OrderManagePage = OrderManagePage::go($I)
->詳細検索設定()
->入力_ご注文者お名前($Customer->getName01().$Customer->getName02())
->入力_ご注文者お名前フリガナ($Customer->getKana01().$Customer->getKana02())
->検索();

$I->see('検索結果 : 3 件が該当しました', ShippingManagePage::$検索結果_メッセージ);
$I->see('検索結果:3件が該当しました', OrderManagePage::$検索結果_メッセージ);

$I->assertEquals('未登録', $ShippingManagePage->取得_出荷伝票番号(1));
$I->assertEquals('未登録', $ShippingManagePage->取得_出荷伝票番号(2));
$I->assertEquals('未登録', $ShippingManagePage->取得_出荷伝票番号(3));
$I->assertEquals('-', $ShippingManagePage->取得_出荷日(1));
$I->assertEquals('-', $ShippingManagePage->取得_出荷日(2));
$I->assertEquals('-', $ShippingManagePage->取得_出荷日(3));
$I->assertEmpty($OrderManagePage->取得_出荷伝票番号(1));
$I->assertEmpty($OrderManagePage->取得_出荷伝票番号(2));
$I->assertEmpty($OrderManagePage->取得_出荷伝票番号(3));
$I->assertEquals('未発送', $OrderManagePage->取得_出荷日(1));
$I->assertEquals('未発送', $OrderManagePage->取得_出荷日(2));
$I->assertEquals('未発送', $OrderManagePage->取得_出荷日(3));

/*
* 出荷CSV登録
Expand Down Expand Up @@ -260,20 +261,20 @@ public function shipping_出荷CSV登録(\AcceptanceTester $I)
* 出荷再検索 出荷日/伝票番号が登録されたことを確認
*/

$ShippingManagePage = ShippingManagePage::go($I)
->詳細検索設定()
->入力_ご注文者お名前($Customer->getName01().$Customer->getName02())
->入力_ご注文者お名前フリガナ($Customer->getKana01().$Customer->getKana02())
->検索();
$OrderManagePage = OrderManagePage::go($I)
->詳細検索設定()
->入力_ご注文者お名前($Customer->getName01().$Customer->getName02())
->入力_ご注文者お名前フリガナ($Customer->getKana01().$Customer->getKana02())
->検索();

$I->see('検索結果 : 3 件が該当しました', ShippingManagePage::$検索結果_メッセージ);
$I->see('検索結果:3件が該当しました', OrderManagePage::$検索結果_メッセージ);

$I->assertEquals('00003', $ShippingManagePage->取得_出荷伝票番号(1));
$I->assertEquals('00002', $ShippingManagePage->取得_出荷伝票番号(2));
$I->assertEquals('00001', $ShippingManagePage->取得_出荷伝票番号(3));
$I->assertEquals('2018/03/03', $ShippingManagePage->取得_出荷日(1));
$I->assertEquals('2018/02/02', $ShippingManagePage->取得_出荷日(2));
$I->assertEquals('2018/01/01', $ShippingManagePage->取得_出荷日(3));
$I->assertEquals('00003', $OrderManagePage->取得_出荷伝票番号(1));
$I->assertEquals('00002', $OrderManagePage->取得_出荷伝票番号(2));
$I->assertEquals('00001', $OrderManagePage->取得_出荷伝票番号(3));
$I->assertEquals('2018/03/03', $OrderManagePage->取得_出荷日(1));
$I->assertEquals('2018/02/02', $OrderManagePage->取得_出荷日(2));
$I->assertEquals('2018/01/01', $OrderManagePage->取得_出荷日(3));

} finally {
if (file_exists($csvFileName)) {
Expand Down

0 comments on commit faad535

Please sign in to comment.