@@ -153,7 +155,8 @@ const { t } = useI18n();
@@ -163,8 +166,7 @@ const { t } = useI18n();
@@ -175,7 +177,6 @@ const { t } = useI18n();
outline
:label="currency(item.price)"
color="accent"
- text-color="black"
class="col-3 justify-end text-body2"
>
diff --git a/src/pages/Ecomerce/CatalogView.vue b/src/pages/Ecomerce/CatalogView.vue
index 90ede5a3..92a63858 100644
--- a/src/pages/Ecomerce/CatalogView.vue
+++ b/src/pages/Ecomerce/CatalogView.vue
@@ -1,7 +1,14 @@
-
+ {
+ items = [];
+ search = '';
+ }
+ "
+ />
{{ t('shoppingCart') }}
@@ -36,7 +43,7 @@
/>
-
+
@@ -54,7 +61,10 @@
rounded
no-caps
@click="redirectToCheckout()"
- data-testid="orderModifyButton"
+ data-cy="orderModifyButton"
+ color="light-green-7"
+ unelevated
+ text-color="white"
>
{{ t('modify') }}
@@ -80,7 +90,7 @@
:class="{ active: category == cat.id }"
:key="cat.id"
@click="selectedCategory = cat.id"
- data-testid="catalogCategoryButton"
+ data-cy="catalogCategoryButton"
>
{{ cat.name }}
@@ -98,7 +108,7 @@
:options="itemFamilies"
:disable="!category"
:label="t('family')"
- data-testid="catalogFamilySelect"
+ data-cy="catalogFamilySelect"
/>
+
+ {{ t('orderBy') }}
+
@@ -167,7 +183,6 @@
v-else-if="!items || !items.length || !isSomeFilterSelected"
class="text-subtitle1 text-grey-7 q-pa-md"
>
-
{{ t('pleaseSetFilter') }}
-
+
{{ t('add') }}
@@ -276,12 +292,13 @@
flat
color="white"
@click="onConfirmClick()"
- data-testid="catalogAddToBasketButton"
+ data-cy="catalogAddToBasketButton"
>
{{ t('confirm') }}
+
@@ -744,7 +761,8 @@ const getSubcategories = async () => {
DROP TEMPORARY TABLE tmp.itemAvailable;`,
{ orderId: basketOrderId.value }
);
- itemSubcategories.value = res.results[1].data;
+ const filtered = res.results[1].data.filter(item => item.category);
+ itemSubcategories.value = filtered.map(i => i.category);
} catch (error) {
console.error('Error getting subcategories:', error);
}
@@ -753,11 +771,13 @@ const getSubcategories = async () => {
const showItem = async item => {
if (checkGuest()) return;
- const itemLots = await calcItem(item.id);
- const tags = await getItemTags(item.id);
+ showItemDialog.value = true;
+ const [itemLots, tags] = await Promise.all([
+ calcItem(item.id),
+ getItemTags(item.id)
+ ]);
item.lots = itemLots;
item.tags = tags;
- showItemDialog.value = true;
selectedItem.value = item;
};
@@ -848,6 +868,7 @@ const onAddLotClick = async lot => {
};
const resetAmounts = () => {
+ selectedItem.value = null;
addedItemsAmountAcc.value = {};
amount.value = 0;
};
@@ -1031,6 +1052,8 @@ en-US:
filterBy: Filter by
chooseCategory: Choose a category
youMustBeLoggedIn: You must be a registered user
+ sort: Order
+ amountNotAvailable: Amount not available
es-ES:
category: Categoría
deleteFilter: Quitar filtro
@@ -1054,6 +1077,8 @@ es-ES:
filterBy: Filtrar por
chooseCategory: Elige una categoría
youMustBeLoggedIn: Debes estar registrado como usuario
+ sort: Ordenar
+ amountNotAvailable: Cantidad no disponible
ca-ES:
category: Categoría
deleteFilter: Eliminar filtro
@@ -1075,6 +1100,8 @@ ca-ES:
filterBy: Filtrar per
chooseCategory: Tria una categoria
youMustBeLoggedIn: Has d'estar registrat com a usuari
+ sort: Ordenar
+ amountNotAvailable: Quantitat no disponible
fr-FR:
category: Catégorie
deleteFilter: Supprimer le filtre
@@ -1096,6 +1123,8 @@ fr-FR:
filterBy: Filtrer par
chooseCategory: Choisissez une catégorie
youMustBeLoggedIn: Vous devez être un utilisateur enregistré
+ sort: Trier
+ amountNotAvailable: Quantité non disponible
pt-PT:
category: Categoria
deleteFilter: Apagar filtro
@@ -1117,4 +1146,6 @@ pt-PT:
filterBy: Filtrar por
chooseCategory: Escolha uma categoria
youMustBeLoggedIn: Deves estar registrado como usuario
+ sort: Ordenar
+ amountNotAvailable: Quantidade não disponível
diff --git a/src/pages/Ecomerce/CheckoutView.vue b/src/pages/Ecomerce/CheckoutView.vue
index 12da7061..ad4eaf9e 100644
--- a/src/pages/Ecomerce/CheckoutView.vue
+++ b/src/pages/Ecomerce/CheckoutView.vue
@@ -1,5 +1,5 @@
@@ -322,7 +350,7 @@ onMounted(async () => {
:flat="isMobile"
contracted
class="default-radius stepper-container"
- data-testid="checkoutStepper"
+ data-cy="checkoutStepper"
>
{
{{
@@ -419,7 +447,7 @@ onMounted(async () => {
option-label="description"
option-value="id"
:options="agencies"
- data-testid="agencyStepSelect"
+ data-cy="agencyStepSelect"
/>
{
option-label="description"
option-value="id"
:options="warehouses"
- data-testid="pickupStepSelect"
+ data-cy="pickupStepSelect"
/>
@@ -461,14 +489,14 @@ onMounted(async () => {
icon="arrow_back"
dense
class="left-navigation-button"
- data-testid="checkoutStepperLeftButton"
+ data-cy="checkoutStepperLeftButton"
>
{{ t(`${step.backButtonLabel || 'back'}`) }}
{{ t(`${step.nextButtonLabel || 'next'}`) }}
@@ -491,7 +520,7 @@ onMounted(async () => {
@import 'src/css/responsive';
.step-title {
- min-width: 100%;
+ max-width: 90%;
margin-bottom: 16px;
text-align: center;
font-weight: bold;
@@ -523,7 +552,7 @@ onMounted(async () => {
.left-navigation-button {
position: absolute;
left: 5px;
- top: 50%;
+ top: 25px;
@include mobile {
top: 35%;
}
@@ -532,7 +561,7 @@ onMounted(async () => {
.right-navigation-button {
position: absolute;
right: 5px;
- top: 50%;
+ top: 25px;
@include mobile {
top: 35%;
}
diff --git a/src/pages/Ecomerce/ConfirmView.vue b/src/pages/Ecomerce/ConfirmView.vue
index 750864eb..9d889188 100644
--- a/src/pages/Ecomerce/ConfirmView.vue
+++ b/src/pages/Ecomerce/ConfirmView.vue
@@ -288,9 +288,8 @@ onMounted(async () => {
>
-
{{ t('emptyList') }}
diff --git a/src/pages/Ecomerce/OrdersView.vue b/src/pages/Ecomerce/OrdersView.vue
index c3787f50..67daeb1c 100644
--- a/src/pages/Ecomerce/OrdersView.vue
+++ b/src/pages/Ecomerce/OrdersView.vue
@@ -73,7 +73,7 @@ const onConfirmPay = async () => {
@click="onPayClick()"
rounded
no-caps
- data-testid="makePaymentButton"
+ data-cy="makePaymentButton"
>
{{ t('makePayment') }}
@@ -126,7 +126,7 @@ const onConfirmPay = async () => {
v-model="showAmountToPayDialog"
message=" "
:promise="onConfirmPay"
- data-testid="payAmountDialog"
+ data-cy="payAmountDialog"
>
{
type="number"
min="0"
:max="debt * -1"
- data-testid="payAmountInput"
+ data-cy="payAmountInput"
>
€
diff --git a/src/pages/Ecomerce/PendingOrders.vue b/src/pages/Ecomerce/PendingOrders.vue
index 1fbe9316..c9257cb2 100644
--- a/src/pages/Ecomerce/PendingOrders.vue
+++ b/src/pages/Ecomerce/PendingOrders.vue
@@ -71,7 +71,7 @@ onMounted(async () => {
{
-
+
@@ -116,7 +112,7 @@ onMounted(async () => {
() => removeOrder(order.id, index)
)
"
- data-testid="pendingOrderCardDelete"
+ data-cy="pendingOrderCardDelete"
>
{{ t('deleteOrder') }}
@@ -125,7 +121,7 @@ onMounted(async () => {
flat
rounded
@click.stop.prevent="loadOrder(order.id)"
- data-testid="addOrderToBasket"
+ data-cy="addOrderToBasket"
>
{{ t('loadOrderIntoCart') }}
diff --git a/src/pages/Ecomerce/TicketDetails.vue b/src/pages/Ecomerce/TicketDetails.vue
index 062bbf80..19512711 100644
--- a/src/pages/Ecomerce/TicketDetails.vue
+++ b/src/pages/Ecomerce/TicketDetails.vue
@@ -111,7 +111,7 @@ const deleteRow = id => {
-
+
{
class="row items-center justify-center q-pa-md"
style="margin-top: 32px"
>
-
{{ t('emptyList') }}
diff --git a/src/pages/Login/LoginView.vue b/src/pages/Login/LoginView.vue
index d16f9b8c..ac9cf77a 100644
--- a/src/pages/Login/LoginView.vue
+++ b/src/pages/Login/LoginView.vue
@@ -73,17 +73,17 @@ const loginAsGuest = async () => {
v-model="email"
:label="$t('user')"
autofocus
- data-testid="loginUserInput"
+ data-cy="loginUserInput"
/>
{
{
{
outline
/>
-
-
+
+
{{ $t('haveForgottenPassword') }}
diff --git a/src/pages/Login/RecoverPassword.vue b/src/pages/Login/RecoverPassword.vue
new file mode 100644
index 00000000..1c6b8122
--- /dev/null
+++ b/src/pages/Login/RecoverPassword.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('weSendEmail') }}
+
+
+
+
+
+ {{ t('back') }}
+
+
+
+
+
+
+
+
+
+
+
+en-US:
+ inputEmail: Input email
+ rememberPassword: Rememeber password
+ weSendEmail: We will sent you an email to recover your password
+ weHaveSentEmailToRecover: We've sent you an email where you can recover your password
+es-ES:
+ inputEmail: Introduce el correo electrónico
+ rememberPassword: Recordar contraseña
+ weSendEmail: Te enviaremos un correo para restablecer tu contraseña
+ weHaveSentEmailToRecover: Te hemos enviado un correo donde podrás recuperar tu contraseña
+ca-ES:
+ inputEmail: Introdueix el correu electrònic
+ rememberPassword: Recordar contrasenya
+ weSendEmail: T'enviarem un correu per restablir la teva contrasenya
+ weHaveSentEmailToRecover: T'hem enviat un correu on podràs recuperar la teva contrasenya
+fr-FR:
+ inputEmail: Entrez l'email
+ rememberPassword: Se souvenir du mot de passe
+ weSendEmail: Nous vous enverrons un e-mail pour récupérer votre mot de passe
+ weHaveSentEmailToRecover: Nous vous avons envoyé un e-mail où vous pouvez récupérer votre mot de passe
+pr-BR:
+ inputEmail: Digite o e-mail
+ rememberPassword: Lembrar senha
+ weSendEmail: Enviaremos um e-mail para recuperar sua senha
+ weHaveSentEmailToRecover: Enviamos um e-mail onde você pode recuperar sua senha
+
diff --git a/src/pages/Login/RememberPassword.vue b/src/pages/Login/RememberPassword.vue
deleted file mode 100644
index 3a6d781e..00000000
--- a/src/pages/Login/RememberPassword.vue
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ $t('dontWorry') }}
-
-
- {{ $t('fillData') }}
-
-
-
-
- {{ $t('weSendEmail') }}
-
-
-
-
-
- {{ $t('return') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-en-US:
- user: User
- inputEmail: Input email
- rememberPassword: Rememeber password
- dontWorry: Don't worry!
- fillData: Fill the data
- weSendEmail: We will sent you an email to recover your password
- weHaveSentEmailToRecover: We've sent you an email where you can recover your password
- send: Send
- return: Return
-es-ES:
- user: Usuario
- inputEmail: Introduce el correo electrónico
- rememberPassword: Recordar contraseña
- dontWorry: ¡No te preocupes!
- fillData: Rellena los datos
- weSendEmail: Te enviaremos un correo para restablecer tu contraseña
- weHaveSentEmailToRecover: Te hemos enviado un correo donde podrás recuperar tu contraseña
- send: Enviar
- return: Volver
-
diff --git a/src/router/index.js b/src/router/index.js
index 4568f378..ab2967a8 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -39,10 +39,11 @@ export default route(function (/* { store, ssrContext } */) {
Router.beforeEach((to, from, next) => {
const userStore = useUserStore();
+ const allowedRoutes = ['login', 'recoverPassword'];
if (
!userStore.storage.getItem('token') &&
- to.name !== 'login' &&
+ !allowedRoutes.includes(to.name) &&
!userStore.isGuest
) {
return next({ name: 'login' });
diff --git a/src/router/routes.js b/src/router/routes.js
index 1a632381..59ceee1c 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -5,17 +5,17 @@ const routes = [
children: [
{
name: 'login',
- path: '/login/:email?',
+ path: '',
component: () => import('pages/Login/LoginView.vue')
},
{
- name: 'rememberPassword',
- path: '/remember-password',
- component: () => import('pages/Login/RememberPassword.vue')
+ name: 'recoverPassword',
+ path: 'recover',
+ component: () => import('pages/Login/RecoverPassword.vue')
},
{
name: 'resetPassword',
- path: '/reset-password',
+ path: 'reset',
component: () => import('pages/Login/ResetPassword.vue')
}
]
diff --git a/src/stores/app.js b/src/stores/app.js
index 573995bf..ad954627 100644
--- a/src/stores/app.js
+++ b/src/stores/app.js
@@ -20,12 +20,7 @@ export const useAppStore = defineStore('hedera', {
menuEssentialLinks: [],
hiddenMenuLinks: new Set(['Reports']),
basketOrderId: null,
- localeDates: {
- days: [],
- months: [],
- daysShort: [],
- monthsShort: []
- },
+
siteLang: null,
localeOptions: [
{ label: t('langs.en'), lang: 'en-US', value: 'en' },
@@ -66,20 +61,9 @@ export const useAppStore = defineStore('hedera', {
this.$patch({ imageUrl });
},
- getLocaleDates() {
- const { messages, locale } = i18n.global;
- this.localeDates = {
- days: messages.value[locale.value].date.days,
- months: messages.value[locale.value].date.months,
- daysShort: messages.value[locale.value].date.daysShort,
- monthsShort: messages.value[locale.value].date.monthsShort
- };
- },
-
async init() {
this.updateSiteLocale(localStorage.getItem('siteLang') || 'es-ES');
this.getBasketOrderId();
- this.getLocaleDates();
},
getBasketOrderId() {
@@ -187,6 +171,12 @@ export const useAppStore = defineStore('hedera', {
isDesktop() {
const $q = useQuasar();
return $q?.screen?.width > 1024;
+ },
+ localeDates() {
+ const { messages, locale } = i18n.global;
+ const { days, months, daysShort, monthsShort } =
+ messages.value[locale.value].date;
+ return { days, months, daysShort, monthsShort };
}
}
});
diff --git a/src/test/cypress/integration/admin/NewsView.spec.js b/src/test/cypress/integration/admin/NewsView.spec.js
index c84c4b48..04bd4f40 100644
--- a/src/test/cypress/integration/admin/NewsView.spec.js
+++ b/src/test/cypress/integration/admin/NewsView.spec.js
@@ -29,7 +29,7 @@ describe('NewsView', () => {
cy.dataCy('newsTitleInput').should('exist');
cy.dataCy('newsTitleInput').find('input').type('Test new');
cy.dataCy('newsTagSelect').should('exist');
- cy.selectOption('[data-testid="newsTagSelect"]', 'Curso');
+ cy.selectOption('[data-cy="newsTagSelect"]', 'Curso');
cy.dataCy('newsPriorityInput').should('exist');
cy.dataCy('newsPriorityInput').find('input').type('2');
cy.dataCy('formDefaultSaveButton').should('not.be.disabled');
diff --git a/src/test/cypress/integration/admin/PhotosView.spec.js b/src/test/cypress/integration/admin/PhotosView.spec.js
index 3df15fb6..577912d6 100644
--- a/src/test/cypress/integration/admin/PhotosView.spec.js
+++ b/src/test/cypress/integration/admin/PhotosView.spec.js
@@ -15,8 +15,8 @@ describe('Photo Uploader Component', () => {
it('should allow selecting a photo collection', () => {
// Simular la selección de una colección de fotos
- cy.selectOption('[data-testid="photoCollectionSelect"]', 'Enlace');
- cy.getValue('[data-testid="photoCollectionSelect"]').should(
+ cy.selectOption('[data-cy="photoCollectionSelect"]', 'Enlace');
+ cy.getValue('[data-cy="photoCollectionSelect"]').should(
'equal',
'Enlace'
);
diff --git a/src/test/cypress/integration/catalog/CatalogView.commands.js b/src/test/cypress/integration/catalog/CatalogView.commands.js
index 45c4a602..502eda6f 100644
--- a/src/test/cypress/integration/catalog/CatalogView.commands.js
+++ b/src/test/cypress/integration/catalog/CatalogView.commands.js
@@ -1,21 +1,18 @@
Cypress.Commands.add('addItemToBasketFlow', () => {
// 1- Seleccionar categoría
cy.dataCy('catalogCategoryButton').should('exist');
- cy.get('[data-testid="catalogCategoryButton"]:first').click();
+ cy.get('[data-cy="catalogCategoryButton"]:first').click();
// 2- Seleccionar familia
cy.dataCy('catalogFamilySelect').should('exist');
- cy.selectOption('[data-testid="catalogFamilySelect"]', 'Anthurium');
- cy.getValue('[data-testid="catalogFamilySelect"]').should(
- 'equal',
- 'Anthurium'
- );
+ cy.selectOption('[data-cy="catalogFamilySelect"]', 'Anthurium');
+ cy.getValue('[data-cy="catalogFamilySelect"]').should('equal', 'Anthurium');
cy.dataCy('catalogFamilySelect').should('exist');
// 3- Seleccionar item
cy.dataCy('catalogCardGridBody').should('exist');
- cy.get('[data-testid="catalogCardGridBody"]:first').click();
+ cy.get('[data-cy="catalogCardGridBody"]:first').click();
// 4- Añadir item al carrito
cy.dataCy('addItemQuantityButton').should('exist');
- cy.get('[data-testid="addItemQuantityButton"]:first').click();
+ cy.get('[data-cy="addItemQuantityButton"]:first').click();
cy.dataCy('catalogAddToBasketButton').should('exist');
cy.dataCy('catalogAddToBasketButton').click();
cy.checkNotify('positive', 'Añadido');
diff --git a/src/test/cypress/integration/catalog/CatalogView.spec.js b/src/test/cypress/integration/catalog/CatalogView.spec.js
index a01a0062..01688a0e 100644
--- a/src/test/cypress/integration/catalog/CatalogView.spec.js
+++ b/src/test/cypress/integration/catalog/CatalogView.spec.js
@@ -42,4 +42,14 @@ describe('CatalogView', () => {
cy.dataCy('catalogGoToBasketButton').click();
cy.url().should('contain', '/#/ecomerce/basket');
});
+
+ it('Open item details and image exists', () => {
+ // cy.resetDB();
+ cy.login('developer');
+ cy.createOrderReceiveFlow();
+ cy.addItemToBasketFlow();
+ cy.dataCy('catalogCardElement').first().click();
+ cy.wait(200);
+ cy.dataCy('catalogCardImage').find('img').should('exist');
+ });
});
diff --git a/src/test/cypress/integration/checkout/CheckoutStepper.commands.js b/src/test/cypress/integration/checkout/CheckoutStepper.commands.js
index f9ae426c..1ebeb17a 100644
--- a/src/test/cypress/integration/checkout/CheckoutStepper.commands.js
+++ b/src/test/cypress/integration/checkout/CheckoutStepper.commands.js
@@ -1,5 +1,5 @@
const checkoutNextStep = () => {
- cy.dataCy('checkoutStepperRightButton').should('be.visible').click();
+ cy.dataCy('checkoutStepperRightButton').last().should('be.visible').click();
};
Cypress.Commands.add('createOrderReceive', () => {
@@ -29,7 +29,7 @@ Cypress.Commands.add('createOrderReceive', () => {
'¿Cómo quieres recibir el pedido?'
);
cy.dataCy('agencyStepSelect').should('exist');
- cy.selectOption('[data-testid="agencyStepSelect"]', 'Other agency');
+ cy.selectOption('[data-cy="agencyStepSelect"]', 'Other agency');
checkoutNextStep();
checkoutNextStep();
cy.url().should('contain', '/#/ecomerce/catalog');
@@ -69,7 +69,7 @@ Cypress.Commands.add('createOrderPickup', () => {
'¿En qué almacén quieres recoger tu pedido?'
);
cy.dataCy('pickupStepSelect').should('exist');
- cy.selectOption('[data-testid="pickupStepSelect"]', 'Teleportation device');
+ cy.selectOption('[data-cy="pickupStepSelect"]', 'Teleportation device');
checkoutNextStep();
checkoutNextStep();
cy.url().should('contain', '/#/ecomerce/catalog');
diff --git a/src/test/cypress/integration/config/AccountConfig.commands.js b/src/test/cypress/integration/config/AccountConfig.commands.js
index 8a4c6445..cac6f430 100644
--- a/src/test/cypress/integration/config/AccountConfig.commands.js
+++ b/src/test/cypress/integration/config/AccountConfig.commands.js
@@ -1,7 +1,7 @@
Cypress.Commands.add('changeUserNickname', (oldNickname, newNickname) => {
cy.dataCy('configViewNickname').find('input').should('exist');
- cy.getValue('input[data-testid="configViewNickname"]').should(
+ cy.getValue('input[data-cy="configViewNickname"]').should(
'equal',
oldNickname
);
diff --git a/src/test/cypress/integration/config/AccountConfig.spec.js b/src/test/cypress/integration/config/AccountConfig.spec.js
index 97cd10dc..6d41225b 100644
--- a/src/test/cypress/integration/config/AccountConfig.spec.js
+++ b/src/test/cypress/integration/config/AccountConfig.spec.js
@@ -11,9 +11,9 @@ describe('Changes user nickname', () => {
it('changes site lang when changing user lang', () => {
cy.dataCy('configViewLang').should('exist');
- cy.selectOption('[data-testid="configViewLang"]', 'Español');
+ cy.selectOption('[data-cy="configViewLang"]', 'Español');
cy.dataCy('headerTitle').should('contain', 'Configuración');
- cy.selectOption('[data-testid="configViewLang"]', 'English');
+ cy.selectOption('[data-cy="configViewLang"]', 'English');
cy.dataCy('headerTitle').should('contain', 'Configuration');
});
});
diff --git a/src/test/cypress/integration/config/AddresList.spec.js b/src/test/cypress/integration/config/AddresList.spec.js
index cf8e6e55..d8a39271 100644
--- a/src/test/cypress/integration/config/AddresList.spec.js
+++ b/src/test/cypress/integration/config/AddresList.spec.js
@@ -23,8 +23,8 @@ describe('PendingOrders', () => {
cy.dataCy('addressFormCity').find('input').type(data.city);
cy.dataCy('addressFormPostcode').find('input').click();
cy.dataCy('addressFormPostcode').find('input').type(data.postcode);
- cy.selectOption('[data-testid="addressFormCountry"]', 'España');
- cy.selectOption('[data-testid="addressFormProvince"]', 'Province one');
+ cy.selectOption('[data-cy="addressFormCountry"]', 'España');
+ cy.selectOption('[data-cy="addressFormProvince"]', 'Province one');
};
const verifyAddressCardData = data => {
@@ -63,7 +63,7 @@ describe('PendingOrders', () => {
cy.dataCy('addressCardList')
.children()
.last()
- .find('[data-testid="editAddressBtn"]')
+ .find('[data-cy="editAddressBtn"]')
.click();
// Clear form data
cy.get('form input').each(input => {
diff --git a/src/test/cypress/integration/login/LoginView.commands.js b/src/test/cypress/integration/login/LoginView.commands.js
index 1e3ccdd8..a0a4c0ea 100644
--- a/src/test/cypress/integration/login/LoginView.commands.js
+++ b/src/test/cypress/integration/login/LoginView.commands.js
@@ -40,12 +40,9 @@ Cypress.Commands.add('logout', user => {
Cypress.Commands.add('loginFlow', (user, visitLogin = true) => {
if (visitLogin) cy.visit('/#/login');
cy.dataCy('loginUserInput').type(user);
- cy.getValue('[data-testid="loginUserInput"]').should('equal', user);
+ cy.getValue('[data-cy="loginUserInput"]').should('equal', user);
cy.dataCy('loginPasswordInput').type('nightmare');
- cy.getValue('[data-testid="loginPasswordInput"]').should(
- 'equal',
- 'nightmare'
- );
+ cy.getValue('[data-cy="loginPasswordInput"]').should('equal', 'nightmare');
cy.get('button[type="submit"]').click();
cy.url().should('contain', '/#/cms/home');
@@ -54,7 +51,7 @@ Cypress.Commands.add('loginFlow', (user, visitLogin = true) => {
Cypress.Commands.add('changeLanguage', language => {
const languagesOrder = ['en', 'es', 'ca', 'fr', 'pt'];
const index = languagesOrder.indexOf(language);
- cy.waitForElement('[data-testid="switchLanguage"]');
+ cy.waitForElement('[data-cy="switchLanguage"]');
cy.dataCy('switchLanguage').click();
cy.get('.q-menu .q-item').eq(index).click(); // Selecciona y hace clic en el tercer elemento "index" de la lista
});
diff --git a/src/test/cypress/integration/login/LoginView.spec.js b/src/test/cypress/integration/login/LoginView.spec.js
index b180ce92..2478d2b3 100644
--- a/src/test/cypress/integration/login/LoginView.spec.js
+++ b/src/test/cypress/integration/login/LoginView.spec.js
@@ -1,5 +1,5 @@
describe('Login Tests', () => {
- const rememberCheckbox = '[data-testid="rememberCheckbox"]';
+ const rememberCheckbox = '[data-cy="rememberCheckbox"]';
beforeEach(() => {
cy.visit('/#/login');
diff --git a/src/test/cypress/integration/login/RecoverPassword.spec.js b/src/test/cypress/integration/login/RecoverPassword.spec.js
new file mode 100644
index 00000000..e78a20ff
--- /dev/null
+++ b/src/test/cypress/integration/login/RecoverPassword.spec.js
@@ -0,0 +1,18 @@
+describe('Login Tests', () => {
+ beforeEach(() => {
+ cy.visit('/#/login');
+ });
+
+ it('should ssend recover email', () => {
+ cy.dataCy('recoverPasswordViewLink').should('exist');
+ cy.dataCy('recoverPasswordViewLink').click();
+ cy.dataCy('recoverPasswordUserInput').find('input').should('exist');
+ cy.dataCy('recoverPasswordUserInput').find('input').type('developer');
+ cy.dataCy('recoverPasswordSubmitButton').should('exist');
+ cy.dataCy('recoverPasswordSubmitButton').click();
+ cy.checkNotify(
+ 'positive',
+ 'Te hemos enviado un correo donde podrás recuperar tu contraseña'
+ );
+ });
+});
diff --git a/src/test/cypress/reports/index.html b/src/test/cypress/reports/index.html
new file mode 100644
index 00000000..436d5460
--- /dev/null
+++ b/src/test/cypress/reports/index.html
@@ -0,0 +1,17 @@
+
+Hedera-Web E2E Reporter
\ No newline at end of file
diff --git a/src/test/cypress/support/commands.js b/src/test/cypress/support/commands.js
index b4ec3d42..2d4de848 100644
--- a/src/test/cypress/support/commands.js
+++ b/src/test/cypress/support/commands.js
@@ -36,6 +36,7 @@ requireCommands.keys().forEach(requireCommands);
// Common commands
Cypress.Commands.add('selectOption', (selector, option) => {
cy.waitForElement(selector);
+ cy.wait(400);
cy.get(selector).click();
cy.get('.q-menu .q-item').contains(option).click();
});
@@ -55,7 +56,7 @@ Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
cy.get(element, { timeout }).should('be.visible');
});
-Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-testid') => {
+Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-cy') => {
return cy.get(`[${attr}="${dataTestId}"]`);
});
@@ -80,7 +81,7 @@ Cypress.Commands.add('setSessionStorage', (key, value) => {
});
Cypress.Commands.add('resetDB', () => {
- cy.exec('npm run resetDatabase');
+ cy.exec('pnpm run db');
});
Cypress.Commands.add('setConfirmDialog', () => {