Skip to content

Commit

Permalink
Merge pull request #6191 from dotani1111/dev/add_e2e_ga_tag
Browse files Browse the repository at this point in the history
add E2E test for GA tag.
  • Loading branch information
ji-eunsoo committed May 15, 2024
2 parents 892d53e + 20ad2c4 commit 8ad3da3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions codeception/_support/Page/Admin/ShopSettingPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ public function 設定_在庫切れ商品の非表示($value)
}
$checked = $this->tester->grabAttributeFrom('#shop_master_option_nostock_hidden', 'checked');

return $this;
}
public function 入力_GAタグ($value)
{
$this->tester->fillField(['id' => 'shop_master_ga_id'], $value);

return $this;
}
}
22 changes: 22 additions & 0 deletions codeception/acceptance/EA07BasicinfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,4 +1065,26 @@ public function basicinfo_税設定_適格請求書発行事業者登録番号(A

$I->getScenario()->incomplete('SJISの納品書を確認することが困難なため未実装');
}

/**
* @group vaddy
* @group basicsetting
*/
public function basicinfo_GAタグ設定(AcceptanceTester $I)
{
$I->wantTo('EA0714-UC01-T01 GAタグ設定');

// GAタグ設定
$page = ShopSettingPage::go($I)
->入力_GAタグ('UA-12345678-1');
$I->wait(1);
$page->登録();

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

// GAタグが設定されているか
$I->amOnPage('/');
$I->seeInPageSource('https://www.googletagmanager.com/gtag/js?id=UA-12345678-1');

}
}

0 comments on commit 8ad3da3

Please sign in to comment.