From 3aec43abb7d38e16befb9f5bdd3af7b1e704c994 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 1 Jun 2023 14:12:33 +0800 Subject: [PATCH] Code format --- tests/Browser/Pages/Admin/AddCusGroupTest.php | 1 - tests/Browser/Pages/Admin/AddCustomerTest.php | 7 ++--- tests/Browser/Pages/Admin/AddExpressTest.php | 4 +-- tests/Browser/Pages/Admin/AddProductTest.php | 10 +++---- tests/Browser/Pages/Admin/AdminLoginTest.php | 7 ++--- .../Browser/Pages/Admin/AdminSignOutTest.php | 3 +- .../Pages/Admin/CusEmptyRecycleTest.php | 7 ++--- .../Pages/Admin/CustomerRecycleTest.php | 4 +-- tests/Browser/Pages/Admin/DelCusGroupTest.php | 8 ++---- .../Browser/Pages/Admin/DelCusRecycleTest.php | 5 ++-- tests/Browser/Pages/Admin/DelCustomerTest.php | 6 ++-- tests/Browser/Pages/Admin/DelProductTest.php | 5 ++-- .../Browser/Pages/Admin/EditCusGroupTest.php | 8 ++---- .../Browser/Pages/Admin/EditCustomerTest.php | 8 ++---- tests/Browser/Pages/Admin/EditProductTest.php | 11 ++++---- tests/Browser/Pages/Admin/GoCatalogTest.php | 6 ++-- tests/Browser/Pages/Admin/GoPluginsTest.php | 6 ++-- tests/Browser/Pages/Admin/GoVipTest.php | 4 +-- .../Pages/Admin/LanguageSwitchTest.php | 7 ++--- tests/Browser/Pages/Admin/Test.php | 3 -- .../Pages/Combine/AlterOrderStationTest.php | 13 ++++----- .../Browser/Pages/Combine/CancelOrderTest.php | 15 ++++------ .../Combine/CloseVisiterCheckoutTest.php | 11 +++----- .../Pages/Combine/CreateCategoriesTest.php | 11 +++----- .../Combine/CustomerGroupDiscountTest.php | 20 ++++++------- .../Pages/Combine/DisableProductTest.php | 6 ++-- .../Pages/Combine/EnableProductTest.php | 7 +++-- .../Pages/Combine/OpenVisiterCheckoutTest.php | 8 ++---- .../Pages/Combine/UnderstockOrderTest.php | 12 ++------ tests/Browser/Pages/Front/AddCartTest.php | 4 +-- tests/Browser/Pages/Front/AddressTest.php | 3 +- .../Browser/Pages/Front/CartCheckoutTest.php | 10 +++---- .../Pages/Front/ChangePayMethodTest.php | 11 ++++---- tests/Browser/Pages/Front/EditUserInfo.php | 3 -- tests/Browser/Pages/Front/LoginTest.php | 2 -- tests/Browser/Pages/Front/OrderTest.php | 7 ++--- tests/Browser/Pages/Front/RegisterFirst.php | 4 --- tests/Browser/Pages/Front/RegisterTest.php | 2 -- tests/Browser/Pages/Front/RemoveCartTest.php | 3 +- .../Pages/Front/RemoveWishlistTest.php | 2 +- tests/Browser/Pages/Front/SignOutTest.php | 1 - tests/Browser/Pages/Front/WishlistTest.php | 3 +- tests/Data/Admin/AdminLoginPage.php | 9 ++++-- tests/Data/Admin/AdminOrderPage.php | 12 +++++--- tests/Data/Admin/AdminPage.php | 10 +++---- tests/Data/Admin/ArticlePage.php | 10 +++++-- tests/Data/Admin/CreCategories.php | 7 +++-- tests/Data/Admin/CreCategoriesPage.php | 7 +++-- tests/Data/Admin/CreProduct.php | 10 +++++-- tests/Data/Admin/CreProductPage.php | 9 ++++-- tests/Data/Admin/CusGrounp.php | 9 ++++-- tests/Data/Admin/CustomerData.php | 9 ++++-- tests/Data/Admin/CustomerPage.php | 26 +++++++++++------ tests/Data/Admin/DesignPage.php | 10 +++++-- tests/Data/Admin/Express.php | 7 +++-- tests/Data/Admin/LoginData.php | 10 +++++-- tests/Data/Admin/ProductPage.php | 15 ++++++---- tests/Data/Admin/SystemSetPage.php | 28 +++++++++++-------- tests/Data/Catalog/AccountData.php | 18 +++++++----- tests/Data/Catalog/AccountPage.php | 23 +++++++++------ tests/Data/Catalog/CataLoginData.php | 10 +++++-- tests/Data/Catalog/CheckoutPage.php | 6 ++-- tests/Data/Catalog/IndexPage.php | 18 ++++++++---- tests/Data/Catalog/LoginPage.php | 21 ++++++++------ tests/Data/Catalog/OrderPage.php | 13 ++++++--- tests/Data/Catalog/ProductOne.php | 7 +++-- tests/Data/Catalog/RegisterData.php | 8 ++++-- 67 files changed, 312 insertions(+), 278 deletions(-) diff --git a/tests/Browser/Pages/Admin/AddCusGroupTest.php b/tests/Browser/Pages/Admin/AddCusGroupTest.php index 47a0d19d..d12a21e4 100644 --- a/tests/Browser/Pages/Admin/AddCusGroupTest.php +++ b/tests/Browser/Pages/Admin/AddCusGroupTest.php @@ -10,7 +10,6 @@ use Tests\Data\Admin\CustomerPage; use Tests\Data\Admin\LoginData; use Tests\DuskTestCase; - class AddCusGroupTest extends DuskTestCase { /** diff --git a/tests/Browser/Pages/Admin/AddCustomerTest.php b/tests/Browser/Pages/Admin/AddCustomerTest.php index 0168edbe..357c5352 100644 --- a/tests/Browser/Pages/Admin/AddCustomerTest.php +++ b/tests/Browser/Pages/Admin/AddCustomerTest.php @@ -2,14 +2,13 @@ namespace Tests\Browser\Pages\Admin; -use Beike\Models\Customer; use Laravel\Dusk\Browser; +use Tests\Data\Admin\AdminLoginPage; +use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\CustomerData; use Tests\Data\Admin\CustomerPage; -use Tests\DuskTestCase; -use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\LoginData; -use Tests\Data\Admin\AdminPage; +use Tests\DuskTestCase; class AddCustomerTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/AddExpressTest.php b/tests/Browser/Pages/Admin/AddExpressTest.php index a12be49c..d7c39e98 100644 --- a/tests/Browser/Pages/Admin/AddExpressTest.php +++ b/tests/Browser/Pages/Admin/AddExpressTest.php @@ -3,12 +3,12 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; +use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\Express; +use Tests\Data\Admin\LoginData; use Tests\Data\Admin\SystemSetPage; use Tests\DuskTestCase; -use Tests\Data\Admin\AdminLoginPage; -use Tests\Data\Admin\LoginData; class AddExpressTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/AddProductTest.php b/tests/Browser/Pages/Admin/AddProductTest.php index 6725c67a..6373868d 100644 --- a/tests/Browser/Pages/Admin/AddProductTest.php +++ b/tests/Browser/Pages/Admin/AddProductTest.php @@ -3,13 +3,13 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CreProduct; -use Tests\Data\Admin\CreProductPage; -use Tests\Data\Admin\ProductPage; -use Tests\DuskTestCase; -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; +use Tests\Data\Admin\CreProduct; +use Tests\Data\Admin\CreProductPage; +use Tests\Data\Admin\LoginData; +use Tests\Data\Admin\ProductPage; +use Tests\DuskTestCase; class AddProductTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/AdminLoginTest.php b/tests/Browser/Pages/Admin/AdminLoginTest.php index eda4707b..d4c66692 100644 --- a/tests/Browser/Pages/Admin/AdminLoginTest.php +++ b/tests/Browser/Pages/Admin/AdminLoginTest.php @@ -3,12 +3,9 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\DuskTestCase; - -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\AdminLoginPage; -use Tests\Data\Admin\AdminPage; - +use Tests\Data\Admin\LoginData; +use Tests\DuskTestCase; class AdminLoginTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/AdminSignOutTest.php b/tests/Browser/Pages/Admin/AdminSignOutTest.php index aacf392c..ef52bd5e 100644 --- a/tests/Browser/Pages/Admin/AdminSignOutTest.php +++ b/tests/Browser/Pages/Admin/AdminSignOutTest.php @@ -3,11 +3,10 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\LoginData; - +use Tests\DuskTestCase; class AdminSignOutTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/CusEmptyRecycleTest.php b/tests/Browser/Pages/Admin/CusEmptyRecycleTest.php index c3b61281..cf171518 100644 --- a/tests/Browser/Pages/Admin/CusEmptyRecycleTest.php +++ b/tests/Browser/Pages/Admin/CusEmptyRecycleTest.php @@ -3,12 +3,11 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CustomerPage; -use Tests\DuskTestCase; -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; - +use Tests\Data\Admin\CustomerPage; +use Tests\Data\Admin\LoginData; +use Tests\DuskTestCase; class CusEmptyRecycleTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/CustomerRecycleTest.php b/tests/Browser/Pages/Admin/CustomerRecycleTest.php index 65527052..f71ca116 100644 --- a/tests/Browser/Pages/Admin/CustomerRecycleTest.php +++ b/tests/Browser/Pages/Admin/CustomerRecycleTest.php @@ -3,11 +3,11 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\CustomerPage; +use Tests\Data\Admin\LoginData; +use Tests\DuskTestCase; class CustomerRecycleTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/DelCusGroupTest.php b/tests/Browser/Pages/Admin/DelCusGroupTest.php index 73913e8f..8d606ddd 100644 --- a/tests/Browser/Pages/Admin/DelCusGroupTest.php +++ b/tests/Browser/Pages/Admin/DelCusGroupTest.php @@ -3,13 +3,11 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CustomerPage; -use Tests\DuskTestCase; -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; - - +use Tests\Data\Admin\CustomerPage; +use Tests\Data\Admin\LoginData; +use Tests\DuskTestCase; class DelCusGroupTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/DelCusRecycleTest.php b/tests/Browser/Pages/Admin/DelCusRecycleTest.php index a1afc07a..9962c6cb 100644 --- a/tests/Browser/Pages/Admin/DelCusRecycleTest.php +++ b/tests/Browser/Pages/Admin/DelCusRecycleTest.php @@ -3,12 +3,11 @@ namespace Tests\Browser\Pages\Admin; use Laravel\Dusk\Browser; -use Tests\DuskTestCase; -use Tests\Data\Admin\LoginData; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\CustomerPage; - +use Tests\Data\Admin\LoginData; +use Tests\DuskTestCase; class DelCusRecycleTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Admin/DelCustomerTest.php b/tests/Browser/Pages/Admin/DelCustomerTest.php index acd27d3c..dfe541d7 100644 --- a/tests/Browser/Pages/Admin/DelCustomerTest.php +++ b/tests/Browser/Pages/Admin/DelCustomerTest.php @@ -1,13 +1,13 @@ click(AccountPage::Order['check_btn']) ->pause(3000) - // $browser->click(CheckoutPage::Checkout['view_order']) //进入后台,修改订单状态为已支付 ->driver->switchTo()->window($browser->driver->getWindowHandles()[0]); @@ -96,7 +95,7 @@ class AlterOrderStationTest extends DuskTestCase ->refresh() ->pause(1000) // 断言是否已支付 - ->assertSeeIn(OrderPage::Get_Order_Status['status_text'],OrderPage::Order_Status['Paid']) + ->assertSeeIn(OrderPage::Get_Order_Status['status_text'], OrderPage::Order_Status['Paid']) //切换到后台,将状态改为已发货 ->driver->switchTo()->window($browser->driver->getWindowHandles()[0]); $browser->pause(2000) diff --git a/tests/Browser/Pages/Combine/CancelOrderTest.php b/tests/Browser/Pages/Combine/CancelOrderTest.php index 922aeb08..683476cf 100644 --- a/tests/Browser/Pages/Combine/CancelOrderTest.php +++ b/tests/Browser/Pages/Combine/CancelOrderTest.php @@ -2,22 +2,19 @@ namespace Tests\Browser\Pages\Combine; - -use Tests\Data\Catalog\CataLoginData; -use Tests\Data\Catalog\LoginPage; use Laravel\Dusk\Browser; -use Tests\Data\Catalog\ProductOne; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; +use Tests\Data\Admin\AdminOrderPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\LoginData; use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\IndexPage; +use Tests\Data\Catalog\CataLoginData; use Tests\Data\Catalog\CheckoutPage; -use Tests\Data\Admin\AdminOrderPage; +use Tests\Data\Catalog\IndexPage; +use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\OrderPage; - - +use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; ////前台下单,后台取消 class CancelOrderTest extends DuskTestCase diff --git a/tests/Browser/Pages/Combine/CloseVisiterCheckoutTest.php b/tests/Browser/Pages/Combine/CloseVisiterCheckoutTest.php index 32bdf338..f3bfa309 100644 --- a/tests/Browser/Pages/Combine/CloseVisiterCheckoutTest.php +++ b/tests/Browser/Pages/Combine/CloseVisiterCheckoutTest.php @@ -2,18 +2,15 @@ namespace Tests\Browser\Pages\Combine; - - use Laravel\Dusk\Browser; -use Tests\Data\Admin\SystemSetPage; -use Tests\Data\Catalog\LoginPage; -use Tests\Data\Catalog\ProductOne; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\LoginData; +use Tests\Data\Admin\SystemSetPage; use Tests\Data\Catalog\IndexPage; - +use Tests\Data\Catalog\LoginPage; +use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; //禁止游客结账 class CloseVisiterCheckoutTest extends DuskTestCase diff --git a/tests/Browser/Pages/Combine/CreateCategoriesTest.php b/tests/Browser/Pages/Combine/CreateCategoriesTest.php index 83f4f2cc..bf0ec0c9 100644 --- a/tests/Browser/Pages/Combine/CreateCategoriesTest.php +++ b/tests/Browser/Pages/Combine/CreateCategoriesTest.php @@ -3,17 +3,14 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CreCategories; -use Tests\Data\Admin\CreCategoriesPage; -use Tests\Data\Admin\CreProduct; -use Tests\Data\Admin\CreProductPage; -use Tests\Data\Admin\ProductPage; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; +use Tests\Data\Admin\CreCategories; +use Tests\Data\Admin\CreCategoriesPage; use Tests\Data\Admin\LoginData; +use Tests\Data\Admin\ProductPage; use Tests\Data\Catalog\IndexPage; -use Tests\Data\Catalog\OrderPage; +use Tests\DuskTestCase; //增加商品分类 class CreateCategoriesTest extends DuskTestCase diff --git a/tests/Browser/Pages/Combine/CustomerGroupDiscountTest.php b/tests/Browser/Pages/Combine/CustomerGroupDiscountTest.php index 1b2bf2e4..a06697ea 100644 --- a/tests/Browser/Pages/Combine/CustomerGroupDiscountTest.php +++ b/tests/Browser/Pages/Combine/CustomerGroupDiscountTest.php @@ -3,23 +3,21 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CusGrounp; -use Tests\Data\Admin\CustomerPage; -use Tests\Data\Catalog\CataLoginData; -use Tests\Data\Catalog\ProductOne; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; +use Tests\Data\Admin\CusGrounp; +use Tests\Data\Admin\CustomerPage; use Tests\Data\Admin\LoginData; +use Tests\Data\Catalog\AccountPage; +use Tests\Data\Catalog\CataLoginData; +use Tests\Data\Catalog\CheckoutPage; use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\LoginPage; -use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CheckoutPage; +use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; + ///客户组折扣判断 -class - - -CustomerGroupDiscountTest extends DuskTestCase +class CustomerGroupDiscountTest extends DuskTestCase { public function testCustomerGroupDiscount() { diff --git a/tests/Browser/Pages/Combine/DisableProductTest.php b/tests/Browser/Pages/Combine/DisableProductTest.php index 74080cf3..ee81f71a 100644 --- a/tests/Browser/Pages/Combine/DisableProductTest.php +++ b/tests/Browser/Pages/Combine/DisableProductTest.php @@ -3,12 +3,12 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; -use Tests\Data\Admin\CreProductPage; -use Tests\Data\Admin\ProductPage; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; +use Tests\Data\Admin\CreProductPage; use Tests\Data\Admin\LoginData; +use Tests\Data\Admin\ProductPage; +use Tests\DuskTestCase; class DisableProductTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Combine/EnableProductTest.php b/tests/Browser/Pages/Combine/EnableProductTest.php index a555279f..842bee05 100644 --- a/tests/Browser/Pages/Combine/EnableProductTest.php +++ b/tests/Browser/Pages/Combine/EnableProductTest.php @@ -3,13 +3,14 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; +use Tests\Data\Admin\AdminLoginPage; +use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\CreProductPage; +use Tests\Data\Admin\LoginData; use Tests\Data\Admin\ProductPage; use Tests\Data\Catalog\ProductOne; use Tests\DuskTestCase; -use Tests\Data\Admin\AdminLoginPage; -use Tests\Data\Admin\AdminPage; -use Tests\Data\Admin\LoginData; + class EnableProductTest extends DuskTestCase { /** diff --git a/tests/Browser/Pages/Combine/OpenVisiterCheckoutTest.php b/tests/Browser/Pages/Combine/OpenVisiterCheckoutTest.php index 5b556e0b..e787c0e2 100644 --- a/tests/Browser/Pages/Combine/OpenVisiterCheckoutTest.php +++ b/tests/Browser/Pages/Combine/OpenVisiterCheckoutTest.php @@ -3,16 +3,14 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; -use Tests\Data\Catalog\CheckoutPage; -use Tests\Data\Admin\SystemSetPage; -use Tests\DuskTestCase; use Tests\Data\Admin\AdminLoginPage; use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\LoginData; +use Tests\Data\Admin\SystemSetPage; +use Tests\Data\Catalog\CheckoutPage; use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\ProductOne; - - +use Tests\DuskTestCase; //禁止游客结账 class OpenVisiterCheckoutTest extends DuskTestCase diff --git a/tests/Browser/Pages/Combine/UnderstockOrderTest.php b/tests/Browser/Pages/Combine/UnderstockOrderTest.php index d10be6ec..7e4ecbc2 100644 --- a/tests/Browser/Pages/Combine/UnderstockOrderTest.php +++ b/tests/Browser/Pages/Combine/UnderstockOrderTest.php @@ -3,20 +3,14 @@ namespace Tests\Browser\Pages\Combine; use Laravel\Dusk\Browser; +use Tests\Data\Admin\AdminLoginPage; +use Tests\Data\Admin\AdminPage; use Tests\Data\Admin\CreProduct; use Tests\Data\Admin\CreProductPage; -use Tests\Data\Admin\CusGrounp; -use Tests\Data\Admin\CustomerPage; +use Tests\Data\Admin\LoginData; use Tests\Data\Admin\ProductPage; use Tests\Data\Catalog\ProductOne; use Tests\DuskTestCase; -use Tests\Data\Admin\AdminLoginPage; -use Tests\Data\Admin\AdminPage; -use Tests\Data\Admin\LoginData; -use Tests\Data\Catalog\IndexPage; -use Tests\Data\Catalog\LoginPage; -use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CheckoutPage; ////库存不足时下单 class UnderstockOrderTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/AddCartTest.php b/tests/Browser/Pages/Front/AddCartTest.php index 6c2bebc2..44188124 100644 --- a/tests/Browser/Pages/Front/AddCartTest.php +++ b/tests/Browser/Pages/Front/AddCartTest.php @@ -2,15 +2,13 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; - use Tests\Data\Catalog\AccountPage; use Tests\Data\Catalog\CataLoginData; +use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\ProductOne; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; //已注册客户且有地址,直接购买商品 class AddCartTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/AddressTest.php b/tests/Browser/Pages/Front/AddressTest.php index 30a48b58..26215923 100644 --- a/tests/Browser/Pages/Front/AddressTest.php +++ b/tests/Browser/Pages/Front/AddressTest.php @@ -5,10 +5,9 @@ namespace Tests\Browser\Pages\Front; use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountData; use Tests\Data\Catalog\AccountPage; +use Tests\Data\Catalog\CataLoginData; use Tests\Data\Catalog\LoginPage; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; -use Tests\Data\Catalog\CataLoginData; //已注册客户且有地址,直接购买商品 class AddressTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/CartCheckoutTest.php b/tests/Browser/Pages/Front/CartCheckoutTest.php index 3a056ee2..1b7ae2b3 100644 --- a/tests/Browser/Pages/Front/CartCheckoutTest.php +++ b/tests/Browser/Pages/Front/CartCheckoutTest.php @@ -3,13 +3,13 @@ namespace Tests\Browser\Pages\Front; use Laravel\Dusk\Browser; -use Tests\Data\Catalog\ProductOne; use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CheckoutPage; -use Tests\Data\Catalog\LoginPage; -use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\CataLoginData; +use Tests\Data\Catalog\CheckoutPage; +use Tests\Data\Catalog\IndexPage; +use Tests\Data\Catalog\LoginPage; +use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; //已注册客户且有地址,直接购买商品 class CartCheckoutTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/ChangePayMethodTest.php b/tests/Browser/Pages/Front/ChangePayMethodTest.php index 5bdbdcaa..f380c230 100644 --- a/tests/Browser/Pages/Front/ChangePayMethodTest.php +++ b/tests/Browser/Pages/Front/ChangePayMethodTest.php @@ -3,14 +3,13 @@ namespace Tests\Browser\Pages\Front; use Laravel\Dusk\Browser; -use Tests\Data\Catalog\ProductOne; use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CheckoutPage; -use Tests\Data\Catalog\LoginPage; -use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\CataLoginData; - +use Tests\Data\Catalog\CheckoutPage; +use Tests\Data\Catalog\IndexPage; +use Tests\Data\Catalog\LoginPage; +use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; //已注册客户且有地址,在下单时更换支付方式购买 class ChangePayMethodTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/EditUserInfo.php b/tests/Browser/Pages/Front/EditUserInfo.php index adabc290..50884dcb 100644 --- a/tests/Browser/Pages/Front/EditUserInfo.php +++ b/tests/Browser/Pages/Front/EditUserInfo.php @@ -2,15 +2,12 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountData; use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CataLoginData; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\RegisterData; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; //已注册客户且有地址,直接购买商品 class EditUserInfo extends DuskTestCase diff --git a/tests/Browser/Pages/Front/LoginTest.php b/tests/Browser/Pages/Front/LoginTest.php index a48d0ba1..4136e4f1 100644 --- a/tests/Browser/Pages/Front/LoginTest.php +++ b/tests/Browser/Pages/Front/LoginTest.php @@ -2,13 +2,11 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountPage; use Tests\Data\Catalog\CataLoginData; use Tests\Data\Catalog\LoginPage; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; class LoginTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Front/OrderTest.php b/tests/Browser/Pages/Front/OrderTest.php index d1ec3c6d..de43934d 100644 --- a/tests/Browser/Pages/Front/OrderTest.php +++ b/tests/Browser/Pages/Front/OrderTest.php @@ -2,15 +2,14 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountPage; -use Tests\Data\Catalog\CheckoutPage; use Tests\Data\Catalog\CataLoginData; -use Tests\Data\Catalog\LoginPage; -use Tests\DuskTestCase; +use Tests\Data\Catalog\CheckoutPage; use Tests\Data\Catalog\IndexPage; +use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\ProductOne; +use Tests\DuskTestCase; //已注册客户且有地址,直接购买商品 class OrderTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/RegisterFirst.php b/tests/Browser/Pages/Front/RegisterFirst.php index cdd9b0cd..5a209773 100644 --- a/tests/Browser/Pages/Front/RegisterFirst.php +++ b/tests/Browser/Pages/Front/RegisterFirst.php @@ -2,14 +2,10 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\RegisterData; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; - - class RegisterFirst extends DuskTestCase { diff --git a/tests/Browser/Pages/Front/RegisterTest.php b/tests/Browser/Pages/Front/RegisterTest.php index 235487e5..267916c9 100644 --- a/tests/Browser/Pages/Front/RegisterTest.php +++ b/tests/Browser/Pages/Front/RegisterTest.php @@ -6,8 +6,6 @@ use Laravel\Dusk\Browser; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\RegisterData; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; - class RegisterTest extends DuskTestCase { diff --git a/tests/Browser/Pages/Front/RemoveCartTest.php b/tests/Browser/Pages/Front/RemoveCartTest.php index 4050c8bf..cf9c9562 100644 --- a/tests/Browser/Pages/Front/RemoveCartTest.php +++ b/tests/Browser/Pages/Front/RemoveCartTest.php @@ -2,14 +2,13 @@ namespace Tests\Browser\Pages\Front; - use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountPage; use Tests\Data\Catalog\CataLoginData; +use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\ProductOne; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; //已注册客户且有地址,直接购买商品 class RemoveCartTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/RemoveWishlistTest.php b/tests/Browser/Pages/Front/RemoveWishlistTest.php index ac4cb66a..1e66ac9c 100644 --- a/tests/Browser/Pages/Front/RemoveWishlistTest.php +++ b/tests/Browser/Pages/Front/RemoveWishlistTest.php @@ -5,10 +5,10 @@ namespace Tests\Browser\Pages\Front; use Laravel\Dusk\Browser; use Tests\Data\Catalog\AccountPage; use Tests\Data\Catalog\CataLoginData; +use Tests\Data\Catalog\IndexPage; use Tests\Data\Catalog\LoginPage; use Tests\Data\Catalog\ProductOne; use Tests\DuskTestCase; -use Tests\Data\Catalog\IndexPage; //已注册客户且有地址,直接购买商品 class RemoveWishlistTest extends DuskTestCase diff --git a/tests/Browser/Pages/Front/SignOutTest.php b/tests/Browser/Pages/Front/SignOutTest.php index 852ce4bd..4d385108 100644 --- a/tests/Browser/Pages/Front/SignOutTest.php +++ b/tests/Browser/Pages/Front/SignOutTest.php @@ -14,7 +14,6 @@ class SignOutTest extends DuskTestCase * A basic browser test example. * @return void */ - public function testSignOut() { diff --git a/tests/Browser/Pages/Front/WishlistTest.php b/tests/Browser/Pages/Front/WishlistTest.php index ccb258c7..eaab6559 100644 --- a/tests/Browser/Pages/Front/WishlistTest.php +++ b/tests/Browser/Pages/Front/WishlistTest.php @@ -1,13 +1,14 @@ '/admin/login', 'tltle' => '登录到 BeikeShop 后台', - 'login_email' => "#email-input", + 'login_email' => '#email-input', 'login_pwd' => '#password-input', 'login_btn' => '.btn.btn-lg.btn-primary', //登录按钮 ]; diff --git a/tests/Data/Admin/AdminOrderPage.php b/tests/Data/Admin/AdminOrderPage.php index 7ec0e9e9..5dcd6744 100644 --- a/tests/Data/Admin/AdminOrderPage.php +++ b/tests/Data/Admin/AdminOrderPage.php @@ -1,19 +1,23 @@ '/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 Child= [ + +public const 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)', //售后原因 ]; -const Details = [//订单详情页 + +public const 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)', //已支付 diff --git a/tests/Data/Admin/AdminPage.php b/tests/Data/Admin/AdminPage.php index a51f137e..9d35f588 100644 --- a/tests/Data/Admin/AdminPage.php +++ b/tests/Data/Admin/AdminPage.php @@ -1,9 +1,10 @@ '/admin', 'root' => '.ml-2', 'mg_index' => '.list-unstyled.navbar-nav li:nth-child(1)', //管理首页 .list-unstyled.navbar-nav @@ -26,11 +27,10 @@ class AdminPage { 'ch_language' => '.dropdown-menu.dropdown-menu-end.show li:nth-child(10)', //切换中文 ]; - const Assert = [ + public const Assert = [ 'vip_assert' => '登录购买VIP服务', 'plugins_assert' => '/admin/marketing', 'en_assert' => 'Admin Panel', //切换为中文断言 'ch_assert' => '后台管理', //切换为英文断言 ]; } - diff --git a/tests/Data/Admin/ArticlePage.php b/tests/Data/Admin/ArticlePage.php index d07d8899..6789608d 100644 --- a/tests/Data/Admin/ArticlePage.php +++ b/tests/Data/Admin/ArticlePage.php @@ -1,12 +1,16 @@ '/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 Common = [ + +public const 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', //删除按钮 diff --git a/tests/Data/Admin/CreCategories.php b/tests/Data/Admin/CreCategories.php index 78771f1d..850d154e 100644 --- a/tests/Data/Admin/CreCategories.php +++ b/tests/Data/Admin/CreCategories.php @@ -1,7 +1,10 @@ 'categories_test', 'en_name' => 'categories_test', 'ch_content' => 'categories_content_test', diff --git a/tests/Data/Admin/CreCategoriesPage.php b/tests/Data/Admin/CreCategoriesPage.php index 82024dce..0dc1024b 100644 --- a/tests/Data/Admin/CreCategoriesPage.php +++ b/tests/Data/Admin/CreCategoriesPage.php @@ -1,7 +1,10 @@ 'descriptions[zh_cn][name]', 'en_name' => 'descriptions[en][name]', 'ch_content' => 'descriptions[zh_cn][content]', diff --git a/tests/Data/Admin/CreProduct.php b/tests/Data/Admin/CreProduct.php index b655cddc..cc782717 100644 --- a/tests/Data/Admin/CreProduct.php +++ b/tests/Data/Admin/CreProduct.php @@ -1,7 +1,10 @@ 'test', //中文名称 'en_name' => 'test', //英文名称 'sku' => '123', //sku @@ -10,7 +13,8 @@ const Puoduct_Info = [ 'cost_price' => '5', //成本价 'quantity' => '3', //数量 ]; -const Alter = [ + +public const Alter = [ 'ch_name' => 'alter_test', //中文名称 'en_name' => 'alter_test', //英文名称 'sku' => '456', //sku diff --git a/tests/Data/Admin/CreProductPage.php b/tests/Data/Admin/CreProductPage.php index 3c3d5ccf..94578117 100644 --- a/tests/Data/Admin/CreProductPage.php +++ b/tests/Data/Admin/CreProductPage.php @@ -1,8 +1,10 @@ '/Admin/products/create', // 'ch_name' => 'descriptions[zh_cn][name]', //中文名称 'en_name' => 'descriptions[en][name]', //英文名称 @@ -15,7 +17,8 @@ const Product_Top = [ 'Disable' => '#active-0', 'save_btn' => '.btn.btn-lg.btn-primary.submit-form', //保存 ]; -const Product_Assert = [ + +public const Product_Assert = [ 'Disable_text' => '.text-danger', //商品禁用后显示的文本class ]; } diff --git a/tests/Data/Admin/CusGrounp.php b/tests/Data/Admin/CusGrounp.php index 927d4a93..14158881 100644 --- a/tests/Data/Admin/CusGrounp.php +++ b/tests/Data/Admin/CusGrounp.php @@ -1,15 +1,18 @@ '钻石组', 'en_group_name' => '钻石组', 'ch_description' => '钻石组', 'en_description' => '钻石组', 'discount' => '20', ]; -const Alter_Group_Info = [ + +public const Alter_Group_Info = [ 'ch_group_name' => '钻石组alter', 'en_group_name' => '钻石组alter', 'ch_description' => '钻石组alter', diff --git a/tests/Data/Admin/CustomerData.php b/tests/Data/Admin/CustomerData.php index 09437dc7..7b9802bb 100644 --- a/tests/Data/Admin/CustomerData.php +++ b/tests/Data/Admin/CustomerData.php @@ -1,15 +1,18 @@ 'Admin', 'email' => 'Admin@163.com', 'pwd' => '123456', 'customer_group' => '', ]; -const Customer_Info_Alter = [ + +public const Customer_Info_Alter = [ 'name' => 'test1', 'email' => 'test1@163.com', 'pwd' => '1234567', diff --git a/tests/Data/Admin/CustomerPage.php b/tests/Data/Admin/CustomerPage.php index d6078482..bf6a2a92 100644 --- a/tests/Data/Admin/CustomerPage.php +++ b/tests/Data/Admin/CustomerPage.php @@ -1,14 +1,17 @@ '/Admin/customers', +class CustomerPage +{ +public const Left = [ + 'url' => '/Admin/customers', '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 Create = [ + +public const Create = [ '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', @@ -16,7 +19,8 @@ const Create = [ '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 = [ + +public const Alter = [ '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', @@ -25,7 +29,8 @@ const Alter = [ 'save_btn' => '#pane-customer > div > div:nth-child(6) > div > button', ]; -const Group_list = [ + +public const Group_list = [ //创建客户 'cre_customer' => '#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button', //编辑客户 @@ -36,7 +41,8 @@ const Group_list = [ 'sure_btn' => '确定', ]; -const Customer_Group = [ + +public const Customer_Group = [ //创建客户组 'cre_cus_group' => '#customer-app > div.card-body > div.d-flex.justify-content-between.mb-4 > button', //编辑客户组 @@ -47,7 +53,8 @@ const Customer_Group = [ 'sure_btn' => '确定', ]; -const Create_Group = [ + +public const Create_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', @@ -55,7 +62,8 @@ const Create_Group = [ '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 = [ + +public 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', //删除按钮 diff --git a/tests/Data/Admin/DesignPage.php b/tests/Data/Admin/DesignPage.php index 7df797d9..1ba38d15 100644 --- a/tests/Data/Admin/DesignPage.php +++ b/tests/Data/Admin/DesignPage.php @@ -1,14 +1,18 @@ '/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 = [ + +public 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', //删除按钮 diff --git a/tests/Data/Admin/Express.php b/tests/Data/Admin/Express.php index 2fb55c5f..aef304dd 100644 --- a/tests/Data/Admin/Express.php +++ b/tests/Data/Admin/Express.php @@ -1,7 +1,10 @@ '顺风快递', 'express_code' => '11011', 'order_number' => '110120188', diff --git a/tests/Data/Admin/LoginData.php b/tests/Data/Admin/LoginData.php index 52317f55..b650a55f 100644 --- a/tests/Data/Admin/LoginData.php +++ b/tests/Data/Admin/LoginData.php @@ -1,13 +1,17 @@ 'root@guangda.work', 'password' => '123456', 'assert' => '后台管理', ]; -const False_Data = [ + +public const False_Data = [ 'false_email' => 'test1@163.com', 'illegal_email' => 'test', 'false_password' => '1234567', diff --git a/tests/Data/Admin/ProductPage.php b/tests/Data/Admin/ProductPage.php index e4c8b592..994039d8 100644 --- a/tests/Data/Admin/ProductPage.php +++ b/tests/Data/Admin/ProductPage.php @@ -1,8 +1,10 @@ '/Admin/products', 'create_product' => '#product-app > div > div > div.d-flex.justify-content-between.my-4 > a > button', //创建商品按钮 //编辑商品按钮 @@ -12,7 +14,8 @@ const Product_Top = [ 'sure_btn' => '确定', 'get_name' => '#product-app > div > div > div.table-push > table > tbody > tr:nth-child(1) > td:nth-child(4) > a', ]; -const Product_Left = [ + +public const Product_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)', //商品分类 @@ -22,11 +25,13 @@ const Product_Left = [ '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 Cre_class = [ + +public const Cre_class = [ 'cre_cate_btn' => '#category-app > div > a', //创建分类按钮 ]; -const Assert = [ + +public const Assert = [ 'cre_ful_assert' => '创建成功!', 'alter_ful_assert' => '更新成功!', 'del_ful_assert' => '删除成功!', diff --git a/tests/Data/Admin/SystemSetPage.php b/tests/Data/Admin/SystemSetPage.php index b8fb2b68..7a6b4e97 100644 --- a/tests/Data/Admin/SystemSetPage.php +++ b/tests/Data/Admin/SystemSetPage.php @@ -1,25 +1,28 @@ '.btn.btn-lg.btn-primary.submit-form', //保存按钮 ]; -const System_Left = [ +public 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)', //区域分组 'ta - x_rate_set' => '.list-unstyled.navbar-nav:nth-child(2) li:nth-child(5)', //税率设置 + x_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= [ + +public 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)', //结账设置 @@ -30,17 +33,18 @@ const System_Set= [ 'close_visitor_checkout' => '#tab-checkout > div:nth-child(1) > div > div > div:nth-child(2) > label', //游客结账 禁用 'open_visitor_checkout' => '#guest_checkout-1', //游客结账 启用 ]; -const System_Express +public const System_Express = [ //快递公司 - '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 Assert = [ //断言信息 + ]; + +public const Assert = [ //断言信息 'assert_ful' => '更新成功!', ]; } diff --git a/tests/Data/Catalog/AccountData.php b/tests/Data/Catalog/AccountData.php index 5fa907b1..babb53e9 100644 --- a/tests/Data/Catalog/AccountData.php +++ b/tests/Data/Catalog/AccountData.php @@ -1,14 +1,18 @@ 'test', //add_name + +class AccountData +{ +public const Add_Address = [ + 'add_name' => 'test', //add_name 'add_province' => 'v11012010086', //选择国家 - 'add_code' => '643203', //add_code - 'add_address1' => 'test1', //add_address1 - 'add_address2' => 'test2', //add_address2 + 'add_code' => '643203', //add_code + 'add_address1' => 'test1', //add_address1 + 'add_address2' => 'test2', //add_address2 ]; -const User_Edit = [ + +public const User_Edit = [ 'upload_images' => '/../../data/Images/Headpicture/Headpicture.jpeg', //上传头像 'user_name' => 'Admin', //修改名字 'user_email' => 'Admin@163.com', //修改emial diff --git a/tests/Data/Catalog/AccountPage.php b/tests/Data/Catalog/AccountPage.php index e032d86a..2bfe17c2 100644 --- a/tests/Data/Catalog/AccountPage.php +++ b/tests/Data/Catalog/AccountPage.php @@ -1,7 +1,10 @@ '/account', 'go_index' => '.logo', //beikeshop图标 'go_account' => '.list-group-item.d-flex.justify-content-between.align-items-center:nth-child(1)', // @@ -12,7 +15,8 @@ const Account = [ '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 = [ + +public 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 @@ -21,7 +25,7 @@ const Address = [ 'add_address' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(2) > 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 - //#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input + //#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > div > div > input 'add_address1' => '#address-app > div:nth-child(2) > div > div > div.el-dialog__body > form > div:nth-child(3) > 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 @@ -29,7 +33,8 @@ const Address = [ 'assert' => 'Default', //addresses ]; -const Edit = [ + +public 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', @@ -38,10 +43,12 @@ const Edit = [ 'Submit' => '.btn.btn-primary.mt-sm-0', //add_phone 'assert' => 'Modify Success!', ]; -const Order=[ - 'check_btn'=>'.btn.btn-outline-secondary.btn-sm'//order页面第一个订单的查看详情按钮 + +public const Order = [ + 'check_btn' => '.btn.btn-outline-secondary.btn-sm', //order页面第一个订单的查看详情按钮 ]; -const Wishlist = [ + +public const Wishlist = [ 'login_url' => '/account/edit', 'go_Wishlist' => 'Wishlist', //点击Wishlist 'Check_Details' => '.btn.btn-outline-secondary.btn-sm', //查看详情按钮 diff --git a/tests/Data/Catalog/CataLoginData.php b/tests/Data/Catalog/CataLoginData.php index 583a6c16..50112b4e 100644 --- a/tests/Data/Catalog/CataLoginData.php +++ b/tests/Data/Catalog/CataLoginData.php @@ -1,12 +1,16 @@ 'test@163.com', 'password' => '123456', 'assert' => 'Sign Out', ]; -const False_Login = [ + +public const False_Login = [ 'false_email' => 'test1@163.com', 'illegal_email' => 'test', 'false_password' => '1234567', diff --git a/tests/Data/Catalog/CheckoutPage.php b/tests/Data/Catalog/CheckoutPage.php index 76c14bc6..74983d1c 100644 --- a/tests/Data/Catalog/CheckoutPage.php +++ b/tests/Data/Catalog/CheckoutPage.php @@ -1,8 +1,10 @@ '/checkout', // 'submit' => '#submit-checkout', //提交按钮 //订单成功验证信息 diff --git a/tests/Data/Catalog/IndexPage.php b/tests/Data/Catalog/IndexPage.php index 49287432..28350c48 100644 --- a/tests/Data/Catalog/IndexPage.php +++ b/tests/Data/Catalog/IndexPage.php @@ -1,7 +1,10 @@ '/', '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', //购买按钮 @@ -15,7 +18,8 @@ const Index = [ 'top_Brand' => '.navbar-nav.mx-auto li:nth-child(5)', 'top_Latest_Products' => '.navbar-nav.mx-auto li:nth-child(6)', ]; -const Index_Top = [ + +public const Index_Top = [ // "wishlist_btn" => "",//收藏商品图标 'wishlist_btn' => '.navbar-nav.flex-row li:nth-child(2)', //收藏商品图标 @@ -24,7 +28,8 @@ const Index_Top = [ 'login_text' => 'Home', ]; -const Index_Cart = [ + +public 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', //购物车内商品名字 @@ -33,10 +38,11 @@ const Index_Cart = [ 'cart_Checkout' => '#offcanvas-right-cart > div.offcanvas-footer > div.p-4 > a.btn.w-100.fw-bold.btn-dark.to-checkout', ]; - const Index_Account = [ + public const Index_Account = [ 'login_icon' => '.navbar-nav.flex-row li:nth-child(3)', //登录图标 ]; -const Index_Login = [ + +public const Index_Login = [ 'login_icon' => '.navbar-nav.flex-row li:nth-child(3)', //登录图标 ]; } diff --git a/tests/Data/Catalog/LoginPage.php b/tests/Data/Catalog/LoginPage.php index 482bcdf2..be118636 100644 --- a/tests/Data/Catalog/LoginPage.php +++ b/tests/Data/Catalog/LoginPage.php @@ -1,26 +1,29 @@ '/login', // #page-login > div.login-wrap > div:nth-child(1) > form > div.card-body.px-md-2 > div:nth-child(1) > div > div > input '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_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 = [ + + public const Register = [ // #page-login > div.login-wrap > div:nth-child(3) > div.card-body.px-md-2 > form > div:nth-child(1) > div > div > input - '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_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_btn' => 'Register', 'register_text' => 'Home', ]; - const Iframe = [ + + public const Iframe = [ 'iframe_name' => '#layui-layer-iframe1', ]; } diff --git a/tests/Data/Catalog/OrderPage.php b/tests/Data/Catalog/OrderPage.php index 65b2c4e6..b31d89cb 100644 --- a/tests/Data/Catalog/OrderPage.php +++ b/tests/Data/Catalog/OrderPage.php @@ -1,21 +1,26 @@ '/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 Order_Status = [ + +public const Order_Status = [ 'Unpaid' => 'Unpaid', //待支付 'Paid' => 'Paid', //已支付 'Shipped' => 'Shipped', //已发货 'Completed' => 'Completed', //已完成 Cancelled 'Cancelled' => 'Cancelled', //已完成 Cancelled ]; -const Get_Order_Status = [ + +public const Get_Order_Status = [ 'status_text' => '.table.table-borderless.mb-0 tbody tr:first-child td:nth-child(3)', //获取当前状态 ]; } diff --git a/tests/Data/Catalog/ProductOne.php b/tests/Data/Catalog/ProductOne.php index 68d2d1fd..5cd06385 100644 --- a/tests/Data/Catalog/ProductOne.php +++ b/tests/Data/Catalog/ProductOne.php @@ -1,7 +1,10 @@ '/products/1', 'product_1' => '.btn.btn-dark.ms-3.fw-bold', //购买商品 'Wishlist_icon' => '.btn.btn-link.ps-0.text-secondary', //收藏 diff --git a/tests/Data/Catalog/RegisterData.php b/tests/Data/Catalog/RegisterData.php index abef355f..f275af11 100644 --- a/tests/Data/Catalog/RegisterData.php +++ b/tests/Data/Catalog/RegisterData.php @@ -1,14 +1,16 @@ 'test2@163.com', 'password' => '123456', 'assert' => 'Sign Out', ]; -const False_Register = [ +public const False_Register = [ 'exist_email' => 'test@163.com', //已注册的email 'illegal_email' => 'test', 'false_password' => '1234567',