Skip to content

Commit

Permalink
Merge branch 'add-typedefinition' into vulenerabile-alert
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Sep 24, 2021
2 parents ff702d5 + d176c2b commit 5b778cf
Show file tree
Hide file tree
Showing 74 changed files with 2,495 additions and 208 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/penetration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ on:
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'

jobs:
PenetrationTest:
name: Penetration testing
Expand Down Expand Up @@ -57,6 +54,7 @@ jobs:
run: yarn jest ${GROUP}
- env:
GROUP: ${{ matrix.group }}
if: always()
run: echo "ARTIFACT_NAME=$(echo ${GROUP} | sed 's,/,-,g')" >> $GITHUB_ENV
- name: Upload evidence
if: always()
Expand Down
2 changes: 1 addition & 1 deletion app/config/eccube/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ doctrine:
datetimetz: 'Eccube\Doctrine\DBAL\Types\UTCDateTimeTzType'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
dql:
string_functions:
Expand Down
1 change: 1 addition & 0 deletions app/config/eccube/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ twig:
date:
timezone: '%timezone%'
base_template_class: 'Eccube\Twig\Template'
exception_controller: null
3 changes: 3 additions & 0 deletions app/config/eccube/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ services:
$orderPurchaseFlow: '@eccube.purchase.flow.order'
$_orderStateMachine: '@state_machine.order'

event_dispatcher:
class: Eccube\Event\EventDispatcherWrapper
public: true

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Expand Down
2 changes: 2 additions & 0 deletions codeception/_data/upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
echo "hello";
6 changes: 6 additions & 0 deletions codeception/_envs/vaddy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
modules:
config:
WebDriver:
url: '%BASE_URL%'
http_proxy: '%VADDY_PROXY%'
http_proxy_port: '%VADDY_PROXY_PORT%'
53 changes: 53 additions & 0 deletions codeception/_support/Page/Admin/ApiOauthEditPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class ApiOauthEditPage extends AbstractAdminPageStyleGuide
{
public static function at($I)
{
$page = new self($I);
$page->atPage('OAuthクライアント登録API管理');
return $page;
}

public function 入力_クライアントID($value)
{
$this->tester->fillField(['id' => 'api_admin_client_identifier'], $value);
return $this;
}

public function 入力_クライアントシークレット($value)
{
$this->tester->fillField(['id' => 'api_admin_client_secret'], $value);
return $this;
}

public function 入力_スコープread()
{
$this->tester->click(['id' => 'api_admin_client_scopes_0']);
return $this;
}

public function 入力_リダイレクトURI($value)
{
$this->tester->fillField(['id' => 'api_admin_client_redirect_uris'], $value);
return $this;
}

public function 登録()
{
$this->tester->click(['css' => '#ex-conversion-action > div > button']);
return $this;
}
}
43 changes: 43 additions & 0 deletions codeception/_support/Page/Admin/ApiOauthPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class ApiOauthPage extends AbstractAdminPageStyleGuide
{
public static function go(\AcceptanceTester $I)
{
$page = new self($I);
$page->goPage('/api/oauth', 'OAuth管理API管理');
return $page;
}

public function 新規登録()
{
$this->tester->click(['css' => '#create-client > a']);
return $this;
}

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

public function 期限切れトークン削除()
{
$this->tester->click(['css' => '#page_admin_api_oauth > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > div:nth-child(4) > a']);
return $this;
}
}
41 changes: 41 additions & 0 deletions codeception/_support/Page/Admin/ApiWebHookEditPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class ApiWebHookEditPage extends AbstractAdminPageStyleGuide
{
public static function at(\AcceptanceTester $I)
{
$page = new self($I);
$page->atPage('WebHook登録API管理');
return $page;
}

public function 入力_PayloadURL($value)
{
$this->tester->fillField(['id' => 'web_hook_payload_url'], $value);
return $this;
}

public function 入力_シークレット($value)
{
$this->tester->fillField(['id' => 'web_hook_secret'], $value);
return $this;
}

public function 登録()
{
$this->tester->click(['css' => '#ex-conversion-action > div > button']);
return $this;
}
}
43 changes: 43 additions & 0 deletions codeception/_support/Page/Admin/ApiWebHookPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class ApiWebHookPage extends AbstractAdminPageStyleGuide
{
public static function go(\AcceptanceTester $I)
{
$page = new self($I);
$page->goPage('/api/webhook', 'WebHook管理API管理');
return $page;
}

public function 新規登録()
{
$this->tester->click(['css' => '#page_admin_api_webhook > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > div > div > div > div > div > div:nth-child(2) > a']);
return $this;
}

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]//a[1]"]);
return $this;
}

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')]"]);
return $this;
}
}
15 changes: 13 additions & 2 deletions codeception/_support/Page/Admin/BlockManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ public function 新規入力()

public function 編集($rowNum)
{
$this->tester->click("#page_admin_content_block > div > div.c-contentsArea > div.c-contentsArea__cols > div > div.c-primaryCol > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-right > a:nth-child(1)");
$rowNum++;
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) a[data-original-title=編集]");
}

public function 削除($rowNum)
{
$this->tester->click("#page_admin_content_block > div > div.c-contentsArea > div.c-contentsArea__cols > div > div.c-primaryCol > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-right > a.btn.btn-ec-actionIcon.mr-3.disabled");
$rowNum++;
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) [data-original-title=削除] a");
return $this;
}

public function ポップアップを受け入れます()
{
$this->tester->waitForElementVisible(['css' => '.modal.show']);
$this->tester->click('.modal.show .btn-ec-delete');

return $this;
}
}
112 changes: 112 additions & 0 deletions codeception/_support/Page/Admin/CouponEditPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class CouponEditPage extends AbstractAdminPageStyleGuide
{
public static function go(\AcceptanceTester $I)
{
$page = new self($I);
$page->goPage('/plugin/coupon', 'クーポン管理');
return $page;
}

public static function at(\AcceptanceTester $I)
{
$page = new CouponEditPage($I);
$page->atPage('クーポン管理');
return $page;
}

public function 入力_クーポン名($value)
{
$this->tester->fillField(['id' => 'coupon_coupon_name'], $value);
return $this;
}

public function 選択_対象_商品()
{
$this->tester->click(['id' => 'coupon_coupon_type_0']);
return $this;
}

public function 選択_対象_カテゴリ()
{
$this->tester->click(['id' => 'coupon_coupon_type_1']);
return $this;
}

public function 選択_対象_全商品()
{
$this->tester->click(['id' => 'coupon_coupon_type_2']);
return $this;
}

public function 入力_値引き額($value)
{
$this->tester->fillField(['id' => 'coupon_discount_price'], $value);
return $this;
}

public function 入力_発行枚数($value)
{
$this->tester->fillField(['id' => 'coupon_coupon_release'], $value);
return $this;
}

public function 入力_有効期限開始($value)
{
$this->tester->executeJS('$("#coupon_available_from_date").val("'.$value.'")');
return $this;
}

public function 入力_有効期限終了($value)
{
$this->tester->executeJS('$("#coupon_available_to_date").val("'.$value.'")');
return $this;
}

public function 商品追加()
{
$this->tester->waitForElementVisible(['id' => 'showSearchProductModal']);
$this->tester->click(['id' => 'showSearchProductModal']);
$this->tester->waitForElementVisible(['id' => 'searchProductModalButton']);
$this->tester->click(['id' => 'searchProductModalButton']);
$this->tester->waitForElementVisible(['css' => '#searchProductModalList > div > table > tbody > tr:nth-child(2) > td.text-right > button']);
$this->tester->click(['css' => '#searchProductModalList > div > table > tbody > tr:nth-child(2) > td.text-right > button']);
return $this;
}

public function 商品削除()
{
$this->tester->click(['css' => '#coupon_detail_list > div > div.col-1.icon_edit > button']);
return $this;
}

public function カテゴリ追加()
{
$this->tester->waitForElementVisible(['id' => 'showSearchCategoryModal']);
$this->tester->click(['id' => 'showSearchCategoryModal']);
$this->tester->waitForElementVisible(['id' => 'searchCategoryModalButton']);
$this->tester->click(['id' => 'searchCategoryModalButton']);
$this->tester->waitForElementVisible(['css' => '#searchCategoryModalList > div > table > tbody > tr:nth-child(1) > td.text-right > button']);
$this->tester->click(['css' => '#searchCategoryModalList > div > table > tbody > tr:nth-child(1) > td.text-right > button']);
return $this;
}
public function 登録する()
{
$this->tester->waitForElementVisible(['css' => '#form1 > div > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button']);
$this->tester->click(['css' => '#form1 > div > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button']);
return $this;
}
}
Loading

0 comments on commit 5b778cf

Please sign in to comment.