forked from EC-CUBE/ec-cube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b976142
commit 66a05b0
Showing
10 changed files
with
186 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
web_profiler: | ||
toolbar: true | ||
toolbar: false | ||
intercept_redirects: false | ||
|
||
framework: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
|
||
namespace Plugin; | ||
|
||
use AcceptanceTester; | ||
use Codeception\Util\Fixtures; | ||
use Eccube\Common\EccubeConfig; | ||
|
||
/** | ||
* @group plugin_verify | ||
*/ | ||
class PluginVerifyCest | ||
{ | ||
/** @var EccubeConfig */ | ||
private $config; | ||
/** プラグインコード */ | ||
private $plugin_code; | ||
|
||
public function _before(AcceptanceTester $I){ | ||
if(!file_exists(__DIR__ . "/../../../var/cache/dev/htmlpurifier")){ | ||
mkdir(__DIR__ . "/../../../var/cache/dev/htmlpurifier", 775); | ||
} | ||
exec("php bin/console cache:clear --no-warmup"); | ||
$this->config = Fixtures::get('test_config'); | ||
$I->loginAsAdmin(); | ||
} | ||
public function 認証キーを入力(AcceptanceTester $I) | ||
{ | ||
$I->amOnPage('/admin/store/plugin/authentication_setting'); | ||
$config = Fixtures::get('test_config'); | ||
$I->fillField('/html/body/div[1]/div[3]/form/div[1]/div/div[2]/div/div[2]/div[2]/div[2]/input', $config['ECCUBE_PLUGIN_VERIFY_KEY']); | ||
$I->click("/html/body/div[1]/div[3]/form/div[2]/div/div/div[2]/div/div/button"); | ||
$I->wait(5); | ||
$I->see('保存しました'); | ||
} | ||
public function プラグイン_インストール(AcceptanceTester $I){ | ||
$I->amOnPage("/admin/store/plugin"); | ||
$config = Fixtures::get('test_config'); | ||
$pluginName = $config['ECCUBE_PLUGIN_VERIFY_NAME']; | ||
$I->see($pluginName); | ||
$span = '//*[@id="page_admin_store_plugin"]/div[1]/div[3]/div[2]/div/div/div[1]/div[2]/table/tbody/tr/td[1]/div/span[text() = "'.$pluginName.'"]'; | ||
$tr = $span . '/ancestor::tr'; | ||
$this->plugin_code= $I->grabTextFrom($tr . "/td[3]/p"); | ||
echo("プラグインコード:" . $this->plugin_code . "\n"); | ||
$button = $tr . '/td[5]/a'; | ||
$I->click($button); | ||
$I->wait(3); | ||
$I->see("インストール確認"); | ||
$I->click("/html/body/div[1]/div[3]/div[2]/div/div/div/div[2]/div[2]/div/button[2]"); | ||
$I->wait(1); | ||
$I->click("/html/body/div[1]/div[3]/div[3]/div/div/div[3]/button[2]"); | ||
//インストール処理が終わるまで待機 | ||
$I->waitForJS("return $.active == 0;", 60); | ||
$I->see("インストールが完了しました。"); | ||
$I->click("/html/body/div[1]/div[3]/div[3]/div/div/div[3]/a"); | ||
} | ||
public function プラグイン_有効化(AcceptanceTester $I){ | ||
$I->amOnPage("/admin/store/plugin"); | ||
//ステータスを確認 | ||
$config = Fixtures::get('test_config'); | ||
$span = '//*[@id="page_admin_store_plugin"]/div[1]/div[3]/div[2]/div/div/div[1]/div[2]/table/tbody/tr/td[3]/p[text() = "'.$this->plugin_code.'"]'; | ||
$tr = $span . '/ancestor::tr'; | ||
$status = $tr . '/td[4]/span'; | ||
$status_text = $I->grabTextFrom($status); | ||
echo("プラグインのステータス:". $status_text ."\n"); | ||
$activateButton = $tr . '/td[6]/div/div[2]/a'; | ||
$I->click($activateButton); | ||
$I->wait(3); | ||
$I->see("を有効にしました"); | ||
} | ||
public function プラグイン_無効化(AcceptanceTester $I){ | ||
$I->amOnPage("/admin/store/plugin"); | ||
$span = '//*[@id="page_admin_store_plugin"]/div[1]/div[3]/div[2]/div/div/div[1]/div[2]/table/tbody/tr/td[3]/p[text() = "'.$this->plugin_code.'"]'; | ||
$tr = $span . '/ancestor::tr'; | ||
$status = $tr . '/td[4]/span'; | ||
$status_text = $I->grabTextFrom($status); | ||
echo("プラグインのステータス:". $status_text ."\n"); | ||
$disableButton = $tr . '/td[6]/div/div[2]/a'; | ||
$I->click($disableButton); | ||
$I->wait(3); | ||
$I->see("を無効にしました"); | ||
} | ||
public function プラグイン_削除(AcceptanceTester $I){ | ||
$I->amOnPage("/admin/store/plugin"); | ||
$span = '//*[@id="page_admin_store_plugin"]/div[1]/div[3]/div[2]/div/div/div[1]/div[2]/table/tbody/tr/td[3]/p[text() = "'.$this->plugin_code.'"]'; | ||
$tr = $span . '/ancestor::tr'; | ||
$uninstallButton = $tr . '/td[6]/div/div[1]/a'; | ||
$I->click($uninstallButton); | ||
$I->wait(1); | ||
$I->click("/html/body/div[1]/div[3]/div[2]/div/div/div[1]/div[3]/div/div/div[3]/button[2]"); | ||
$I->waitForJS("return $.active == 0;", 60); | ||
$I->see("削除が完了しました。"); | ||
$I->click('//*[@id="officialPluginDeleteModal"]/div/div/div[3]/button[3]'); | ||
$I->wait(3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
while ! nc -z ec-cube 80; do sleep 1; done; while ! nc -z chrome 4444; do sleep 1; done; ls -la && /var/www/html/vendor/bin/codecept run -d acceptance --env chrome-headless,local -g admin01 | ||
while ! nc -z ec-cube 80; do sleep 1; done; while ! nc -z chrome 4444; do sleep 1; done; ls -la && php bin/console cache:clear --no-warmup && /var/www/html/vendor/bin/codecept run -d acceptance --env chrome-headless,local -g plugin_verify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
declare -r CURRENT_DIR=$PWD | ||
echo "彩プラグイン検証ツール" | ||
echo "----------------------" | ||
echo "検証するプラグインの情報を入力してください。" | ||
echo " " | ||
read -p 'プラグイン名:' pluginname | ||
read -p '認証キー:' key | ||
|
||
if grep -Fq "ECCUBE_PLUGIN_VERIFY_NAME =" codeception/acceptance/config.ini | ||
then | ||
sed -i '/ECCUBE_PLUGIN_VERIFY_NAME =/d' codeception/acceptance/config.ini | ||
echo "ECCUBE_PLUGIN_VERIFY_NAME = \"$pluginname\"" >> codeception/acceptance/config.ini | ||
else | ||
echo "ECCUBE_PLUGIN_VERIFY_NAME = \"$pluginname\"" >> codeception/acceptance/config.ini | ||
fi | ||
|
||
if grep -Fq "ECCUBE_PLUGIN_VERIFY_KEY =" codeception/acceptance/config.ini | ||
then | ||
sed -i '/ECCUBE_PLUGIN_VERIFY_KEY =/d' codeception/acceptance/config.ini | ||
echo "ECCUBE_PLUGIN_VERIFY_KEY = $key" >> codeception/acceptance/config.ini | ||
else | ||
echo "ECCUBE_PLUGIN_VERIFY_KEY = $key" >> codeception/acceptance/config.ini | ||
fi | ||
|
||
echo "dockerコンテナを立ち上げます。少々お待ちください。" | ||
docker compose -f docker-compose.yml -f docker-compose.mysql.yml -f docker-compose.codeception.yml up -d --build |