Skip to content

Commit

Permalink
Merge pull request PrestaShop#37036 from Progi1984/test7595
Browse files Browse the repository at this point in the history
Functional Tests : BO - Modules - GDPR: Help
  • Loading branch information
nesrineabdmouleh authored Sep 26, 2024
2 parents 1d887b3 + e9f8791 commit 65170eb
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe('BO - Dashboard : Activity overview', async () => {
expect(pageTitle).to.contains(boDashboardPage.pageTitle);
});

// @todo https://github.com/PrestaShop/PrestaShop/issues/34321
// @todo : https://github.com/PrestaShop/PrestaShop/issues/34321
it('should check Return/Exchange number', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkReturnExchangeNumber', baseContext);

Expand Down Expand Up @@ -711,7 +711,7 @@ describe('BO - Dashboard : Activity overview', async () => {
expect(isConfigureFormVisible).to.eq(true);
});

// @todo https://github.com/PrestaShop/PrestaShop/issues/34326
// @todo : https://github.com/PrestaShop/PrestaShop/issues/34326
});

// Post-condition : Delete created customer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('BO - Dashboard : Products and sales', async () => {
expect(isConfigureFormVisible).to.eq(true);
});

// @todo https://github.com/PrestaShop/PrestaShop/issues/34326
// @todo : https://github.com/PrestaShop/PrestaShop/issues/34326
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ describe('BO - Orders - Create Order : Select Previous Carts', async () => {
});
});

// To delete when this issue: https://github.com/PrestaShop/PrestaShop/issues/9589 is fixed
// @todo : https://github.com/PrestaShop/PrestaShop/issues/9589
// Delete when fixed
describe('Delete the Non ordered shopping carts', async () => {
it('should go to \'Orders > Shopping carts\' page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToShoppingCartsPage2', baseContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Pre-condition :
Scenario :
- Go to view order page
- Send message and check message block( messages number, employee icon, date, sender)
- Check message in FO -> Issue https://github.com/PrestaShop/PrestaShop/issues/26532
- Check message in FO
- Uncheck display to customer and send message then check( messages number, message text, employee icon, date, sender)
- Check that the message is not visible in FO
- Send message from FO and check it on BO ( messages number, Message text, employee icon, date, sender)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe('BO - International - Translation : Modify translation', async () => {

await foHummingbirdHomePage.clickAddWishListProduct(page, 1);

//@todo : Move to foHummingbirdModalWishlistPage
// @todo : Move to foHummingbirdModalWishlistPage
const wishlistModalTitle = await foClassicModalWishlistPage.getModalAddToTitle(page);
expect(wishlistModalTitle).to.equal('Add to wishlist now');
});
Expand Down
76 changes: 38 additions & 38 deletions tests/UI/campaigns/functional/BO/15_header/07_myProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import loginCommon from '@commonTests/BO/loginBO';
// Import pages
import creditSlipsPage from '@pages/BO/orders/creditSlips';
import employeesPage from '@pages/BO/advancedParameters/team';
import myProfilePage from '@pages/BO/advancedParameters/team/myProfile';

import {
boDashboardPage,
boLoginPage,
boMyProfilePage,
boProductsPage,
type EmployeePermission,
FakerEmployee,
Expand Down Expand Up @@ -81,10 +81,10 @@ describe('BO - Header : My profile', async () => {
await testContext.addContextItem(this, 'testIdentifier', 'goToMyProfilePage', baseContext);

await boDashboardPage.goToMyProfile(page);
await myProfilePage.closeSfToolBar(page);
await boMyProfilePage.closeSfToolBar(page);

const pageTitle = await myProfilePage.getPageTitle(page);
expect(pageTitle).to.contains(myProfilePage.pageTitleEdit(employeeData.lastName, employeeData.firstName));
const pageTitle = await boMyProfilePage.getPageTitle(page);
expect(pageTitle).to.contains(boMyProfilePage.pageTitleEdit(employeeData.lastName, employeeData.firstName));
});
});

Expand All @@ -95,15 +95,15 @@ describe('BO - Header : My profile', async () => {
employeeData.firstName = 'Hello222';
employeeData.lastName = 'World333';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertError(page);
expect(textResult).to.equal(myProfilePage.errorInvalidFirstNameMessage);
const textResult = await boMyProfilePage.getAlertError(page);
expect(textResult).to.equal(boMyProfilePage.errorInvalidFirstNameMessage);

const lastNameResult = await myProfilePage.getInputValue(page, 'lastname');
const lastNameResult = await boMyProfilePage.getInputValue(page, 'lastname');
expect(lastNameResult).to.equal(employeeData.lastName);

const firstNameResult = await myProfilePage.getInputValue(page, 'firstname');
const firstNameResult = await boMyProfilePage.getInputValue(page, 'firstname');
expect(firstNameResult).to.equal(employeeData.firstName);
});

Expand All @@ -112,15 +112,15 @@ describe('BO - Header : My profile', async () => {

employeeData.firstName = 'Hello man';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertError(page);
expect(textResult).to.equal(myProfilePage.errorInvalidLastNameMessage);
const textResult = await boMyProfilePage.getAlertError(page);
expect(textResult).to.equal(boMyProfilePage.errorInvalidLastNameMessage);

const lastNameResult = await myProfilePage.getInputValue(page, 'lastname');
const lastNameResult = await boMyProfilePage.getInputValue(page, 'lastname');
expect(lastNameResult).to.equal(employeeData.lastName);

const firstNameResult = await myProfilePage.getInputValue(page, 'firstname');
const firstNameResult = await boMyProfilePage.getInputValue(page, 'firstname');
expect(firstNameResult).to.equal(employeeData.firstName);
});

Expand All @@ -130,19 +130,19 @@ describe('BO - Header : My profile', async () => {
employeeData.firstName = 'Hello';
employeeData.lastName = 'World';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(myProfilePage.successfulUpdateMessage);
const textResult = await boMyProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(boMyProfilePage.successfulUpdateMessage);

const lastNameResult = await myProfilePage.getInputValue(page, 'lastname');
const lastNameResult = await boMyProfilePage.getInputValue(page, 'lastname');
expect(lastNameResult).to.equal(employeeData.lastName);

const firstNameResult = await myProfilePage.getInputValue(page, 'firstname');
const firstNameResult = await boMyProfilePage.getInputValue(page, 'firstname');
expect(firstNameResult).to.equal(employeeData.firstName);

const pageTitle = await myProfilePage.getPageTitle(page);
expect(pageTitle).to.contains(myProfilePage.pageTitleEdit(employeeData.lastName, employeeData.firstName));
const pageTitle = await boMyProfilePage.getPageTitle(page);
expect(pageTitle).to.contains(boMyProfilePage.pageTitleEdit(employeeData.lastName, employeeData.firstName));
});

it('should upload an invalid format image and check error message', async function () {
Expand All @@ -151,10 +151,10 @@ describe('BO - Header : My profile', async () => {

employeeData.avatarFile = 'image.svg';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertError(page);
expect(textResult).to.contains(myProfilePage.errorInvalidFormatImageMessage);
const textResult = await boMyProfilePage.getAlertError(page);
expect(textResult).to.contains(boMyProfilePage.errorInvalidFormatImageMessage);

// Delete created file
await utilsFile.deleteFile('image.svg');
Expand All @@ -166,10 +166,10 @@ describe('BO - Header : My profile', async () => {

employeeData.avatarFile = 'image.jpg';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(myProfilePage.successfulUpdateMessage);
const textResult = await boMyProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(boMyProfilePage.successfulUpdateMessage);

// Delete created file
await utilsFile.deleteFile('image.jpg');
Expand All @@ -181,15 +181,15 @@ describe('BO - Header : My profile', async () => {
await testContext.addContextItem(this, 'testIdentifier', 'checkGravatar', baseContext);
employeeData.enableGravatar = true;

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(myProfilePage.successfulUpdateMessage);
const textResult = await boMyProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(boMyProfilePage.successfulUpdateMessage);

const isChecked = await myProfilePage.isGravatarEnabled(page);
const isChecked = await boMyProfilePage.isGravatarEnabled(page);
expect(isChecked).to.eq(true);

const avatarURL = await myProfilePage.getCurrentEmployeeAvatar(page);
const avatarURL = await boMyProfilePage.getCurrentEmployeeAvatar(page);
expect(avatarURL).to.contains('https://www.gravatar.com/avatar/');

// Reset value
Expand All @@ -203,10 +203,10 @@ describe('BO - Header : My profile', async () => {
employeeData.language = 'English (English)';
employeeData.defaultPage = 'Credit Slips';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(myProfilePage.successfulUpdateMessage);
const textResult = await boMyProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(boMyProfilePage.successfulUpdateMessage);
});

it('should logout from BO', async function () {
Expand All @@ -230,10 +230,10 @@ describe('BO - Header : My profile', async () => {

employeeData.language = 'English (English)';

await myProfilePage.updateEditEmployee(page, employeeData.password, employeeData);
await boMyProfilePage.updateEditEmployee(page, employeeData.password, employeeData);

const textResult = await myProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(myProfilePage.successfulUpdateMessage);
const textResult = await boMyProfilePage.getAlertSuccess(page);
expect(textResult).to.equal(boMyProfilePage.successfulUpdateMessage);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('FO - Menu and navigation : Sort products', async () => {
sortDirection: 'asc',
},
},
// @todo https://github.com/PrestaShop/PrestaShop/issues/19810
// @todo : https://github.com/PrestaShop/PrestaShop/issues/19810
/* {
args: {
testIdentifier: 'sortByPriceDesc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('FO - Home Page : Select color', async () => {

const pageURL = await foHummingbirdProductPage.getCurrentURL(page);
expect(pageURL).to.contains('color-white');
// @todo https://github.com/PrestaShop/PrestaShop/issues/35481
// @todo : https://github.com/PrestaShop/PrestaShop/issues/35481
// .and.to.contains('size-m');
});

Expand All @@ -83,7 +83,7 @@ describe('FO - Home Page : Select color', async () => {

const pageURL = await foHummingbirdProductPage.getCurrentURL(page);
expect(pageURL).to.contains('color-black');
// @todo https://github.com/PrestaShop/PrestaShop/issues/35481
// @todo : https://github.com/PrestaShop/PrestaShop/issues/35481
// .and.to.contains('size-m');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('FO - Menu and navigation : Sort products', async () => {
sortDirection: 'asc',
},
},
// @todo https://github.com/PrestaShop/PrestaShop/issues/19810
// @todo : https://github.com/PrestaShop/PrestaShop/issues/19810
/*{
args: {
testIdentifier: 'sortByPriceDesc',
Expand Down
Loading

0 comments on commit 65170eb

Please sign in to comment.