fixed product card image not found issue
This commit is contained in:
parent
adbc5c9999
commit
d2a5768ba6
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div class="product-image">
|
||||
<a href="{{ route('shop.products.index', $product->url_key) }}" title="{{ $product->name }}">
|
||||
<img src="{{ $productBaseImage['medium_image_url'] }}" />
|
||||
<img src="{{ $productBaseImage['medium_image_url'] }}" onerror="this.src='{{ asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.png') }}'"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Tests\DuskTestCase;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
|
||||
class GuestShopTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic browser test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGuestAddToCart()
|
||||
{
|
||||
$categories = app('Webkul\Category\Repositories\CategoryRepository')->all();
|
||||
$products = app('Webkul\Product\Repositories\ProductRepository')->all();
|
||||
|
||||
$slugs = array();
|
||||
|
||||
foreach ($categories as $category) {
|
||||
if ($category->slug != 'root') {
|
||||
array_push($slugs, $category->slug);
|
||||
}
|
||||
}
|
||||
|
||||
$slugIndex = array_rand($slugs);
|
||||
$testSlug = $slugs[$slugIndex];
|
||||
$testProduct = array();
|
||||
dd($testSlug);
|
||||
foreach ($products as $product) {
|
||||
$categories = $product->categories;
|
||||
|
||||
if ($categories->last()->slug == $testSlug) {
|
||||
array_push($testProduct, $product);
|
||||
}
|
||||
}
|
||||
|
||||
$this->browse(function (Browser $browser) use($testSlug,$product) {
|
||||
$browser->visit(route('shop.categories.index', $testSlug));
|
||||
$browser->assertSeeLink($linkText);
|
||||
$browser->pause(4000);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue