Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21eaed3
Prevent logout flow being triggert when incorrect credentials are used
indykoning Oct 20, 2025
28f4af3
Apply fixes from Prettier
indykoning Oct 20, 2025
89d1cb8
Make catch async
indykoning Oct 20, 2025
718a061
Fix error notification message on session expiry
indykoning Oct 20, 2025
1d9758a
Added test
indykoning Nov 18, 2025
690eef4
Merge branch '4.x' of github.com:rapidez/core into bugfix/logout-on-f…
indykoning Nov 18, 2025
e26c288
Apply fixes from Prettier
indykoning Nov 18, 2025
21df82a
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Dec 12, 2025
559faaa
[CI] Update Snapshots
indykoning Dec 12, 2025
c87a1fb
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Jan 23, 2026
33b7333
[CI] Update Snapshots
indykoning Jan 23, 2026
05eb6d6
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Feb 11, 2026
38aa926
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Apr 7, 2026
7310944
[CI] Update Snapshots
indykoning Apr 7, 2026
f354eb4
Reset screenshots
indykoning Apr 13, 2026
96d57d2
Merge branch '4.x' of github.com:rapidez/core into bugfix/logout-on-f…
indykoning Apr 13, 2026
e978302
Moved screenshot to class variable
indykoning Apr 13, 2026
caa918c
Reset screenshots
indykoning Apr 13, 2026
1c6e982
Apply fixes from Prettier
indykoning Apr 13, 2026
f73c6a7
Raised phpstan memory limit
indykoning Apr 13, 2026
1f7a53f
Merge branch 'bugfix/logout-on-failed-login' of github.com:rapidez/co…
indykoning Apr 13, 2026
91afbcb
[CI] Update Snapshots
indykoning Apr 13, 2026
2e52b4b
Add wait for network idle before filling email
indykoning Apr 13, 2026
b94c714
Ignore whitespace on text assertion
indykoning Apr 13, 2026
6ff7637
Apply fixes from Prettier
indykoning Apr 13, 2026
ad3b69a
Utilise toContainText
indykoning Apr 13, 2026
2ce7708
Apply fixes from Prettier
indykoning Apr 13, 2026
d180526
[CI] Update Snapshots
indykoning Apr 13, 2026
4e6639d
Fixed memory limit
indykoning Apr 13, 2026
146e201
Merge branch 'bugfix/logout-on-failed-login' of github.com:rapidez/co…
indykoning Apr 13, 2026
d268d3a
Reset phpstan memory limit
indykoning Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
"rapidez/reviews": "<4.1"
},
"scripts": {
"analyse": "phpstan --memory-limit=256M"
"analyse": "phpstan --memory-limit=512M"
}
}
11 changes: 10 additions & 1 deletion resources/js/components/Checkout/CheckoutLogin.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import { SessionExpired } from '../../fetch'
import { cart, setGuestEmailOnCart } from '../../stores/useCart'
import { isEmailAvailable, login, register, user } from '../../stores/useUser'
import { useDebounceFn } from '@vueuse/core'
Expand Down Expand Up @@ -70,7 +71,15 @@ export default {
async handleLogin() {
return await login(this.email, this.password)
.then(() => true)
.catch((error) => {
.catch(async (error) => {
if (error instanceof SessionExpired) {
let data = await error.response.json()
if (data?.errors?.[0]?.message) {
Notify(data.errors[0].message, 'error')
return false
}
}

if (error.message) {
Notify(error.message, 'error')
}
Expand Down
1 change: 1 addition & 0 deletions resources/js/stores/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const login = async function (email, password) {
},
{
notifyOnError: false,
redirectOnExpiration: false,
},
).then(async (response) => {
await loginByToken(response.data.generateCustomerToken.token)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/notifications.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<notifications v-cloak>
<div class="fixed sm:max-w-sm sm:w-full top-6 right-6 left-6 sm:left-auto flex flex-col z-notifications" slot-scope="{ notifications }">
<div class="fixed sm:max-w-sm sm:w-full top-6 right-6 left-6 sm:left-auto flex flex-col z-notifications" data-testid="notifications" slot-scope="{ notifications }">
<notification v-if="notifications.length" v-for="(notification, index) in notifications" :notification="notification" :key="index +1">
<transition
enter-active-class="ease-in-out duration-500"
Expand Down
50 changes: 40 additions & 10 deletions tests/playwright/checkout.spec.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,71 @@
import { test, expect } from '@playwright/test'
import { BasePage } from './pages/BasePage'
import { ProductPage } from './pages/ProductPage'
import { CheckoutPage } from './pages/CheckoutPage'
import { CheckoutPage, screenshot_login, screenshot_credentials, screenshot_payment, screenshot_success } from './pages/CheckoutPage'
import { AccountPage } from './pages/AccountPage'

const checkoutTypes = ['default', 'onestep']

checkoutTypes.forEach((type) => {
test(type + ' - as guest', BasePage.tags, async ({ page }) => {
const productPage = new ProductPage(page)
const checkoutPage = new CheckoutPage(page, type)
const checkoutPage = new CheckoutPage(page, type, [
screenshot_login,
screenshot_credentials,
screenshot_payment,
screenshot_success,
])

await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.checkout(`wayne+${crypto.randomUUID()}@enterprises.com`, false, false, [
'login',
'credentials',
'payment',
'success',
])
await checkoutPage.checkout(`wayne+${crypto.randomUUID()}@enterprises.com`, false, false)
})

test(type + ' - as user', BasePage.tags, async ({ page }) => {
const productPage = new ProductPage(page)
const checkoutPage = new CheckoutPage(page, type)
const checkoutPage = new CheckoutPage(page, type, [screenshot_login, screenshot_credentials])
const accountPage = new AccountPage(page)

const email = `wayne+${crypto.randomUUID()}@enterprises.com`
const password = 'IronManSucks.91939'

// Register
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.checkout(email, password, true, ['credentials'])
await checkoutPage.checkout(email, password, true)

await accountPage.logout()

checkoutPage.screenshots = []
// Login
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.checkout(email, password)
})
})

test('incorrect password login', BasePage.tags, async ({ page }) => {
const productPage = new ProductPage(page)
const checkoutPage = new CheckoutPage(page, 'default', [screenshot_credentials])
const accountPage = new AccountPage(page)

const email = `wayne+${crypto.randomUUID()}@enterprises.com`
const password = 'IronManSucks.91939'

// Register
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.checkout(email, password, true)

await accountPage.logout()

checkoutPage.screenshots = []
// Login
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.gotoCheckout()
await checkoutPage.login(email, password + '!')
await page.getByTestId('continue').click()
await page.waitForTimeout(500)
await page.waitForLoadState('networkidle')
await expect(page.getByTestId('notifications')).toContainText(
'The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.',
)

await checkoutPage.checkout(email, password)
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading