Code format
This commit is contained in:
parent
ab549d1cd8
commit
89adc4d8d1
|
|
@ -27,9 +27,15 @@ class MenusController extends Controller
|
|||
|
||||
public function latestProducts()
|
||||
{
|
||||
$products = ProductRepo::getBuilder(['active' => 1])
|
||||
$products = ProductRepo::getBuilder(
|
||||
[
|
||||
'active' => 1,
|
||||
'sort' => 'created_at',
|
||||
'order' => 'desc',
|
||||
])
|
||||
->whereHas('masterSku')
|
||||
->with('inCurrentWishlist')
|
||||
->orderByDesc('created_at')
|
||||
->paginate(perPage());
|
||||
|
||||
$data = [
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
<?php
|
||||
phpinfo();
|
||||
?>
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
require_once __DIR__.'/../page/front/LoginTest.php';
|
||||
require_once __DIR__.'/../page/front/RegisterTest.php';
|
||||
require_once __DIR__ . '/../page/front/LoginTest.php';
|
||||
require_once __DIR__ . '/../page/front/RegisterTest.php';
|
||||
class DuskTestSuite extends DuskTestCase
|
||||
{
|
||||
public static function suite()
|
||||
{
|
||||
$suite = new TestSuite('Dusk Tests');
|
||||
|
||||
$suite->addTestFile(__DIR__.'/../page/front/LoginTest.php');
|
||||
$suite->addTestFile(__DIR__.'/../page/front/RegisterTest.php');
|
||||
$suite->addTestFile(__DIR__ . '/../page/front/LoginTest.php');
|
||||
$suite->addTestFile(__DIR__ . '/../page/front/RegisterTest.php');
|
||||
|
||||
return $suite;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +1,26 @@
|
|||
<?php
|
||||
|
||||
|
||||
require_once __DIR__.'/../../../../vendor/autoload.php';
|
||||
require_once __DIR__ . '/../../../../vendor/autoload.php';
|
||||
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
use PHPUnit\TextUI\DefaultResultPrinter;
|
||||
|
||||
|
||||
|
||||
$suite = new TestSuite();
|
||||
$suite = new TestSuite();
|
||||
// 向测试套件中添加测试用例
|
||||
//前台
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RegisterFirst.php');//先注册一个账户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RegisterTest.php');//场景注册
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RegisterFirst.php'); //先注册一个账户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RegisterTest.php'); //场景注册
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\LoginTest.php'); //前台登录场景
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\SignOutTest.php'); //前台退出
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\AddressTest.php');//添加地址
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\AddCartTest.php');//加入购物车
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RemoveCartTest.php');//移除购物车
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RemoveWishlistTest.php');//移除喜欢
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\WishlistTest.php');//加入喜欢
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\EditUserInfo.php');//修改个人信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\CartCheckoutTest.php');//从购物车结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\ChangePayMethodTest.php');//下单时更改支付方式
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\OrderTest.php');//下单
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\AddressTest.php'); //添加地址
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\AddCartTest.php'); //加入购物车
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RemoveCartTest.php'); //移除购物车
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\RemoveWishlistTest.php'); //移除喜欢
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\WishlistTest.php'); //加入喜欢
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\EditUserInfo.php'); //修改个人信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\CartCheckoutTest.php'); //从购物车结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\ChangePayMethodTest.php'); //下单时更改支付方式
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\front\OrderTest.php'); //下单
|
||||
//后台
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AdminLoginTest.php'); //后台登录
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AdminSignOutTest.php'); //后台退出
|
||||
|
|
@ -33,32 +30,31 @@ use PHPUnit\TextUI\DefaultResultPrinter;
|
|||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\EditProductTest.php'); //编辑商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelProductTest.php'); //删除商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\GoVipTest.php'); //跳转vip界面
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\LanguageSwitchTest.php');//切换语言
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddCustomerTest.php');//创建用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\EditCustomerTest.php');//修改用户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php');//删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddCusGroupTest.php');//添加用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\EditCusGroupTest.php');//编辑用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCusGroupTest.php');//删除用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\CustomerRecycleTest.php');//恢复客户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php');//删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\CusEmptyRecycleTest.php');//清空回收站
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php');//删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCusRecycleTest.php');//从回收站删除客户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddExpressTest.php');//添加快递公司
|
||||
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\LanguageSwitchTest.php'); //切换语言
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddCustomerTest.php'); //创建用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\EditCustomerTest.php'); //修改用户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php'); //删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddCusGroupTest.php'); //添加用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\EditCusGroupTest.php'); //编辑用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCusGroupTest.php'); //删除用户组
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\CustomerRecycleTest.php'); //恢复客户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php'); //删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\CusEmptyRecycleTest.php'); //清空回收站
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCustomerTest.php'); //删除用户
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\DelCusRecycleTest.php'); //从回收站删除客户信息
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\admin\AddExpressTest.php'); //添加快递公司
|
||||
|
||||
//前后台联测
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\AlterOrderStationTest.php');//订单状态修改 已支付-已发货-一已完成
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CancelOrderTest.php');//取消商品订单
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CloseVisiterCheckoutTest.php');//禁用游客结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\OpenVisiterCheckoutTest.php');//开启游客结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CreateCategoriesTest.php');//添加商品分类
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\EnableProductTest.php');//启用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\DisableProductTest.php');//禁用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\EnableProductTest.php');//启用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\UnderstockOrderTest.php');//库存不足下单
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CustomerGroupDiscountTest.php');//客户组折扣检验
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\AlterOrderStationTest.php'); //订单状态修改 已支付-已发货-一已完成
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CancelOrderTest.php'); //取消商品订单
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CloseVisiterCheckoutTest.php'); //禁用游客结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\OpenVisiterCheckoutTest.php'); //开启游客结账
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CreateCategoriesTest.php'); //添加商品分类
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\EnableProductTest.php'); //启用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\DisableProductTest.php'); //禁用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\EnableProductTest.php'); //启用商品
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\UnderstockOrderTest.php'); //库存不足下单
|
||||
$suite->addTestFile('.\tests\Browser\dusktest\page\combine\CustomerGroupDiscountTest.php'); //客户组折扣检验
|
||||
|
||||
// 运行测试套件
|
||||
$result = $suite->run();
|
||||
|
|
|
|||
|
|
@ -1,34 +1,30 @@
|
|||
<?php
|
||||
|
||||
const admin_top = [
|
||||
"login_url" =>"/admin",
|
||||
"root"=> ".text-dark.ml-2",
|
||||
"mg_index"=>".list-unstyled.navbar-nav li:nth-child(1)",//管理首页 .list-unstyled.navbar-nav
|
||||
"mg_order"=>".list-unstyled.navbar-nav li:nth-child(2)",//管理订单
|
||||
"mg_product"=>".list-unstyled.navbar-nav li:nth-child(3)",//管理商品
|
||||
"mg_customers"=>".list-unstyled.navbar-nav li:nth-child(4)",//管理客户
|
||||
"mg_article"=>".list-unstyled.navbar-nav li:nth-child(5)",//管理文章
|
||||
"mg_design"=>".list-unstyled.navbar-nav li:nth-child(6)",//设计
|
||||
"mg_plugin"=>".list-unstyled.navbar-nav li:nth-child(7)",//插件
|
||||
"system_set"=>".list-unstyled.navbar-nav li:nth-child(8)",//系统设置
|
||||
'go_catalog'=>'.dropdown-menu.dropdown-menu-end.show li:nth-child(1)',//去往前台
|
||||
'personal_center'=>'.dropdown-menu.dropdown-menu-end.show li:nth-child(2)',//个人中心
|
||||
"sign_out"=> ".dropdown-menu.dropdown-menu-end.show li:nth-child(4)",//退出登录
|
||||
"Alter"=>".navbar.navbar-right li:nth-child(1)",//更新按钮
|
||||
"VIP"=>".navbar.navbar-right li:nth-child(2)",//vip图标
|
||||
"buy_copyright"=>".navbar.navbar-right li:nth-child(3)",//版权购买
|
||||
"plugins_market"=>".navbar.navbar-right li:nth-child(4)",//插件市场
|
||||
"sw_language"=>".navbar.navbar-right li:nth-child(5)",//切换语言
|
||||
"en_language"=>".dropdown-menu.dropdown-menu-end.show li:nth-child(2)",//切换英语
|
||||
"ch_language"=>".dropdown-menu.dropdown-menu-end.show li:nth-child(9)",//切换中文
|
||||
'login_url' => '/admin',
|
||||
'root' => '.text-dark.ml-2',
|
||||
'mg_index' => '.list-unstyled.navbar-nav li:nth-child(1)', //管理首页 .list-unstyled.navbar-nav
|
||||
'mg_order' => '.list-unstyled.navbar-nav li:nth-child(2)', //管理订单
|
||||
'mg_product' => '.list-unstyled.navbar-nav li:nth-child(3)', //管理商品
|
||||
'mg_customers' => '.list-unstyled.navbar-nav li:nth-child(4)', //管理客户
|
||||
'mg_article' => '.list-unstyled.navbar-nav li:nth-child(5)', //管理文章
|
||||
'mg_design' => '.list-unstyled.navbar-nav li:nth-child(6)', //设计
|
||||
'mg_plugin' => '.list-unstyled.navbar-nav li:nth-child(7)', //插件
|
||||
'system_set' => '.list-unstyled.navbar-nav li:nth-child(8)', //系统设置
|
||||
'go_catalog' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(1)', //去往前台
|
||||
'personal_center' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(2)', //个人中心
|
||||
'sign_out' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(4)', //退出登录
|
||||
'Alter' => '.navbar.navbar-right li:nth-child(1)', //更新按钮
|
||||
'VIP' => '.navbar.navbar-right li:nth-child(2)', //vip图标
|
||||
'buy_copyright' => '.navbar.navbar-right li:nth-child(3)', //版权购买
|
||||
'plugins_market' => '.navbar.navbar-right li:nth-child(4)', //插件市场
|
||||
'sw_language' => '.navbar.navbar-right li:nth-child(5)', //切换语言
|
||||
'en_language' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(2)', //切换英语
|
||||
'ch_language' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(9)', //切换中文
|
||||
];
|
||||
const admin_assert = [
|
||||
"vip_assert"=>"登录购买VIP服务",
|
||||
"plugins_assert"=>"/admin/marketing",
|
||||
"en_assert"=>"Admin Panel",//切换为中文断言
|
||||
"ch_assert"=>"后台管理",//切换为英文断言
|
||||
'vip_assert' => '登录购买VIP服务',
|
||||
'plugins_assert' => '/admin/marketing',
|
||||
'en_assert' => 'Admin Panel', //切换为中文断言
|
||||
'ch_assert' => '后台管理', //切换为英文断言
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
const article_left = [
|
||||
"url" =>"/admin/pages",
|
||||
"mg_article"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//文章管理
|
||||
"catalog_article"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//文章分类
|
||||
'url' => '/admin/pages',
|
||||
'mg_article' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //文章管理
|
||||
'catalog_article' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //文章分类
|
||||
];
|
||||
const article_common = [
|
||||
"add_btn"=>"#content > div.container-fluid.p-0 > div > div > div.d-flex.justify-content-between.mb-4 > a",//添加按钮
|
||||
"edit_btn"=>"#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a",//编辑按钮
|
||||
"del_btn"=>"#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > button",//删除按钮
|
||||
|
||||
'add_btn' => '#content > div.container-fluid.p-0 > div > div > div.d-flex.justify-content-between.mb-4 > a', //添加按钮
|
||||
'edit_btn' => '#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a', //编辑按钮
|
||||
'del_btn' => '#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > button', //删除按钮
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
<?php
|
||||
const categories_data = [
|
||||
"ch_name"=>"categories_test",
|
||||
"en_name"=>"categories_test",
|
||||
"ch_content"=>"categories_content_test",
|
||||
"en_content"=>"categories_content_test",
|
||||
"ch_title"=>"categories_title_test",
|
||||
"en_title"=>"categories_title_test",
|
||||
"ch_keywords"=>"categories_keywords_test",
|
||||
"en_keywords"=>"categories_keywords_test",
|
||||
"ch_description"=>"categories_description_test",
|
||||
"en_description"=>"categories_description_test",
|
||||
|
||||
const categories_data = [
|
||||
'ch_name' => 'categories_test',
|
||||
'en_name' => 'categories_test',
|
||||
'ch_content' => 'categories_content_test',
|
||||
'en_content' => 'categories_content_test',
|
||||
'ch_title' => 'categories_title_test',
|
||||
'en_title' => 'categories_title_test',
|
||||
'ch_keywords' => 'categories_keywords_test',
|
||||
'en_keywords' => 'categories_keywords_test',
|
||||
'ch_description' => 'categories_description_test',
|
||||
'en_description' => 'categories_description_test',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
<?php
|
||||
|
||||
const categories_info = [
|
||||
"ch_name"=>"descriptions[zh_cn][name]",
|
||||
"en_name"=>"descriptions[en][name]",
|
||||
"ch_content"=>"descriptions[zh_cn][content]",
|
||||
"en_content"=>"descriptions[en][content]",
|
||||
"parent_cate"=>"parent_id",
|
||||
"ch_title"=>"descriptions[zh_cn][meta_title]",
|
||||
"en_title"=>"descriptions[en][meta_title]",
|
||||
"ch_keywords"=>"descriptions[zh_cn][meta_keywords]",
|
||||
"en_keywords"=>"descriptions[en][meta_keywords]",
|
||||
"ch_description"=>"descriptions[zh_cn][meta_description]",
|
||||
"en_description"=>"descriptions[en][meta_description]",
|
||||
"status_enable"=>"#active-1",
|
||||
"status_disable"=>"#active-0",
|
||||
"save_btn"=>".btn.btn-primary.mt-3",
|
||||
'ch_name' => 'descriptions[zh_cn][name]',
|
||||
'en_name' => 'descriptions[en][name]',
|
||||
'ch_content' => 'descriptions[zh_cn][content]',
|
||||
'en_content' => 'descriptions[en][content]',
|
||||
'parent_cate' => 'parent_id',
|
||||
'ch_title' => 'descriptions[zh_cn][meta_title]',
|
||||
'en_title' => 'descriptions[en][meta_title]',
|
||||
'ch_keywords' => 'descriptions[zh_cn][meta_keywords]',
|
||||
'en_keywords' => 'descriptions[en][meta_keywords]',
|
||||
'ch_description' => 'descriptions[zh_cn][meta_description]',
|
||||
'en_description' => 'descriptions[en][meta_description]',
|
||||
'status_enable' => '#active-1',
|
||||
'status_disable' => '#active-0',
|
||||
'save_btn' => '.btn.btn-primary.mt-3',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
<?php
|
||||
|
||||
const product_info = [
|
||||
"ch_name"=>"test",//中文名称
|
||||
"en_name"=>"test",//英文名称
|
||||
"sku"=>"123",//sku
|
||||
"price"=>"500",//价格
|
||||
"origin_price"=>"50",//原价
|
||||
"cost_price"=>"5",//成本价
|
||||
"quantity"=>"3",//数量
|
||||
'ch_name' => 'test', //中文名称
|
||||
'en_name' => 'test', //英文名称
|
||||
'sku' => '123', //sku
|
||||
'price' => '500', //价格
|
||||
'origin_price' => '50', //原价
|
||||
'cost_price' => '5', //成本价
|
||||
'quantity' => '3', //数量
|
||||
];
|
||||
const alter_product = [
|
||||
"ch_name"=>"alter_test",//中文名称
|
||||
"en_name"=>"alter_test",//英文名称
|
||||
"sku"=>"456",//sku
|
||||
"price"=>"5000",//价格
|
||||
"origin_price"=>"500",//原价
|
||||
"cost_price"=>"50",//成本价
|
||||
"quantity"=>"30",//数量
|
||||
"low_quantity"=>"5",//少量商品 ,测试库存不足
|
||||
'ch_name' => 'alter_test', //中文名称
|
||||
'en_name' => 'alter_test', //英文名称
|
||||
'sku' => '456', //sku
|
||||
'price' => '5000', //价格
|
||||
'origin_price' => '500', //原价
|
||||
'cost_price' => '50', //成本价
|
||||
'quantity' => '30', //数量
|
||||
'low_quantity' => '5', //少量商品 ,测试库存不足
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
|
||||
const product_top = [
|
||||
"login_url" =>"/admin/products/create",//
|
||||
"ch_name"=>"descriptions[zh_cn][name]",//中文名称
|
||||
"en_name"=>"descriptions[en][name]",//英文名称
|
||||
"sku"=>"skus[0][sku]",//sku
|
||||
"price"=>"skus[0][price]",//价格
|
||||
"origin_price"=>"skus[0][origin_price]",//原价
|
||||
"cost_price"=>"skus[0][cost_price]",//成本价
|
||||
"quantity"=>"skus[0][quantity]",//数量
|
||||
"Enable"=>"#active-1",
|
||||
"Disable"=>"#active-0",
|
||||
"save_btn"=>"#content > div.page-title-box.py-1.d-flex.align-items-center.justify-content-between > div > button",//保存
|
||||
'login_url' => '/admin/products/create', //
|
||||
'ch_name' => 'descriptions[zh_cn][name]', //中文名称
|
||||
'en_name' => 'descriptions[en][name]', //英文名称
|
||||
'sku' => 'skus[0][sku]', //sku
|
||||
'price' => 'skus[0][price]', //价格
|
||||
'origin_price' => 'skus[0][origin_price]', //原价
|
||||
'cost_price' => 'skus[0][cost_price]', //成本价
|
||||
'quantity' => 'skus[0][quantity]', //数量
|
||||
'Enable' => '#active-1',
|
||||
'Disable' => '#active-0',
|
||||
'save_btn' => '#content > div.page-title-box.py-1.d-flex.align-items-center.justify-content-between > div > button', //保存
|
||||
];
|
||||
const product_assert = [
|
||||
"Disable_text" =>".text-danger",//商品禁用后显示的文本class
|
||||
'Disable_text' => '.text-danger', //商品禁用后显示的文本class
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
const cus_group_info = [
|
||||
"ch_group_name" =>"钻石组",
|
||||
"en_group_name"=>"钻石组",
|
||||
"ch_description"=>"钻石组",
|
||||
"en_description"=>"钻石组",
|
||||
"discount"=>"20",
|
||||
'ch_group_name' => '钻石组',
|
||||
'en_group_name' => '钻石组',
|
||||
'ch_description' => '钻石组',
|
||||
'en_description' => '钻石组',
|
||||
'discount' => '20',
|
||||
];
|
||||
const alter_cus_group_info = [
|
||||
"ch_group_name" =>"钻石组alter",
|
||||
"en_group_name"=>"钻石组alter",
|
||||
"ch_description"=>"钻石组alter",
|
||||
"en_description"=>"钻石组alter",
|
||||
"discount"=>"30",
|
||||
'ch_group_name' => '钻石组alter',
|
||||
'en_group_name' => '钻石组alter',
|
||||
'ch_description' => '钻石组alter',
|
||||
'en_description' => '钻石组alter',
|
||||
'discount' => '30',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
<?php
|
||||
|
||||
const customer_info = [
|
||||
"name" =>"admin",
|
||||
"email"=>"admin@163.com",
|
||||
"pwd"=>"123456",
|
||||
"customer_group"=>"",
|
||||
'name' => 'admin',
|
||||
'email' => 'admin@163.com',
|
||||
'pwd' => '123456',
|
||||
'customer_group' => '',
|
||||
|
||||
];
|
||||
const customer_info_alter = [
|
||||
"name" =>"test1",
|
||||
"email"=>"test1@163.com",
|
||||
"pwd"=>"1234567",
|
||||
"customer_group"=>"",
|
||||
'name' => 'test1',
|
||||
'email' => 'test1@163.com',
|
||||
'pwd' => '1234567',
|
||||
'customer_group' => '',
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,69 +1,68 @@
|
|||
<?php
|
||||
|
||||
const customer_left = [
|
||||
"url" =>"/admin/customers",
|
||||
// "customer_list"=>"客户列表",//客户列表
|
||||
// "customer_group"=>"客户组",//客户组
|
||||
// "re_station"=>"回收站",//回收站
|
||||
"customer_list"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//客户列表
|
||||
"customer_group"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//客户组
|
||||
"re_station"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)",//回收站
|
||||
'url' => '/admin/customers',
|
||||
// "customer_list"=>"客户列表",//客户列表
|
||||
// "customer_group"=>"客户组",//客户组
|
||||
// "re_station"=>"回收站",//回收站
|
||||
'customer_list' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //客户列表
|
||||
'customer_group' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //客户组
|
||||
're_station' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)', //回收站
|
||||
];
|
||||
const cre_customer = [
|
||||
"name" =>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(1) > div > div > input",
|
||||
"email"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div > input",
|
||||
"pwd"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input",
|
||||
"customer_group"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(4) > div > div > div > span > span > i",
|
||||
"state"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(5) > div",
|
||||
"save_btn"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(6) > div > button.el-button.el-button--primary",
|
||||
'name' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(1) > div > div > input',
|
||||
'email' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div > input',
|
||||
'pwd' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input',
|
||||
'customer_group' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(4) > div > div > div > span > span > i',
|
||||
'state' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(5) > div',
|
||||
'save_btn' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(6) > div > button.el-button.el-button--primary',
|
||||
];
|
||||
const alter_customer = [
|
||||
"name" =>"#pane-customer > div > div:nth-child(1) > div > div > input",
|
||||
"email"=>"#pane-customer > div > div:nth-child(2) > div > div > input",
|
||||
"pwd"=>"#pane-customer > div > div:nth-child(3) > div > div > input",
|
||||
"customer_group"=>"#pane-customer > div > div:nth-child(4) > div > div > div.el-input.el-input--suffix > span > span > i",
|
||||
"state"=>"#pane-customer > div > div:nth-child(5) > div > div > span",
|
||||
"save_btn"=>"#pane-customer > div > div:nth-child(6) > div > button",
|
||||
'name' => '#pane-customer > div > div:nth-child(1) > div > div > input',
|
||||
'email' => '#pane-customer > div > div:nth-child(2) > div > div > input',
|
||||
'pwd' => '#pane-customer > div > div:nth-child(3) > div > div > input',
|
||||
'customer_group' => '#pane-customer > div > div:nth-child(4) > div > div > div.el-input.el-input--suffix > span > span > i',
|
||||
'state' => '#pane-customer > div > div:nth-child(5) > div > div > span',
|
||||
'save_btn' => '#pane-customer > div > div:nth-child(6) > div > button',
|
||||
|
||||
];
|
||||
const customer_list = [
|
||||
//创建客户
|
||||
"cre_customer"=>"#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button",
|
||||
'cre_customer' => '#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button',
|
||||
//编辑客户
|
||||
"edit_customer" =>"#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(8) > a",
|
||||
'edit_customer' => '#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(8) > a',
|
||||
//删除客户
|
||||
"del_customer" =>"#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(8) > button",
|
||||
"get_assert"=>"#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(2)",
|
||||
"sure_btn"=>"确定",
|
||||
'del_customer' => '#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(8) > button',
|
||||
'get_assert' => '#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(2)',
|
||||
'sure_btn' => '确定',
|
||||
|
||||
];
|
||||
const customer_group = [
|
||||
//创建客户组
|
||||
"cre_cus_group"=>"#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button",
|
||||
'cre_cus_group' => '#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button',
|
||||
//编辑客户组
|
||||
"edit_cus_group" =>".btn.btn-outline-secondary.btn-sm",
|
||||
'edit_cus_group' => '.btn.btn-outline-secondary.btn-sm',
|
||||
//删除客户组
|
||||
"del_cus_group" =>".btn.btn-outline-danger.btn-sm.ml-1",
|
||||
"get_assert"=>"#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(2)",
|
||||
"sure_btn"=>"确定",
|
||||
'del_cus_group' => '.btn.btn-outline-danger.btn-sm.ml-1',
|
||||
'get_assert' => '#customer-app > div.card-body > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(2)',
|
||||
'sure_btn' => '确定',
|
||||
|
||||
];
|
||||
const cre_cus_group = [
|
||||
"ch_group_name" =>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div.el-form-item.language-inputs.is-required > div > div:nth-child(1) > div > div > input",
|
||||
"en_group_name"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div.el-form-item.language-inputs.is-required > div > div:nth-child(2) > div > div > input",
|
||||
"ch_description"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div:nth-child(1) > div > div > input",
|
||||
"en_description"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div:nth-child(2) > div > div > input",
|
||||
"discount"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input",
|
||||
"save_btn"=>"#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(4) > div > div > button.el-button.el-button--primary",
|
||||
'ch_group_name' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div.el-form-item.language-inputs.is-required > div > div:nth-child(1) > div > div > input',
|
||||
'en_group_name' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div.el-form-item.language-inputs.is-required > div > div:nth-child(2) > div > div > input',
|
||||
'ch_description' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div:nth-child(1) > div > div > input',
|
||||
'en_description' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(2) > div > div:nth-child(2) > div > div > input',
|
||||
'discount' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input',
|
||||
'save_btn' => '#customer-app > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(4) > div > div > button.el-button.el-button--primary',
|
||||
];
|
||||
const empty_recycle = [
|
||||
"empty_btn"=>"#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button",//清空数据按钮
|
||||
"recycle_btn"=>"#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(8) > a",//恢复按钮
|
||||
"recycle_del"=>"#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(8) > button",//删除按钮
|
||||
'empty_btn' => '#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button', //清空数据按钮
|
||||
'recycle_btn' => '#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(8) > a', //恢复按钮
|
||||
'recycle_del' => '#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(8) > button', //删除按钮
|
||||
//获取即将被删除的客户email
|
||||
"customer_text"=>"#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(2)",
|
||||
"sure_btn"=>"确定",
|
||||
"assert_text"=>"暂无数据~",
|
||||
'customer_text' => '#customer-app > div.card-body > div.table-push > table > tbody > tr > td:nth-child(2)',
|
||||
'sure_btn' => '确定',
|
||||
'assert_text' => '暂无数据~',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
const article_left = [
|
||||
"url" =>"/admin/themes",
|
||||
"temp_set"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//模版设置
|
||||
"navigate_set"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//导航设置
|
||||
"home_decorate"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)",//首页装修
|
||||
"end_decorate"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)",//页尾装修
|
||||
'url' => '/admin/themes',
|
||||
'temp_set' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //模版设置
|
||||
'navigate_set' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //导航设置
|
||||
'home_decorate' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)', //首页装修
|
||||
'end_decorate' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)', //页尾装修
|
||||
];
|
||||
const article_common = [
|
||||
"add_btn"=>"#content > div.container-fluid.p-0 > div > div > div.d-flex.justify-content-between.mb-4 > a",//添加按钮
|
||||
"edit_btn"=>"#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a",//编辑按钮
|
||||
"del_btn"=>"#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > button",//删除按钮
|
||||
|
||||
'add_btn' => '#content > div.container-fluid.p-0 > div > div > div.d-flex.justify-content-between.mb-4 > a', //添加按钮
|
||||
'edit_btn' => '#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a', //编辑按钮
|
||||
'del_btn' => '#content > div.container-fluid.p-0 > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > button', //删除按钮
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
const express = [
|
||||
"express_company"=>"顺风快递",
|
||||
"express_code"=>"11011",
|
||||
"order_number"=>"110120188",
|
||||
'express_company' => '顺风快递',
|
||||
'express_code' => '11011',
|
||||
'order_number' => '110120188',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
|
||||
const admin_true_login = [
|
||||
'email' => 'root@guangda.work',
|
||||
'password' => '123456',
|
||||
|
|
@ -13,7 +12,6 @@ const admin_false_login = [
|
|||
'false_password' => '1234567',
|
||||
'false_assert' => '账号密码不匹配',
|
||||
'illegal_assert' => 'email 必须是一个有效的电子邮件地址。',
|
||||
'no_email'=>'email 字段是必须的。',
|
||||
'no_pwd'=>'password 字段是必须的。',
|
||||
'no_email' => 'email 字段是必须的。',
|
||||
'no_pwd' => 'password 字段是必须的。',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
const admin_login = [
|
||||
"login_url" =>"/admin/login",
|
||||
'tltle'=>'登录到 BeikeShop 后台',
|
||||
"login_email"=> "#email-input",
|
||||
"login_pwd"=> "#password-input",
|
||||
"login_btn"=> ".btn.btn-lg.btn-primary",//登录按钮
|
||||
];
|
||||
|
||||
const admin_login = [
|
||||
'login_url' => '/admin/login',
|
||||
'tltle' => '登录到 BeikeShop 后台',
|
||||
'login_email' => '#email-input',
|
||||
'login_pwd' => '#password-input',
|
||||
'login_btn' => '.btn.btn-lg.btn-primary', //登录按钮
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,32 +1,30 @@
|
|||
<?php
|
||||
|
||||
const order_right = [
|
||||
"url"=>"/admin/orders",
|
||||
"search_order" =>"#app > form > div:nth-child(1) > div:nth-child(1) > div > div > input",//搜索栏--订单号
|
||||
"search_bth"=>"#app > div > div > button:nth-child(1)",//搜索按钮
|
||||
"view_btn"=>"#customer-app > div > div.table-push > table > tbody > tr > td:nth-child(9) > a",//查看按钮
|
||||
'url' => '/admin/orders',
|
||||
'search_order' => '#app > form > div:nth-child(1) > div:nth-child(1) > div > div > input', //搜索栏--订单号
|
||||
'search_bth' => '#app > div > div > button:nth-child(1)', //搜索按钮
|
||||
'view_btn' => '#customer-app > div > div.table-push > table > tbody > tr > td:nth-child(9) > a', //查看按钮
|
||||
];
|
||||
const order_child = [
|
||||
"mg_order" =>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//订单列表
|
||||
"mg_sale_after"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//售后管理
|
||||
"ca_sale_after"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)",//售后原因
|
||||
'mg_order' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //订单列表
|
||||
'mg_sale_after' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //售后管理
|
||||
'ca_sale_after' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)', //售后原因
|
||||
];
|
||||
const order_details = [//订单详情页
|
||||
"pull_btn"=>"#app > form > div.el-form-item.is-required > div > div > div > span > span > i",//状态栏下拉按钮
|
||||
// "paid"=>".el-select-dropdown__item",//已支付
|
||||
"paid"=>".el-scrollbar__view.el-select-dropdown__list li:nth-child(1)",//已支付
|
||||
"cancel"=>".el-scrollbar__view.el-select-dropdown__list li:nth-child(2)",//已取消
|
||||
"alter_btn"=>".el-button.el-button--primary",//更新状态按钮
|
||||
"Shipped"=>".el-scrollbar__view.el-select-dropdown__list li:nth-of-type(2)",//已发货
|
||||
"express_btn"=>"#app > form > div:nth-child(3) > div > div > div > span > span > i",//快递下拉按钮
|
||||
"Completed"=>".el-scrollbar__view.el-select-dropdown__list li:nth-child(1)",//已支付//
|
||||
'pull_btn' => '#app > form > div.el-form-item.is-required > div > div > div > span > span > i', //状态栏下拉按钮
|
||||
// "paid"=>".el-select-dropdown__item",//已支付
|
||||
'paid' => '.el-scrollbar__view.el-select-dropdown__list li:nth-child(1)', //已支付
|
||||
'cancel' => '.el-scrollbar__view.el-select-dropdown__list li:nth-child(2)', //已取消
|
||||
'alter_btn' => '.el-button.el-button--primary', //更新状态按钮
|
||||
'Shipped' => '.el-scrollbar__view.el-select-dropdown__list li:nth-of-type(2)', //已发货
|
||||
'express_btn' => '#app > form > div:nth-child(3) > div > div > div > span > span > i', //快递下拉按钮
|
||||
'Completed' => '.el-scrollbar__view.el-select-dropdown__list li:nth-child(1)', //已支付//
|
||||
|
||||
"express_1"=>".el-scrollbar__view.el-select-dropdown__list",//选择第一个快递
|
||||
"order_number"=>"#app > form > div:nth-child(4) > div > div > input",//订单号
|
||||
"submit"=>"#app > form > div:nth-child(7) > div > button",//提交按钮
|
||||
"submit_btn2"=>"#app > form > div:nth-child(5) > div > button",//提交按钮
|
||||
'express_1' => '.el-scrollbar__view.el-select-dropdown__list', //选择第一个快递
|
||||
'order_number' => '#app > form > div:nth-child(4) > div > div > input', //订单号
|
||||
'submit' => '#app > form > div:nth-child(7) > div > button', //提交按钮
|
||||
'submit_btn2' => '#app > form > div:nth-child(5) > div > button', //提交按钮
|
||||
//#app > form > div:nth-child(5) > div > button
|
||||
""=>"",
|
||||
'' => '',
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,33 @@
|
|||
<?php
|
||||
|
||||
const products_top = [
|
||||
"login_url" =>"/admin/products",
|
||||
""=>"",
|
||||
"create_product"=>"#product-app > div > div > div.d-flex.justify-content-between.my-4 > a > button",//创建商品按钮
|
||||
'login_url' => '/admin/products',
|
||||
'' => '',
|
||||
'create_product' => '#product-app > div > div > div.d-flex.justify-content-between.my-4 > a > button', //创建商品按钮
|
||||
//编辑商品按钮
|
||||
"edit_product" =>"#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a.btn.btn-outline-secondary.btn-sm",
|
||||
'edit_product' => '#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a.btn.btn-outline-secondary.btn-sm',
|
||||
//删除按钮
|
||||
"del_product"=>"#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a.btn.btn-outline-danger.btn-sm",//创建商品按钮
|
||||
"sure_btn"=>"确定",
|
||||
"get_name"=>"#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(4) > a",
|
||||
'del_product' => '#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td.text-end > a.btn.btn-outline-danger.btn-sm', //创建商品按钮
|
||||
'sure_btn' => '确定',
|
||||
'get_name' => '#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(4) > a',
|
||||
];
|
||||
const products_left = [
|
||||
"product_mg"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//商品管理
|
||||
"product_cate"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//商品分类
|
||||
'product_mg' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //商品管理
|
||||
'product_cate' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //商品分类
|
||||
|
||||
"product_brand"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)",//商品品牌
|
||||
"attribute_group"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)",//属性组
|
||||
"attribute"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)",//属性
|
||||
"advanced_filter"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)",//高级筛选
|
||||
"Recy_station"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(7)",//回收站
|
||||
'product_brand' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)', //商品品牌
|
||||
'attribute_group' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)', //属性组
|
||||
'attribute' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)', //属性
|
||||
'advanced_filter' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)', //高级筛选
|
||||
'Recy_station' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(7)', //回收站
|
||||
];
|
||||
const product_cla = [
|
||||
"cre_cate_btn"=>"#category-app > div > a",//创建分类按钮
|
||||
'cre_cate_btn' => '#category-app > div > a', //创建分类按钮
|
||||
|
||||
];
|
||||
const cre_assert = [
|
||||
"cre_ful_assert"=>"创建成功!",
|
||||
"alter_ful_assert" =>"更新成功!",
|
||||
"del_ful_assert" =>"删除成功!",
|
||||
'cre_ful_assert' => '创建成功!',
|
||||
'alter_ful_assert' => '更新成功!',
|
||||
'del_ful_assert' => '删除成功!',
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
<?php
|
||||
|
||||
const system_common = [
|
||||
"save_btn"=>".btn.btn-lg.btn-primary.submit-form" //保存按钮
|
||||
'save_btn' => '.btn.btn-lg.btn-primary.submit-form', //保存按钮
|
||||
];
|
||||
|
||||
const system_left = [
|
||||
"system_set"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)",//系统设置
|
||||
"personal_center"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)",//个人中心
|
||||
"admin_user"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)",//后台用户
|
||||
"area_group"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)",//区域分组
|
||||
"tax_rate_set"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)",//税率设置
|
||||
"tax_category"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(6)",//税费类别
|
||||
"currency_mg"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(7)",//货币管理
|
||||
"language_mg"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(8)",//语言管理
|
||||
"state_mg"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(9)",//国家管理
|
||||
"province_mg"=>".list-unstyled.navbar-nav:nth-child(2) li:nth-child(10)",//省份管理
|
||||
'system_set' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(1)', //系统设置
|
||||
'personal_center' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(2)', //个人中心
|
||||
'admin_user' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(3)', //后台用户
|
||||
'area_group' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(4)', //区域分组
|
||||
'tax_rate_set' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)', //税率设置
|
||||
'tax_category' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(6)', //税费类别
|
||||
'currency_mg' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(7)', //货币管理
|
||||
'language_mg' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(8)', //语言管理
|
||||
'state_mg' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(9)', //国家管理
|
||||
'province_mg' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(10)', //省份管理
|
||||
];
|
||||
const system_set = [
|
||||
"basic_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(1)",//基础设置
|
||||
"store_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(2)",//商店设置
|
||||
"pay_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(3)",//结账设置
|
||||
"images_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(4)",//图片设置
|
||||
"express_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(5)",//快递公司
|
||||
"advanced_filter"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(6)",//高级筛选
|
||||
"email_set"=>".nav.nav-tabs.nav-bordered.mb-5 li:nth-child(7)",//邮件设置
|
||||
"close_visitor_checkout"=>"#tab-checkout > div:nth-child(1) > div > div > div:nth-child(2) > label",//游客结账 禁用
|
||||
"open_visitor_checkout"=>"#guest_checkout-1",//游客结账 启用
|
||||
'basic_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(1)', //基础设置
|
||||
'store_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(2)', //商店设置
|
||||
'pay_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(3)', //结账设置
|
||||
'images_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(4)', //图片设置
|
||||
'express_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(5)', //快递公司
|
||||
'advanced_filter' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(6)', //高级筛选
|
||||
'email_set' => '.nav.nav-tabs.nav-bordered.mb-5 li:nth-child(7)', //邮件设置
|
||||
'close_visitor_checkout' => '#tab-checkout > div:nth-child(1) > div > div > div:nth-child(2) > label', //游客结账 禁用
|
||||
'open_visitor_checkout' => '#guest_checkout-1', //游客结账 启用
|
||||
];
|
||||
const express_set = [ //快递公司
|
||||
"add_btn"=>".bi.bi-plus-circle.cursor-pointer.fs-4",//加号
|
||||
"express_company"=>'input[name="express_company[0][name]"]',//公司名字
|
||||
"express_code"=>'input[name="express_company[0][code]"]',//code
|
||||
"save_btn"=>"#content > div.page-title-box.py-1.d-flex.align-items-center.justify-content-between > div > button",
|
||||
'add_btn' => '.bi.bi-plus-circle.cursor-pointer.fs-4', //加号
|
||||
'express_company' => 'input[name="express_company[0][name]"]', //公司名字
|
||||
'express_code' => 'input[name="express_company[0][code]"]', //code
|
||||
'save_btn' => '#content > div.page-title-box.py-1.d-flex.align-items-center.justify-content-between > div > button',
|
||||
];
|
||||
const express_assert = [ //断言信息
|
||||
"assert_ful"=>"更新成功!",
|
||||
'assert_ful' => '更新成功!',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
const add_address = [
|
||||
"add_name"=>"test",//add_name
|
||||
"add_phone"=>"v11012010086",//选择国家
|
||||
"add_code"=>"643203",//add_code
|
||||
"add_address1"=>"test1",//add_address1
|
||||
"add_address2"=>"test2",//add_address2
|
||||
'add_name' => 'test', //add_name
|
||||
'add_phone' => 'v11012010086', //选择国家
|
||||
'add_code' => '643203', //add_code
|
||||
'add_address1' => 'test1', //add_address1
|
||||
'add_address2' => 'test2', //add_address2
|
||||
];
|
||||
const user_edit = [
|
||||
"upload_images"=>'/../../data/images/Headpicture/Headpicture.jpeg',//上传头像
|
||||
"user_name"=>"admin",//修改名字
|
||||
"user_email"=>"admin@163.com",//修改emial
|
||||
'upload_images' => '/../../data/images/Headpicture/Headpicture.jpeg', //上传头像
|
||||
'user_name' => 'admin', //修改名字
|
||||
'user_email' => 'admin@163.com', //修改emial
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +1,47 @@
|
|||
<?php
|
||||
|
||||
const account = [
|
||||
"url" =>"/account",
|
||||
"go_index"=>".logo",//beikeshop图标
|
||||
"go_account"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(1)",//
|
||||
"go_Edit"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(2)",//编辑信息
|
||||
"go_order"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(3)",//查看订单
|
||||
"go_address"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(4)",//添加地址
|
||||
"go_Wishlist"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(5)",//添收藏
|
||||
"go_rma"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(6)",//售后
|
||||
"SignOut"=>".list-group-item.d-flex.justify-content-between.align-items-center:nth-child(7)"//sign out
|
||||
'url' => '/account',
|
||||
'go_index' => '.logo', //beikeshop图标
|
||||
'go_account' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(1)', //
|
||||
'go_Edit' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(2)', //编辑信息
|
||||
'go_order' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(3)', //查看订单
|
||||
'go_address' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(4)', //添加地址
|
||||
'go_Wishlist' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(5)', //添收藏
|
||||
'go_rma' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(6)', //售后
|
||||
'SignOut' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(7)', //sign out
|
||||
];
|
||||
const address = [
|
||||
"login_url" =>"/account/addresses",
|
||||
"add_btn"=>".btn.btn-dark.mb-3",//点击添加地址
|
||||
"add_name"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(1) > div > div > input",//add_name
|
||||
"add_phone"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(2) > div > div > input",//add_phone
|
||||
"add_country"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(1) > div > div > div > div.el-input.el-input--suffix > span > span",//选择国家
|
||||
"add_address"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(3) > div > div > div.el-input > input",
|
||||
"add_province"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(2) > div > div > div > div.el-input.el-input--suffix > span > span",
|
||||
"add_code"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(4) > div > div > input",//add_code
|
||||
"add_address1"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(5) > div > div > input",//add_address1
|
||||
"add_address2"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(6) > div > div > input",//add_address2
|
||||
"default"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(7) > div > div > span",//default
|
||||
"save"=>"#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(8) > div > button.el-button.el-button--primary",//save
|
||||
"assert"=>"Default Address",
|
||||
'login_url' => '/account/addresses',
|
||||
'add_btn' => '.btn.btn-dark.mb-3', //点击添加地址
|
||||
'add_name' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(1) > div > div > input', //add_name
|
||||
'add_phone' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(2) > div > div > input', //add_phone
|
||||
'add_country' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(1) > div > div > div > div.el-input.el-input--suffix > span > span', //选择国家
|
||||
'add_address' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(3) > div > div > div.el-input > input',
|
||||
'add_province' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > div:nth-child(2) > div > div > div > div.el-input.el-input--suffix > span > span',
|
||||
'add_code' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(4) > div > div > input', //add_code
|
||||
'add_address1' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(5) > div > div > input', //add_address1
|
||||
'add_address2' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(6) > div > div > input', //add_address2
|
||||
'default' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(7) > div > div > span', //default
|
||||
'save' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(8) > div > button.el-button.el-button--primary', //save
|
||||
'assert' => 'Default Address',
|
||||
//addresses
|
||||
];
|
||||
const Edit = [
|
||||
"login_url" =>"/account/edit",
|
||||
"upload_btn"=>"#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.bg-light.rounded-3.p-4.mb-4 > div > div > label",//上传头像图标
|
||||
"Confirm_btn"=>"Confirm",
|
||||
"user_name"=>"#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.row.gx-4.gy-3 > div:nth-child(1) > input",//更改用户名
|
||||
"user_email"=>"#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.row.gx-4.gy-3 > div:nth-child(2) > input",//更改用户email
|
||||
"Submit"=>".btn.btn-primary.mt-sm-0",//add_phone
|
||||
"assert"=>"Modify Success!",
|
||||
'login_url' => '/account/edit',
|
||||
'upload_btn' => '#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.bg-light.rounded-3.p-4.mb-4 > div > div > label', //上传头像图标
|
||||
'Confirm_btn' => 'Confirm',
|
||||
'user_name' => '#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.row.gx-4.gy-3 > div:nth-child(1) > input', //更改用户名
|
||||
'user_email' => '#address-app > div > div.col-12.col-md-9 > div > div.card-body.h-600 > form > div.row.gx-4.gy-3 > div:nth-child(2) > input', //更改用户email
|
||||
'Submit' => '.btn.btn-primary.mt-sm-0', //add_phone
|
||||
'assert' => 'Modify Success!',
|
||||
];
|
||||
const Wishlist = [
|
||||
"login_url" =>"/account/edit",
|
||||
"go_Wishlist"=>"Wishlist",//点击Wishlist
|
||||
"Check_Details"=>".btn.btn-dark.btn-sm.add-cart",//查看详情按钮
|
||||
"remove_Wishlist"=>".btn.btn-danger.btn-sm.remove-wishlist",//移除按钮
|
||||
'login_url' => '/account/edit',
|
||||
'go_Wishlist' => 'Wishlist', //点击Wishlist
|
||||
'Check_Details' => '.btn.btn-dark.btn-sm.add-cart', //查看详情按钮
|
||||
'remove_Wishlist' => '.btn.btn-danger.btn-sm.remove-wishlist', //移除按钮
|
||||
|
||||
"no_data"=>".d-flex.flex-column.align-center.align-items-center.mb-4",
|
||||
'no_data' => '.d-flex.flex-column.align-center.align-items-center.mb-4',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
<?php
|
||||
|
||||
|
||||
const checkout = [
|
||||
'url' => '/checkout',//
|
||||
'submit' => 'Submit Order',//提交按钮
|
||||
'url' => '/checkout', //
|
||||
'submit' => 'Submit Order', //提交按钮
|
||||
//订单成功验证信息
|
||||
'assert' => 'Congratulations, the order was successfully generated!',
|
||||
//订单号
|
||||
'order_num'=>'.fw-bold',
|
||||
'product_price'=>'.price.text-end',
|
||||
'quantity'=>'.quantity',//购买商品数量
|
||||
'product_total'=>'.totals li:nth-child(1) span:nth-child(2)',//商品总价
|
||||
'shipping_fee'=>'.totals li:nth-child(2) span:nth-child(2)',//运费
|
||||
'customer_discount'=>'.totals li:nth-child(3) span:nth-child(2)',//折扣金额
|
||||
'order_total'=>'.totals li:nth-child(4) span:nth-child(2)',//实际金额
|
||||
'view_order'=>'.table.table-borderless tbody tr:nth-of-type(2) td:nth-of-type(2) a',
|
||||
'method_pay'=>'.radio-line-item',
|
||||
'order_num' => '.fw-bold',
|
||||
'product_price' => '.price.text-end',
|
||||
'quantity' => '.quantity', //购买商品数量
|
||||
'product_total' => '.totals li:nth-child(1) span:nth-child(2)', //商品总价
|
||||
'shipping_fee' => '.totals li:nth-child(2) span:nth-child(2)', //运费
|
||||
'customer_discount' => '.totals li:nth-child(3) span:nth-child(2)', //折扣金额
|
||||
'order_total' => '.totals li:nth-child(4) span:nth-child(2)', //实际金额
|
||||
'view_order' => '.table.table-borderless tbody tr:nth-of-type(2) td:nth-of-type(2) a',
|
||||
'method_pay' => '.radio-line-item',
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,38 +1,36 @@
|
|||
<?php
|
||||
|
||||
const index = [
|
||||
"login_url" => "/",
|
||||
"product_img" => "#tab-product-0 > div > div:nth-child(1) > div > div.image > a",//购买商品图标
|
||||
"buy_btn" => "#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold",//购买按钮
|
||||
"address_btn" => "#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button", //添加地址
|
||||
"login_text" => "Home",
|
||||
"right_icon"=>".navbar-nav flex-row",
|
||||
"top_Sports"=>".navbar-nav.mx-auto li:nth-child(1)",
|
||||
"top_Fashion"=>".navbar-nav.mx-auto li:nth-child(2)",
|
||||
"top_Digital"=>".navbar-nav.mx-auto li:nth-child(3)",
|
||||
"top_Hot"=>".navbar-nav.mx-auto li:nth-child(4)",
|
||||
"top_Brand"=>".navbar-nav.mx-auto li:nth-child(5)",
|
||||
"top_Latest_Products"=>".navbar-nav.mx-auto li:nth-child(6)",
|
||||
'login_url' => '/',
|
||||
'product_img' => '#tab-product-0 > div > div:nth-child(1) > div > div.image > a', //购买商品图标
|
||||
'buy_btn' => '#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold', //购买按钮
|
||||
'address_btn' => '#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button', //添加地址
|
||||
'login_text' => 'Home',
|
||||
'right_icon' => '.navbar-nav flex-row',
|
||||
'top_Sports' => '.navbar-nav.mx-auto li:nth-child(1)',
|
||||
'top_Fashion' => '.navbar-nav.mx-auto li:nth-child(2)',
|
||||
'top_Digital' => '.navbar-nav.mx-auto li:nth-child(3)',
|
||||
'top_Hot' => '.navbar-nav.mx-auto li:nth-child(4)',
|
||||
'top_Brand' => '.navbar-nav.mx-auto li:nth-child(5)',
|
||||
'top_Latest_Products' => '.navbar-nav.mx-auto li:nth-child(6)',
|
||||
];
|
||||
const index_top = [
|
||||
// "wishlist_btn" => "",//收藏商品图标
|
||||
"wishlist_btn" => ".navbar-nav.flex-row li:nth-child(2)",//收藏商品图标
|
||||
|
||||
"buy_btn" => "#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold",//购买按钮
|
||||
"address_btn" => "#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button", //添加地址
|
||||
"login_text" => "Home",
|
||||
// "wishlist_btn" => "",//收藏商品图标
|
||||
'wishlist_btn' => '.navbar-nav.flex-row li:nth-child(2)', //收藏商品图标
|
||||
|
||||
'buy_btn' => '#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold', //购买按钮
|
||||
'address_btn' => '#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button', //添加地址
|
||||
'login_text' => 'Home',
|
||||
|
||||
];
|
||||
const index_cart = [
|
||||
"cart_product_text" => "#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > a",
|
||||
"cart_icon"=>".nav-link.position-relative",//购物车图标
|
||||
"product_text"=>"#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > a",//购物车内商品名字
|
||||
"Delete_btn" => "#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > div.product-bottom.d-flex.justify-content-between.align-items-center > span", //删除按钮
|
||||
"product_num"=>"#offcanvas-right-cart > div.offcanvas-footer > div.d-flex.justify-content-between.align-items-center.mb-2.p-3.bg-light.top-footer > div:nth-child(2) > strong:nth-child(2) > span",
|
||||
"cart_Checkout"=>"#offcanvas-right-cart > div.offcanvas-footer > div.p-4 > a.btn.w-100.fw-bold.btn-dark.to-checkout",
|
||||
'cart_product_text' => '#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > a',
|
||||
'cart_icon' => '.nav-link.position-relative', //购物车图标
|
||||
'product_text' => '#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > a', //购物车内商品名字
|
||||
'Delete_btn' => '#offcanvas-right-cart > div.offcanvas-body.pt-0 > div > div > div.product-info.d-flex.align-items-center > div.right.flex-grow-1 > div.product-bottom.d-flex.justify-content-between.align-items-center > span', //删除按钮
|
||||
'product_num' => '#offcanvas-right-cart > div.offcanvas-footer > div.d-flex.justify-content-between.align-items-center.mb-2.p-3.bg-light.top-footer > div:nth-child(2) > strong:nth-child(2) > span',
|
||||
'cart_Checkout' => '#offcanvas-right-cart > div.offcanvas-footer > div.p-4 > a.btn.w-100.fw-bold.btn-dark.to-checkout',
|
||||
];
|
||||
const index_login = [
|
||||
"login_icon"=>".navbar-nav.flex-row li:nth-child(3)",//登录图标
|
||||
'login_icon' => '.navbar-nav.flex-row li:nth-child(3)', //登录图标
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
|
||||
const true_login = [
|
||||
'email' => 'test@163.com',
|
||||
'password' => '123456',
|
||||
|
|
@ -14,4 +13,3 @@ const false_login = [
|
|||
'illegal_assert' => 'Please enter a valid email address!',
|
||||
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
<?php
|
||||
|
||||
|
||||
const login = [
|
||||
"login_url" =>"/login",
|
||||
"login_email"=> "#page-login > div.login-wrap > div:nth-child(1) > form > div.card-body.px-md-2 > div:nth-child(1) > div > div > input",
|
||||
"login_pwd"=> "#page-login > div.login-wrap > div:nth-child(1) > form > div.card-body.px-md-2 > div:nth-child(2) > div > div > input",
|
||||
"login_btn"=> ".btn.btn-dark.btn-lg.w-100.fw-bold:first-of-type",
|
||||
"login_text"=> "Home",
|
||||
'login_url' => '/login',
|
||||
'login_email' => '#page-login > div.login-wrap > div:nth-child(1) > form > div.card-body.px-md-2 > div:nth-child(1) > div > div > input',
|
||||
'login_pwd' => '#page-login > div.login-wrap > div:nth-child(1) > form > div.card-body.px-md-2 > div:nth-child(2) > div > div > input',
|
||||
'login_btn' => '.btn.btn-dark.btn-lg.w-100.fw-bold:first-of-type',
|
||||
'login_text' => 'Home',
|
||||
];
|
||||
const register = [
|
||||
"register_email" => "#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(1) > div > div > input",
|
||||
"register_pwd"=> "#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(2) > div > div > input",
|
||||
"register_re_pwd"=> "#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(3) > div > div > input",
|
||||
// "register_btn"=> ".btn.btn-dark.btn-lg.w-100.fw-bold:nth-child(2)",
|
||||
"register_btn"=> "Register",
|
||||
"register_text"=> "Home",
|
||||
'register_email' => '#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(1) > div > div > input',
|
||||
'register_pwd' => '#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(2) > div > div > input',
|
||||
'register_re_pwd' => '#page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(3) > div > div > input',
|
||||
// "register_btn"=> ".btn.btn-dark.btn-lg.w-100.fw-bold:nth-child(2)",
|
||||
'register_btn' => 'Register',
|
||||
'register_text' => 'Home',
|
||||
];
|
||||
const iframe = [
|
||||
"iframe_name"=>"#layui-layer-iframe1",
|
||||
'iframe_name' => '#layui-layer-iframe1',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
<?php
|
||||
|
||||
|
||||
const order = [
|
||||
"login_url" =>"/login",
|
||||
"product"=> "#tab-product-0 > div > div:nth-child(1) > div > div.image > a > div > img",//购买商品
|
||||
"buy_btn"=> "#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold",//购买按钮
|
||||
"address_btn"=>"#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button", //添加地址
|
||||
"login_text"=> "Home",
|
||||
'login_url' => '/login',
|
||||
'product' => '#tab-product-0 > div > div:nth-child(1) > div > div.image > a > div > img', //购买商品
|
||||
'buy_btn' => '#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold', //购买按钮
|
||||
'address_btn' => '#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button', //添加地址
|
||||
'login_text' => 'Home',
|
||||
];
|
||||
const ca_order_status = [
|
||||
"Unpaid"=>"Unpaid",//待支付
|
||||
"Paid"=>"Paid",//已支付
|
||||
"Shipped"=>"Shipped",//已发货
|
||||
"Completed"=>"Completed",//已完成 Cancelled
|
||||
"Cancelled"=>"Cancelled",//已完成 Cancelled
|
||||
'Unpaid' => 'Unpaid', //待支付
|
||||
'Paid' => 'Paid', //已支付
|
||||
'Shipped' => 'Shipped', //已发货
|
||||
'Completed' => 'Completed', //已完成 Cancelled
|
||||
'Cancelled' => 'Cancelled', //已完成 Cancelled
|
||||
];
|
||||
const get_order_status = [
|
||||
"status_text"=>".table.table-borderless.mb-0 tbody tr:first-child td:nth-child(3)",//获取当前状态
|
||||
'status_text' => '.table.table-borderless.mb-0 tbody tr:first-child td:nth-child(3)', //获取当前状态
|
||||
];
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
|
||||
const product = [
|
||||
"login_url" =>"/products/1",
|
||||
"product_1"=> ".btn.btn-dark.ms-3.fw-bold",//购买商品
|
||||
"Wishlist_icon"=>".btn.btn-link.ps-0.text-secondary",//收藏
|
||||
"add_cart"=>".btn.btn-outline-dark.ms-md-3.add-cart.fw-bold",
|
||||
"product1_name"=>"#product-top > div:nth-child(2) > div > h1",//产品名字
|
||||
"quantity"=>"#product-top > div:nth-child(2) > div > div.quantity-btns > div > input", //购买商品输入框
|
||||
"quantity_up"=>".bi.bi-chevron-up",//增加数量按钮
|
||||
"buy_btn"=> "#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold",//购买按钮
|
||||
"address_btn"=>"#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button", //添加地址
|
||||
"login_text"=> "Home",
|
||||
"understock_assert"=>".layui-layer-content",
|
||||
'login_url' => '/products/1',
|
||||
'product_1' => '.btn.btn-dark.ms-3.fw-bold', //购买商品
|
||||
'Wishlist_icon' => '.btn.btn-link.ps-0.text-secondary', //收藏
|
||||
'add_cart' => '.btn.btn-outline-dark.ms-md-3.add-cart.fw-bold',
|
||||
'product1_name' => '#product-top > div:nth-child(2) > div > h1', //产品名字
|
||||
'quantity' => '#product-top > div:nth-child(2) > div > div.quantity-btns > div > input', //购买商品输入框
|
||||
'quantity_up' => '.bi.bi-chevron-up', //增加数量按钮
|
||||
'buy_btn' => '#product-top > div:nth-child(2) > div > div.quantity-btns > button.btn.btn-dark.ms-3.fw-bold', //购买按钮
|
||||
'address_btn' => '#checkout-address-app > div.checkout-black > div.addresses-wrap > div > div > div > button', //添加地址
|
||||
'login_text' => 'Home',
|
||||
'understock_assert' => '.layui-layer-content',
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
|
||||
const true_register = [
|
||||
'email' => 'test2@163.com',
|
||||
'password' => '123456',
|
||||
|
|
@ -15,5 +14,3 @@ const false_register = [
|
|||
'illegal_assert' => 'Please enter a valid email address!',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cus_grounp.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cus_grounp.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class AddCusGroupTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,8 +19,7 @@ class AddCusGroupTest extends DuskTestCase
|
|||
public function testAddCusGroup()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -41,13 +40,10 @@ class AddCusGroupTest extends DuskTestCase
|
|||
->type(cre_cus_group['en_description'], cus_group_info['en_description'])
|
||||
->type(cre_cus_group['discount'], cus_group_info['discount'])
|
||||
|
||||
|
||||
//5.点击保存
|
||||
->press(cre_cus_group['save_btn'])
|
||||
->pause(5000)
|
||||
->assertSee(cus_group_info['ch_group_name'])
|
||||
|
||||
;
|
||||
->assertSee(cus_group_info['ch_group_name']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class AddCustomerTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,8 +19,7 @@ class AddCustomerTest extends DuskTestCase
|
|||
public function testAddCustomer()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -39,10 +38,7 @@ class AddCustomerTest extends DuskTestCase
|
|||
//5.点击保存
|
||||
->press(cre_customer['save_btn'])
|
||||
->pause(5000)
|
||||
->assertSee(customer_info['email'])
|
||||
|
||||
;
|
||||
->assertSee(customer_info['email']);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/systemset_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/systemset_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
class AddExpressTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -20,8 +20,7 @@ class AddExpressTest extends DuskTestCase
|
|||
public function testExpressTest()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -44,10 +43,7 @@ class AddExpressTest extends DuskTestCase
|
|||
->pause(5000)
|
||||
|
||||
->assertSee(express_assert['assert_ful'])
|
||||
->pause(3000)
|
||||
|
||||
;
|
||||
->pause(3000);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
class AddProductTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,14 +19,11 @@ class AddProductTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testAddProduct()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -49,9 +46,7 @@ class AddProductTest extends DuskTestCase
|
|||
->type(product_top['quantity'], product_info['quantity'])
|
||||
//5.点击保存
|
||||
->press(product_top['save_btn'])
|
||||
->assertSee(cre_assert['cre_ful_assert'])
|
||||
|
||||
;
|
||||
->assertSee(cre_assert['cre_ful_assert']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
|
||||
class AdminLoginTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -15,14 +15,10 @@ class AdminLoginTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testEmailIllegal()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_false_login['illegal_email'])
|
||||
->type(admin_login['login_pwd'], admin_true_login['password'])
|
||||
|
|
@ -30,11 +26,11 @@ class AdminLoginTest extends DuskTestCase
|
|||
->assertSee(admin_false_login['illegal_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景2 email不存在
|
||||
public function testEmailFalse()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_false_login['false_email'])
|
||||
->type(admin_login['login_pwd'], admin_true_login['password'])
|
||||
|
|
@ -42,11 +38,11 @@ class AdminLoginTest extends DuskTestCase
|
|||
->assertSee(admin_false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景3 密码错误
|
||||
public function testPwdFalse()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
->type(admin_login['login_pwd'], admin_false_login['false_password'])
|
||||
|
|
@ -54,34 +50,33 @@ class AdminLoginTest extends DuskTestCase
|
|||
->assertSee(admin_false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景4 只输入email
|
||||
public function testOnlyEmail()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
->press(admin_login['login_btn'])
|
||||
->assertSee(admin_false_login['no_pwd']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景5 只输入密码
|
||||
public function testOnlyPwd()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_pwd'], admin_true_login['email'])
|
||||
->press(admin_login['login_btn'])
|
||||
->assertSee(admin_false_login['no_email']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景6 成功登录
|
||||
public function testLoginFul()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
->type(admin_login['login_pwd'], admin_true_login['password'])
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
class AdminSignOutTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -15,15 +15,11 @@ class AdminSignOutTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testAdminSignOut()
|
||||
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class CusEmptyRecycleTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -16,15 +16,12 @@ class CusEmptyRecycleTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
|
||||
public function testEmptyRecycle()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -40,8 +37,7 @@ class CusEmptyRecycleTest extends DuskTestCase
|
|||
->pause(2000)
|
||||
->press(empty_recycle['sure_btn'])
|
||||
->pause(2000)
|
||||
->assertSee(empty_recycle['assert_text'])
|
||||
;
|
||||
->assertSee(empty_recycle['assert_text']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,25 +5,20 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class CustomerRecycleTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic browser test example.
|
||||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
public function testCustomerRecycle()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -33,7 +28,7 @@ class CustomerRecycleTest extends DuskTestCase
|
|||
->click(admin_top['mg_customers'])
|
||||
//2.点击回收站
|
||||
->click(customer_left['re_station']);
|
||||
$customer_text=$browser->text(empty_recycle['customer_text']);
|
||||
$customer_text = $browser->text(empty_recycle['customer_text']);
|
||||
echo $customer_text;
|
||||
//3.点击恢复按钮
|
||||
$browser->press(empty_recycle['recycle_btn'])
|
||||
|
|
@ -41,8 +36,7 @@ class CustomerRecycleTest extends DuskTestCase
|
|||
//4.点击客户列表
|
||||
->click(customer_left['customer_list'])
|
||||
//验证客户信息是否存在于页面
|
||||
->assertSee($customer_text)
|
||||
;
|
||||
->assertSee($customer_text);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cus_grounp.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cus_grounp.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class DelCusGroupTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,8 +19,7 @@ class DelCusGroupTest extends DuskTestCase
|
|||
public function testDelCusGroup()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -33,14 +32,12 @@ class DelCusGroupTest extends DuskTestCase
|
|||
//4.点击客户组
|
||||
->click(customer_left['customer_group']);
|
||||
|
||||
$cus_group_text=$browser->text(customer_group['get_assert']);
|
||||
$cus_group_text = $browser->text(customer_group['get_assert']);
|
||||
echo $cus_group_text;
|
||||
//5.点击删除按钮
|
||||
$browser->press(customer_group['del_cus_group'])
|
||||
->pause(2000)
|
||||
->assertSee($cus_group_text)
|
||||
|
||||
;
|
||||
->assertSee($cus_group_text);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class DelCusRecycleTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -16,15 +16,12 @@ class DelCusRecycleTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
|
||||
public function testDelCusRecycle()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -38,7 +35,7 @@ class DelCusRecycleTest extends DuskTestCase
|
|||
->pause(1000)
|
||||
//2.点击回收站
|
||||
->click(customer_left['re_station']);
|
||||
$customer_text=$browser->text(empty_recycle['customer_text']);
|
||||
$customer_text = $browser->text(empty_recycle['customer_text']);
|
||||
echo $customer_text;
|
||||
//3.点击删除按钮
|
||||
$browser->press(empty_recycle['recycle_del'])
|
||||
|
|
@ -46,8 +43,7 @@ class DelCusRecycleTest extends DuskTestCase
|
|||
->press(empty_recycle['sure_btn'])
|
||||
//验证客户信息是否存在于页面
|
||||
->assertSee($customer_text)
|
||||
->pause(5000)
|
||||
;
|
||||
->pause(5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
|
||||
class DelCustomerTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -18,15 +18,12 @@ class DelCustomerTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
|
||||
public function testDelCustomer()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -35,16 +32,14 @@ class DelCustomerTest extends DuskTestCase
|
|||
->pause(2000)
|
||||
//2.点击客户管理
|
||||
->click(admin_top['mg_customers']);
|
||||
$customer_text=$browser->text(customer_list['get_assert']);
|
||||
$customer_text = $browser->text(customer_list['get_assert']);
|
||||
echo $customer_text;
|
||||
$browser->press(customer_list['del_customer'])
|
||||
//确认
|
||||
->press(customer_list['sure_btn']);
|
||||
$browser->pause(2000)
|
||||
->assertDontSee($customer_text)
|
||||
->pause(5000)
|
||||
|
||||
;
|
||||
->pause(5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
class DelProductTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,15 +19,12 @@ class DelProductTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
|
||||
public function testEditProduct()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -35,7 +32,7 @@ class DelProductTest extends DuskTestCase
|
|||
->press(admin_login['login_btn'])
|
||||
->pause(2000)
|
||||
->click(admin_top['mg_product']);
|
||||
$product1_text=$browser->text(products_top['get_name']);
|
||||
$product1_text = $browser->text(products_top['get_name']);
|
||||
echo $product1_text;
|
||||
//2.删除按钮
|
||||
$browser->press(products_top['del_product'])
|
||||
|
|
@ -43,9 +40,7 @@ class DelProductTest extends DuskTestCase
|
|||
->press(products_top['sure_btn']);
|
||||
$browser->pause(2000)
|
||||
->assertDontSee($product1_text)
|
||||
->pause(5000)
|
||||
|
||||
;
|
||||
->pause(5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cus_grounp.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cus_grounp.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class EditCusGroupTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,8 +19,7 @@ class EditCusGroupTest extends DuskTestCase
|
|||
public function testEditCusGroup()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -43,9 +42,7 @@ class EditCusGroupTest extends DuskTestCase
|
|||
//5.点击保存
|
||||
->press(cre_cus_group['save_btn'])
|
||||
->pause(5000)
|
||||
->assertSee(alter_cus_group_info['ch_group_name'])
|
||||
|
||||
;
|
||||
->assertSee(alter_cus_group_info['ch_group_name']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
class EditCustomerTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,8 +19,7 @@ class EditCustomerTest extends DuskTestCase
|
|||
public function testEditCustomer()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -38,9 +37,7 @@ class EditCustomerTest extends DuskTestCase
|
|||
//5.点击保存
|
||||
->press(alter_customer['save_btn'])
|
||||
->pause(5000)
|
||||
->assertSee(customer_info_alter['email'])
|
||||
|
||||
;
|
||||
->assertSee(customer_info_alter['email']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
class EditProductTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,14 +19,11 @@ class EditProductTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testEditProduct()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -48,9 +45,7 @@ class EditProductTest extends DuskTestCase
|
|||
//5.点击保存
|
||||
->press(product_top['save_btn'])
|
||||
->pause(3000)
|
||||
->assertSee(cre_assert['alter_ful_assert'])
|
||||
|
||||
;
|
||||
->assertSee(cre_assert['alter_ful_assert']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
class GoCatalogTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -16,14 +16,11 @@ class GoCatalogTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testGoCatalog()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -36,8 +33,7 @@ class GoCatalogTest extends DuskTestCase
|
|||
->click(admin_top['go_catalog'])
|
||||
->pause(2000)
|
||||
->driver->switchTo()->window($browser->driver->getWindowHandles()[1]);
|
||||
$browser->assertPathIs(index['login_url'])
|
||||
;
|
||||
$browser->assertPathIs(index['login_url']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
|
||||
class GoPluginsTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -18,8 +18,7 @@ class GoPluginsTest extends DuskTestCase
|
|||
public function testGopLugins()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -30,9 +29,8 @@ class GoPluginsTest extends DuskTestCase
|
|||
->click(admin_top['plugins_market'])
|
||||
->pause(2000)
|
||||
//3.根据地址获取断言
|
||||
->assertPathIs(admin_assert['plugins_assert'])
|
||||
;
|
||||
;
|
||||
->assertPathIs(admin_assert['plugins_assert']);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
|
||||
class GoVipTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -18,8 +18,7 @@ class GoVipTest extends DuskTestCase
|
|||
public function testGoVip()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -31,9 +30,7 @@ class GoVipTest extends DuskTestCase
|
|||
->pause(2000)
|
||||
//3.切换到第二个窗口并获取断言
|
||||
->driver->switchTo()->window($browser->driver->getWindowHandles()[1]);
|
||||
$browser->assertSee(admin_assert['vip_assert'])
|
||||
|
||||
;
|
||||
$browser->assertSee(admin_assert['vip_assert']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
|
||||
class LanguageSwitchTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -18,8 +18,7 @@ class LanguageSwitchTest extends DuskTestCase
|
|||
public function testLanguageSwitch()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -35,8 +34,7 @@ class LanguageSwitchTest extends DuskTestCase
|
|||
//切换回中文
|
||||
->click(admin_top['sw_language'])
|
||||
->click(admin_top['ch_language'])
|
||||
->assertSee(admin_assert['ch_assert'])
|
||||
;
|
||||
->assertSee(admin_assert['ch_assert']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,20 @@ namespace Tests\Browser;
|
|||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
|
||||
class Test extends DuskTestCase
|
||||
{
|
||||
|
|
@ -30,8 +27,7 @@ class Test extends DuskTestCase
|
|||
*/
|
||||
public function testAddCusGroup()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
->type(admin_login['login_pwd'], admin_true_login['password'])
|
||||
|
|
@ -44,10 +40,7 @@ class Test extends DuskTestCase
|
|||
->click(order_child['mg_sale_after'])
|
||||
->pause(2000)
|
||||
->click(order_child['ca_sale_after'])
|
||||
->pause(2000)
|
||||
|
||||
|
||||
;
|
||||
->pause(2000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class AlterOrderStationTest extends DuskTestCase
|
||||
{
|
||||
public function testAlterOrderStation()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -63,7 +61,7 @@ class AlterOrderStationTest extends DuskTestCase
|
|||
->press(checkout['submit'])
|
||||
->pause(5000);
|
||||
$elements = $browser->elements(checkout['order_num']);
|
||||
$order_num =$elements[15]->getText();
|
||||
$order_num = $elements[15]->getText();
|
||||
//打印订单号
|
||||
echo $order_num;
|
||||
$browser->click(checkout['view_order'])
|
||||
|
|
@ -72,7 +70,7 @@ class AlterOrderStationTest extends DuskTestCase
|
|||
//点击订单管理按钮
|
||||
$browser->click(admin_top['mg_order'])
|
||||
//搜索框输入刚下单的订单号
|
||||
->type(order_right['search_order'],$order_num)
|
||||
->type(order_right['search_order'], $order_num)
|
||||
//点击搜索按钮
|
||||
->press(order_right['search_bth'])
|
||||
->assertSee($order_num)
|
||||
|
|
@ -93,7 +91,7 @@ class AlterOrderStationTest extends DuskTestCase
|
|||
->refresh()
|
||||
->pause(1000)
|
||||
// 断言是否已支付
|
||||
->assertSeeIn(get_order_status['status_text'],ca_order_status['Paid'])
|
||||
->assertSeeIn(get_order_status['status_text'], ca_order_status['Paid'])
|
||||
//切换到后台,将状态改为已发货
|
||||
->driver->switchTo()->window($browser->driver->getWindowHandles()[0]);
|
||||
$browser->pause(2000)
|
||||
|
|
@ -123,11 +121,9 @@ class AlterOrderStationTest extends DuskTestCase
|
|||
$browser->pause(3000)
|
||||
->refresh()
|
||||
->pause(4000)
|
||||
->assertSeeIn(get_order_status['status_text'],ca_order_status['Shipped'])
|
||||
->assertSeeIn(get_order_status['status_text'], ca_order_status['Shipped'])
|
||||
//切换到后台,修改状态为已完成
|
||||
;
|
||||
|
||||
|
||||
;
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,31 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
|
||||
////前台下单,后台取消
|
||||
class CancelOrderTest extends DuskTestCase
|
||||
{
|
||||
public function testCancelOrder()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -63,7 +60,7 @@ class CancelOrderTest extends DuskTestCase
|
|||
->press(checkout['submit'])
|
||||
->pause(5000);
|
||||
$elements = $browser->elements(checkout['order_num']);
|
||||
$order_num =$elements[15]->getText();
|
||||
$order_num = $elements[15]->getText();
|
||||
//打印订单号
|
||||
echo $order_num;
|
||||
$browser->click(checkout['view_order'])
|
||||
|
|
@ -72,7 +69,7 @@ class CancelOrderTest extends DuskTestCase
|
|||
//点击订单管理按钮
|
||||
$browser->click(admin_top['mg_order'])
|
||||
//搜索框输入刚下单的订单号
|
||||
->type(order_right['search_order'],$order_num)
|
||||
->type(order_right['search_order'], $order_num)
|
||||
//点击搜索按钮
|
||||
->press(order_right['search_bth'])
|
||||
->assertSee($order_num)
|
||||
|
|
@ -93,11 +90,7 @@ class CancelOrderTest extends DuskTestCase
|
|||
->refresh()
|
||||
->pause(5000)
|
||||
// 断言是否已取消
|
||||
->assertSeeIn(get_order_status['status_text'],ca_order_status['Cancelled'])
|
||||
|
||||
;
|
||||
|
||||
|
||||
->assertSeeIn(get_order_status['status_text'], ca_order_status['Cancelled']);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,32 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/systemset_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/systemset_page.php';
|
||||
|
||||
//禁止游客结账
|
||||
class CloseVisiterCheckoutTest extends DuskTestCase
|
||||
{
|
||||
public function testCancelOrder()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -64,12 +61,7 @@ class CloseVisiterCheckoutTest extends DuskTestCase
|
|||
->press(product['product_1'])
|
||||
->pause(5000)
|
||||
//断言:出现登录窗体则通过
|
||||
->assertVisible(iframe['iframe_name'])
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
->assertVisible(iframe['iframe_name']);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,34 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/systemset_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_categories.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_categories_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/systemset_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_categories.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_categories_page.php';
|
||||
//增加商品分类
|
||||
class CreateCategoriesTest extends DuskTestCase
|
||||
{
|
||||
public function testCreateCategories()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -69,13 +66,7 @@ class CreateCategoriesTest extends DuskTestCase
|
|||
->driver->switchTo()->window($browser->driver->getWindowHandles()[1]);
|
||||
$browser->click(index['top_Sports'])
|
||||
->pause(4000)
|
||||
->assertSee(categories_data['ch_name'])
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
->assertSee(categories_data['ch_name']);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,33 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Laravel\Dusk\TestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertEquals;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cus_grounp.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/customer_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cus_grounp.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/customer_page.php';
|
||||
|
||||
///客户组折扣判断
|
||||
class CustomerGroupDiscountTest extends DuskTestCase
|
||||
{
|
||||
public function testCustomerGroupDiscount()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//1.后台登录,设置客户组折扣为30
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -79,10 +74,10 @@ class CustomerGroupDiscountTest extends DuskTestCase
|
|||
$text = $old_product_price->getText();
|
||||
$matches = [];
|
||||
preg_match('/[\d\.]+/', $text, $matches);
|
||||
$new_product_price= $matches[0];
|
||||
$new_product_price = $matches[0];
|
||||
|
||||
// 获取购买商品的数量
|
||||
$old_quantity= $browser->element(checkout['quantity']);
|
||||
$old_quantity = $browser->element(checkout['quantity']);
|
||||
$text = $old_quantity->getText();
|
||||
$matches = [];
|
||||
preg_match('/\d+/', $text, $matches);
|
||||
|
|
@ -118,18 +113,13 @@ class CustomerGroupDiscountTest extends DuskTestCase
|
|||
// echo $new_shipping_fee;
|
||||
// echo $new_customer_discount;
|
||||
// echo $new_order_total;
|
||||
$discunt_price=$new_product_price*$new_quantity*(30/100);
|
||||
$discunt_price = $new_product_price * $new_quantity * (30 / 100);
|
||||
// echo $discunt_price;
|
||||
$true_price=$new_product_price*$new_quantity-$discunt_price+$new_shipping_fee;
|
||||
$browser->assertSeeIn(checkout['customer_discount'],$discunt_price,)
|
||||
->assertSeeIn(checkout['order_total'],$true_price);
|
||||
$true_price = $new_product_price * $new_quantity - $discunt_price + $new_shipping_fee;
|
||||
$browser->assertSeeIn(checkout['customer_discount'], $discunt_price)
|
||||
->assertSeeIn(checkout['order_total'], $true_price);
|
||||
//5.点击确认按钮
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
class DisableProductTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -19,15 +19,12 @@ class DisableProductTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//启用商品
|
||||
|
||||
public function testDisableProduct()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -35,7 +32,7 @@ class DisableProductTest extends DuskTestCase
|
|||
->press(admin_login['login_btn'])
|
||||
->pause(2000)
|
||||
->click(admin_top['mg_product']);
|
||||
$product1_text=$browser->text(products_top['get_name']);
|
||||
$product1_text = $browser->text(products_top['get_name']);
|
||||
echo $product1_text;
|
||||
//编辑商品
|
||||
$browser->press(products_top['edit_product'])
|
||||
|
|
@ -50,10 +47,7 @@ class DisableProductTest extends DuskTestCase
|
|||
->driver->switchTo()->window($browser->driver->getWindowHandles()[1]);
|
||||
//断言是否有下架提示
|
||||
$browser->assertVisible(product_assert['Disable_text'])
|
||||
->pause(3000)
|
||||
|
||||
|
||||
;
|
||||
->pause(3000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
class EnableProductTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -20,15 +20,12 @@ class EnableProductTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//启用商品
|
||||
|
||||
public function testEnableProduct()
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -36,7 +33,7 @@ class EnableProductTest extends DuskTestCase
|
|||
->press(admin_login['login_btn'])
|
||||
->pause(2000)
|
||||
->click(admin_top['mg_product']);
|
||||
$product1_text=$browser->text(products_top['get_name']);
|
||||
$product1_text = $browser->text(products_top['get_name']);
|
||||
echo $product1_text;
|
||||
//编辑商品
|
||||
$browser->press(products_top['edit_product'])
|
||||
|
|
@ -50,10 +47,7 @@ class EnableProductTest extends DuskTestCase
|
|||
->driver->switchTo()->window($browser->driver->getWindowHandles()[1]);
|
||||
//断言页面是否有购买按钮
|
||||
$browser->assertVisible(product['product_1'])
|
||||
->pause(3000)
|
||||
|
||||
|
||||
;
|
||||
->pause(3000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,32 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/systemset_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/systemset_page.php';
|
||||
|
||||
//禁止游客结账
|
||||
class OpenVisiterCheckoutTest extends DuskTestCase
|
||||
{
|
||||
public function testCancelOrder()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -64,12 +61,7 @@ class OpenVisiterCheckoutTest extends DuskTestCase
|
|||
->press(product['product_1'])
|
||||
->pause(5000)
|
||||
//断言:出现登录窗体则通过
|
||||
->assertPathIs(checkout['url'])
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
->assertPathIs(checkout['url']);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,34 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
use App\Http\Controllers\By;
|
||||
use function PHPUnit\Framework\assertNotEquals;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/order_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/admin_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/express.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/product_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/admin/cre_product_page.php');
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/order_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/admin_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/express.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/product_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/admin/cre_product_page.php';
|
||||
|
||||
////库存不足时下单
|
||||
class UnderstockOrderTest extends DuskTestCase
|
||||
{
|
||||
public function testUnderstockOrder()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(admin_login['login_url'])
|
||||
//登录后台
|
||||
->type(admin_login['login_email'], admin_true_login['email'])
|
||||
|
|
@ -42,7 +38,7 @@ class UnderstockOrderTest extends DuskTestCase
|
|||
//修改商品库存为5
|
||||
->click(admin_top['mg_product']);
|
||||
//获取商品名
|
||||
$product1_text=$browser->text(products_top['get_name']);
|
||||
$product1_text = $browser->text(products_top['get_name']);
|
||||
echo $product1_text;
|
||||
//点击编辑商品
|
||||
$browser->press(products_top['edit_product'])
|
||||
|
|
@ -65,10 +61,7 @@ class UnderstockOrderTest extends DuskTestCase
|
|||
->press(product['product_1'])
|
||||
->pause(2000)
|
||||
//断言 understock_assert
|
||||
->assertVisible(product['understock_assert'])
|
||||
;
|
||||
|
||||
|
||||
->assertVisible(product['understock_assert']);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class AddCartTest extends DuskTestCase
|
||||
{
|
||||
public function testAddCart()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
@ -50,8 +49,7 @@ class AddCartTest extends DuskTestCase
|
|||
->click(index_cart['cart_icon'])
|
||||
->pause(10000);
|
||||
//6.断言购物车内商品是否与先前商品相同
|
||||
$browser->assertSeeIn(index_cart['product_text'],$product_description)
|
||||
;
|
||||
$browser->assertSeeIn(index_cart['product_text'], $product_description);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account.php');
|
||||
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class AddressTest extends DuskTestCase
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class CartCheckoutTest extends DuskTestCase
|
||||
{
|
||||
public function testCartCheckout()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
@ -48,9 +47,7 @@ class CartCheckoutTest extends DuskTestCase
|
|||
->press(checkout['submit'])
|
||||
->pause(5000)
|
||||
//9.断言
|
||||
->assertSee(checkout['assert'])
|
||||
|
||||
;
|
||||
->assertSee(checkout['assert']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,在下单时更换支付方式购买
|
||||
class ChangePayMethodTest extends DuskTestCase
|
||||
{
|
||||
public function testChangePayMethod()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/register.php');
|
||||
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/register.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class EditUserInfo extends DuskTestCase
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
|
||||
class LoginTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -17,14 +16,10 @@ class LoginTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testEmailIllegal()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_email'], false_login['illegal_email'])
|
||||
->type(login['login_pwd'], true_login['password'])
|
||||
|
|
@ -32,11 +27,11 @@ class LoginTest extends DuskTestCase
|
|||
->assertSee(false_login['illegal_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景2 email不存在
|
||||
public function testEmailFalse()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_email'], false_login['false_email'])
|
||||
->type(login['login_pwd'], true_login['password'])
|
||||
|
|
@ -44,11 +39,11 @@ class LoginTest extends DuskTestCase
|
|||
->assertSee(false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景3 密码错误
|
||||
public function testPwdFalse()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_email'], true_login['email'])
|
||||
->type(login['login_pwd'], false_login['false_password'])
|
||||
|
|
@ -56,34 +51,33 @@ class LoginTest extends DuskTestCase
|
|||
->assertSee(false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景4 只输入账号
|
||||
public function testOnlyEmail()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_email'], true_login['email'])
|
||||
->press(login['login_btn'])
|
||||
->assertSee(false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景5 只输入密码
|
||||
public function testOnlyPwd()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_pwd'], true_login['email'])
|
||||
->press(login['login_btn'])
|
||||
->assertSee(false_login['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景6 成功登录
|
||||
public function testLoginFul()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
->type(login['login_email'], true_login['email'])
|
||||
->type(login['login_pwd'], true_login['password'])
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class OrderTest extends DuskTestCase
|
||||
{
|
||||
public function testOrder()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/register.php');
|
||||
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/register.php';
|
||||
|
||||
class RegisterFirst extends DuskTestCase
|
||||
{
|
||||
|
|
@ -21,10 +17,8 @@ class RegisterFirst extends DuskTestCase
|
|||
* A basic browser test example.
|
||||
*/
|
||||
|
||||
|
||||
#1.先单独注册一个账号
|
||||
//1.先单独注册一个账号
|
||||
public function testLoginFirst()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -35,8 +29,7 @@ class RegisterFirst extends DuskTestCase
|
|||
->press(register['register_btn'])
|
||||
->pause(6000)
|
||||
->assertSee(true_register['assert'])
|
||||
->pause(2000)
|
||||
;
|
||||
->pause(2000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/register.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/register.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
|
||||
class RegisterTest extends DuskTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* A basic browser test example.
|
||||
*/
|
||||
//场景1 使用已注册过的邮箱注册
|
||||
public function testUsedEmail()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -30,9 +27,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景2 前后密码输入不一致
|
||||
public function testDiffPwd()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -43,9 +40,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景3 邮箱格式不合法
|
||||
public function testIllegalEmail()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -56,9 +53,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景4 邮箱为空
|
||||
public function testNoEmail()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -68,9 +65,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景5 密码为空
|
||||
public function testNoPwd()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -80,9 +77,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景6 第二次密码为空
|
||||
public function testNoRepwd()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -92,9 +89,9 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(false_register['false_assert']);
|
||||
});
|
||||
}
|
||||
|
||||
//场景7 第二次密码为空
|
||||
public function testRegisterFul()
|
||||
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
|
|
@ -106,5 +103,4 @@ class RegisterTest extends DuskTestCase
|
|||
->assertSee(true_register['assert']);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class RemoveCartTest extends DuskTestCase
|
||||
{
|
||||
public function testRemoveCart()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
@ -44,9 +43,8 @@ class RemoveCartTest extends DuskTestCase
|
|||
//7.点击移除按钮
|
||||
->press(index_cart['Delete_btn'])
|
||||
->pause(3000)
|
||||
->assertSeeIn(index_cart['product_num'],"0")
|
||||
->pause(3000)
|
||||
;
|
||||
->assertSeeIn(index_cart['product_num'], '0')
|
||||
->pause(3000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class RemoveWishlistTest extends DuskTestCase
|
||||
{
|
||||
public function testReWishlist()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
@ -49,7 +48,7 @@ class RemoveWishlistTest extends DuskTestCase
|
|||
->pause(3000)
|
||||
//8.断言
|
||||
->assertVisible(Wishlist['no_data'])//no_data
|
||||
;
|
||||
;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace Tests\Browser;
|
|||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
|
||||
class SignOutTest extends DuskTestCase
|
||||
{
|
||||
|
|
@ -16,15 +16,11 @@ class SignOutTest extends DuskTestCase
|
|||
* @return void
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//场景1 email不合法
|
||||
public function testSignOut()
|
||||
|
||||
{
|
||||
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
<?php
|
||||
namespace Tests\Browser;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Http\Controllers\By;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/login_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/account_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/product_1.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/index_page.php');
|
||||
require_once(dirname(__FILE__) . '/../../data/catalog/checkout_page.php');
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/login_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/account_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/product_1.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/index_page.php';
|
||||
require_once dirname(__FILE__) . '/../../data/catalog/checkout_page.php';
|
||||
|
||||
//已注册客户且有地址,直接购买商品
|
||||
class WishlistTest extends DuskTestCase
|
||||
{
|
||||
public function testAddWishlist()
|
||||
{
|
||||
$this->browse(function (Browser $browser)
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit(login['login_url'])
|
||||
//1.用户登录
|
||||
->type(login['login_email'], true_login['email'])
|
||||
|
|
@ -49,8 +48,7 @@ class WishlistTest extends DuskTestCase
|
|||
->click(Wishlist['Check_Details'])
|
||||
->pause(1000)
|
||||
//8.断言
|
||||
->assertUrlIs($ProductUrl,$browser->driver->getCurrentURL())
|
||||
;
|
||||
->assertUrlIs($ProductUrl, $browser->driver->getCurrentURL());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||
use Illuminate\Support\Collection;
|
||||
use Laravel\Dusk\TestCase as BaseTestCase;
|
||||
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
|
|
@ -46,6 +46,7 @@ abstract class DuskTestCase extends BaseTestCase
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function baseUrl()
|
||||
{
|
||||
return 'http://beiketu.test';
|
||||
|
|
|
|||
Loading…
Reference in New Issue