Skip to content

Commit

Permalink
Merge pull request PrestaShop#37336 from Progi1984/test8737_90x
Browse files Browse the repository at this point in the history
Functional Tests : BO - Shop Parameters - Search - Indexing - Set a cron job
  • Loading branch information
Progi1984 authored Nov 8, 2024
2 parents 249fb52 + 3ec3bdb commit db757db
Show file tree
Hide file tree
Showing 22 changed files with 293 additions and 555 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: sanity-${{ matrix.php }}-${{ matrix.browser }}
name: sanity-${{ matrix.php }}-${{ matrix.browser }}-${{ matrix.db }}
path: |
./tests/UI/screenshots/
./var/logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import deleteNonOrderedShoppingCarts from '@commonTests/BO/orders/shoppingCarts'

// Import BO pages
import addProductPage from '@pages/BO/catalog/products/add';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';
import addOrderPage from '@pages/BO/orders/add';

import {
boDashboardPage,
boLoginPage,
boOrdersPage,
boProductsPage,
boProductsCreateTabPricingPage,
boStockPage,
type BrowserContext,
dataCurrencies,
Expand Down Expand Up @@ -288,15 +288,18 @@ describe('BO - Orders - Create order : Add a product to the cart', async () => {
// Add specific price
if (product === productWithSpecificPrice) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.clickOnAddSpecificPriceButton(page);
await boProductsCreateTabPricingPage.clickOnAddSpecificPriceButton(page);

createProductMessage = await pricingTab.setSpecificPrice(page, productWithSpecificPrice.specificPrice);
createProductMessage = await boProductsCreateTabPricingPage.setSpecificPrice(
page,
productWithSpecificPrice.specificPrice,
);
expect(createProductMessage).to.equal(addProductPage.successfulCreationMessage);
}
// Add eco tax
if (product === productWithEcoTax) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.addEcoTax(page, productWithEcoTax.ecoTax);
await boProductsCreateTabPricingPage.addEcoTax(page, productWithEcoTax.ecoTax);

updateProductMessage = await addProductPage.saveProduct(page);
expect(updateProductMessage).to.equal(addProductPage.successfulUpdateMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {createOrderByGuestTest} from '@commonTests/FO/classic/order';
import cartRulesPage from '@pages/BO/catalog/discounts';
import addCartRulePage from '@pages/BO/catalog/discounts/add';
import combinationsTab from '@pages/BO/catalog/products/add/combinationsTab';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';
import addProductPage from '@pages/BO/catalog/products/add';

import {
Expand All @@ -21,6 +20,7 @@ import {
boOrdersPage,
boOrdersViewBlockProductsPage,
boProductsPage,
boProductsCreateTabPricingPage,
type BrowserContext,
dataPaymentMethods,
dataProducts,
Expand Down Expand Up @@ -314,15 +314,18 @@ describe('BO - Orders - View and edit order : Check product block in view order
// Add specific price
if (product === productWithSpecificPrice) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.clickOnAddSpecificPriceButton(page);
await boProductsCreateTabPricingPage.clickOnAddSpecificPriceButton(page);

createProductMessage = await pricingTab.setSpecificPrice(page, productWithSpecificPrice.specificPrice);
createProductMessage = await boProductsCreateTabPricingPage.setSpecificPrice(
page,
productWithSpecificPrice.specificPrice,
);
expect(createProductMessage).to.equal(addProductPage.successfulCreationMessage);
}
// Add eco tax
if (product === productWithEcoTax) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.addEcoTax(page, productWithEcoTax.ecoTax);
await boProductsCreateTabPricingPage.addEcoTax(page, productWithEcoTax.ecoTax);

updateProductMessage = await addProductPage.saveProduct(page);
expect(updateProductMessage).to.equal(addProductPage.successfulUpdateMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {createOrderByCustomerTest, createOrderSpecificProductTest} from '@common

// Import BO pages
import addProductPage from '@pages/BO/catalog/products/add';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';
import orderPageCustomerBlock from '@pages/BO/orders/view/customerBlock';
import orderPagePaymentBlock from '@pages/BO/orders/view/paymentBlock';

Expand All @@ -21,6 +20,7 @@ import {
boOrdersViewBlockTabListPage,
boProductsPage,
boProductsCreateTabDetailsPage,
boProductsCreateTabPricingPage,
type BrowserContext,
dataAddresses,
dataCarriers,
Expand Down Expand Up @@ -257,15 +257,18 @@ describe('BO - Orders - View and edit order: Check invoice', async () => {
// Add specific price
if (product === productWithSpecificPrice) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.clickOnAddSpecificPriceButton(page);
await boProductsCreateTabPricingPage.clickOnAddSpecificPriceButton(page);

createProductMessage = await pricingTab.setSpecificPrice(page, productWithSpecificPrice.specificPrice);
createProductMessage = await boProductsCreateTabPricingPage.setSpecificPrice(
page,
productWithSpecificPrice.specificPrice,
);
expect(createProductMessage).to.equal(addProductPage.successfulCreationMessage);
}
// Add eco tax
if (product === productWithEcoTax) {
await addProductPage.goToTab(page, 'pricing');
await pricingTab.addEcoTax(page, productWithEcoTax.ecoTax);
await boProductsCreateTabPricingPage.addEcoTax(page, productWithEcoTax.ecoTax);

updateProductMessage = await addProductPage.saveProduct(page);
expect(updateProductMessage).to.equal(addProductPage.successfulUpdateMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import testContext from '@utils/testContext';
// Import pages
import createProductsPage from '@pages/BO/catalog/products/add';
import combinationsTab from '@pages/BO/catalog/products/add/combinationsTab';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';

import {expect} from 'chai';
import {
boAttributesPage,
boDashboardPage,
boLoginPage,
boProductsPage,
boProductsCreateTabPricingPage,
type BrowserContext,
FakerProduct,
foClassicProductPage,
Expand Down Expand Up @@ -515,7 +515,7 @@ describe('BO - Catalog - Products : CRUD product with combinations', async () =>
it('should go to Pricing tab and edit retail price, enable the product then save', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'saveProduct', baseContext);

await pricingTab.setProductPricing(page, pricingData);
await boProductsCreateTabPricingPage.setProductPricing(page, pricingData);

await createProductsPage.setProductStatus(page, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import testContext from '@utils/testContext';
// Import pages
import createProductsPage from '@pages/BO/catalog/products/add';
import packTab from '@pages/BO/catalog/products/add/packTab';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';

import {expect} from 'chai';
import {
boDashboardPage,
boLoginPage,
boProductsPage,
boProductsCreateTabPricingPage,
type BrowserContext,
dataEmployees,
dataProducts,
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('BO - Catalog - Products : CRUD pack of products', async () => {
it('should go to Pricing tab and edit retail price, enable the product then save', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'editRetailPrice', baseContext);

await pricingTab.setProductPricing(page, pricingData);
await boProductsCreateTabPricingPage.setProductPricing(page, pricingData);

await createProductsPage.setProductStatus(page, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {deleteProductTest} from '@commonTests/BO/catalog/product';

// Import pages
import createProductsPage from '@pages/BO/catalog/products/add';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';

import {expect} from 'chai';
import {faker} from '@faker-js/faker';
Expand All @@ -16,6 +15,7 @@ import {
boProductsPage,
boProductsCreateTabDescriptionPage,
boProductsCreateTabDetailsPage,
boProductsCreateTabPricingPage,
boProductsCreateTabStocksPage,
type BrowserContext,
FakerProduct,
Expand Down Expand Up @@ -209,7 +209,7 @@ describe('BO - Catalog - Products : Header', async () => {
it('should edit the retail price', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'editRetailPrice', baseContext);

await pricingTab.setRetailPrice(page, false, productRetailPriceTaxIncluded);
await boProductsCreateTabPricingPage.setRetailPrice(page, false, productRetailPriceTaxIncluded);

const message = await createProductsPage.saveProduct(page);
expect(message).to.eq(createProductsPage.successfulUpdateMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {deleteProductTest} from '@commonTests/BO/catalog/product';
// Import BO pages
import createProductsPage from '@pages/BO/catalog/products/add';
import packTab from '@pages/BO/catalog/products/add/packTab';
import pricingTab from '@pages/BO/catalog/products/add/pricingTab';

import {
boDashboardPage,
boLoginPage,
boOrdersPage,
boProductsPage,
boProductsCreateTabPricingPage,
type BrowserContext,
dataCustomers,
dataOrderStatuses,
Expand Down Expand Up @@ -290,7 +290,7 @@ describe('BO - Catalog - Products : Pack Tab', async () => {
it('should set the retail price', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'setRetailPrice', baseContext);

await pricingTab.setRetailPrice(page, true, productRetailPrice);
await boProductsCreateTabPricingPage.setRetailPrice(page, true, productRetailPrice);

const message = await createProductsPage.saveProduct(page);
expect(message).to.eq(createProductsPage.successfulUpdateMessage);
Expand Down
Loading

0 comments on commit db757db

Please sign in to comment.