Skip to content

Commit

Permalink
Merge pull request #729 from nesrineabdmouleh/addPSVersionsToMatrice
Browse files Browse the repository at this point in the history
UI tests - Add PS version 1.7.0.6 to 1.7.8.11 on php 7.1
  • Loading branch information
Progi1984 authored Dec 13, 2024
2 parents 15a64ac + 6b7a8dc commit 454784a
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
docker exec -t prestashop chmod 777 -R /var/www/html/var
- name: Uninstall welcome module
if: matrix.PS_VERSION_START == '1.7.1.0' || matrix.PS_VERSION_START == '1.7.1.1' || matrix.PS_VERSION_START == '1.7.1.2'
if: matrix.PS_VERSION_START == '1.7.0.6' || matrix.PS_VERSION_START == '1.7.1.0' || matrix.PS_VERSION_START == '1.7.1.1' || matrix.PS_VERSION_START == '1.7.1.2'
run: |
docker exec -t prestashop php bin/console prestashop:module disable welcome
docker exec -t prestashop chmod 777 -R /var/www/html/var
Expand Down
73 changes: 41 additions & 32 deletions .github/workflows/ui-test/nightly.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"include": [
{
"comment": "1.7.1.0 ~ 1.7.1.2 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.0.6 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.0.6",
"PS_VERSION_END": "1.7.8.11",
"PHP_VERSION": "7.1",
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.1.0 ~ 1.7.1.2 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.1.0",
Expand Down Expand Up @@ -61,7 +70,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.3.0 ~ 1.7.3.4 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.3.0 ~ 1.7.3.4 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.3.0",
Expand Down Expand Up @@ -94,7 +103,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.4.0 ~ 1.7.4.4 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.4.0 ~ 1.7.4.4 -> 1.7.8.11 PHP 7.1 online"
},
{
"comment": "https://github.com/PrestaShop/docker/issues/399",
Expand Down Expand Up @@ -129,7 +138,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.5.0 ~ 1.7.5.2 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.5.0 ~ 1.7.5.2 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.5.0",
Expand All @@ -150,7 +159,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.5.0 ~ 1.7.5.2 -> 8.2.0 PHP 7.2"
"comment": "1.7.5.0 ~ 1.7.5.2 -> 8.2.0 PHP 7.2 online"
},
{
"PS_VERSION_START": "1.7.5.0",
Expand All @@ -171,7 +180,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.6.0 ~ 1.7.6.9 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.6.0 ~ 1.7.6.9 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.6.0",
Expand Down Expand Up @@ -234,7 +243,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.6.0 ~ 1.7.6.9 -> 8.2.0 PHP 7.2"
"comment": "1.7.6.0 ~ 1.7.6.9 -> 8.2.0 PHP 7.2 online"
},
{
"PS_VERSION_START": "1.7.6.0",
Expand Down Expand Up @@ -297,7 +306,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.7.0 ~ 1.7.7.8 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.7.0 ~ 1.7.7.8 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.7.0",
Expand Down Expand Up @@ -354,7 +363,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.7.0 ~ 1.7.7.8 -> 8.2.0 PHP 7.2 ~ 7.3"
"comment": "1.7.7.0 ~ 1.7.7.8 -> 8.2.0 PHP 7.2 ~ 7.3 online"
},
{
"PS_VERSION_START": "1.7.7.0",
Expand Down Expand Up @@ -465,7 +474,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.8.0 ~ 1.7.8.10 -> 1.7.8.11 PHP 7.1"
"comment": "1.7.8.0 ~ 1.7.8.10 -> 1.7.8.11 PHP 7.1 online"
},
{
"PS_VERSION_START": "1.7.8.0",
Expand Down Expand Up @@ -534,7 +543,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "1.7.8.0 ~ 1.7.8.11 -> 8.2.0 PHP 7.2 ~ 7.4"
"comment": "1.7.8.0 ~ 1.7.8.11 -> 8.2.0 PHP 7.2 ~ 7.4 online"
},
{
"PS_VERSION_START": "1.7.8.0",
Expand Down Expand Up @@ -753,7 +762,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "8.0.0 ~ 8.0.5 -> 8.2.0 PHP 7.2 ~ 8.1"
"comment": "8.0.0 ~ 8.0.5 -> 8.2.0 PHP 7.2 ~ 8.1 online"
},
{
"PS_VERSION_START": "8.0.0",
Expand Down Expand Up @@ -936,7 +945,7 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "8.1.0 ~ 8.1.7 -> 8.2.0 PHP 7.2 ~ 8.1"
"comment": "8.1.0 ~ 8.1.7 -> 8.2.0 PHP 7.2 ~ 8.1 online"
},
{
"PS_VERSION_START": "8.1.0",
Expand Down Expand Up @@ -1179,103 +1188,103 @@
"UPGRADE_CHANNEL": "online"
},
{
"comment": "8.0.0 ~ 8.0.5 -> 9.0.0 PHP 8.1"
"comment": "8.0.0 ~ 8.0.5 -> 9.0.0 PHP 8.1 local"
},
{
"PS_VERSION_START": "8.0.0",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.0.1",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.0.2",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.0.3",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.0.4",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.0.5",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"comment": "8.1.0 ~ 8.1.7 -> 9.0.0 PHP 8.1"
"comment": "8.1.0 ~ 8.1.7 -> 9.0.0 PHP 8.1 local"
},
{
"PS_VERSION_START": "8.1.0",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.1",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.2",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.3",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.4",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.5",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.6",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"PS_VERSION_START": "8.1.7",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
"UPGRADE_CHANNEL": "local"
},
{
"comment": "8.2.0 -> 9.0.0 PHP 8.1"
"comment": "8.2.0 -> 9.0.0 PHP 8.1 local"
},
{
"PS_VERSION_START": "8.2.0",
"PS_VERSION_END": "9.0.0",
"PHP_VERSION": "8.1",
"UPGRADE_CHANNEL": "local"
}
"UPGRADE_CHANNEL": "local"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ test.describe('BO - Catalog - Products : CRUD product with combinations', async

const productAttributes = await foClassicProductPage.getProductAttributes(page);
await Promise.all([
// color
expect(productAttributes[0].value).toEqual(newProductData.attributes[1].values.join(' ')),
// size
expect(productAttributes[0].value).toEqual(newProductData.attributes[1].values.join(' ')),
// color
expect(productAttributes[1].value).toEqual(newProductData.attributes[0].values.join(' ')),
]);
});
Expand Down Expand Up @@ -304,11 +304,28 @@ test.describe('BO - Catalog - Products : CRUD product with combinations', async
]);

const productAttributes = await foClassicProductPage.getProductAttributes(page);
await Promise.all([
expect(productAttributes[0].value).toEqual(
`${newProductData.attributes[1].values.join(' ')} ${updateProductData.attributes[1].values.join(' ')}`),
expect(productAttributes[1].value).toEqual(newProductData.attributes[0].values.join(' ')),
]);

if (semver.gte(psVersion, '7.1.0')) {
await Promise.all([
// size
expect(productAttributes[0].value).toEqual(
`${newProductData.attributes[1].values.join(' ')} ${updateProductData.attributes[1].values.join(' ')}`),
// Color
expect(productAttributes[1].value).toEqual(newProductData.attributes[0].values.join(' ')),
]);
} else {
await Promise.all([
// size
expect(productAttributes[0].value).toEqual(
`${newProductData.attributes[1].values.join(' ')} ${updateProductData.attributes[1].values.join(' ')}`),
// Color
expect(productAttributes[1].value).toContain(newProductData.attributes[0].values[0]),
expect(productAttributes[1].value).toContain(newProductData.attributes[0].values[1]),
expect(productAttributes[1].value).toContain(updateProductData.attributes[0].values[1]),
expect(productAttributes[1].value).toContain(updateProductData.attributes[0].values[2]),
expect(productAttributes[1].value).toContain(updateProductData.attributes[0].values[3]),
]);
}
});
});

Expand Down
16 changes: 16 additions & 0 deletions tests/UI/campaigns/sanity/02_productsBO/05_deleteProduct.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ test.describe('BO - Catalog - Products : Delete product', async () => {
expect(pageTitle).toContain(boProductsPage.pageTitle);
});

test('should search for the created product', async () => {
await utilsTest.addContextItem(test.info(), 'testIdentifier', 'searchProduct', baseContext);

await boProductsPage.filterProducts(page, 'product_name', newProductData.name, 'input');

const textColumn = await boProductsPage.getTextColumn(page, 'product_name', 1);
expect(textColumn).toContain(newProductData.name);
});

test('should click on delete product button', async () => {
await utilsTest.addContextItem(test.info(), 'testIdentifier', 'clickOnDeleteProduct', baseContext);

Expand All @@ -140,5 +149,12 @@ test.describe('BO - Catalog - Products : Delete product', async () => {
const textMessage = await boProductsPage.clickOnConfirmDialogButton(page);
expect(textMessage).toEqual(boProductsPage.successfulDeleteMessage);
});

test('should reset filter', async () => {
await utilsTest.addContextItem(test.info(), 'testIdentifier', 'resetFilter', baseContext);

const numberOfProductsAfterReset = await boProductsPage.resetAndGetNumberOfLines(page);
expect(numberOfProductsAfterReset).toEqual(numberOfProducts);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
test, expect, Page, BrowserContext,
} from '@playwright/test';

import semver from 'semver';

const psVersion = utilsTest.getPSVersion();
const baseContext: string = 'sanity_checkoutFO_orderProduct';

/*
Expand Down Expand Up @@ -162,7 +165,11 @@ test.describe('BO - Checkout : Order a product and check order confirmation', as
test('should Pay by bank wire and confirm order', async () => {
await utilsTest.addContextItem(test.info(), 'testIdentifier', 'confirmOrder', baseContext);

await foClassicCheckoutPage.choosePaymentAndOrder(page, dataPaymentMethods.wirePayment.moduleName);
if (semver.gte(psVersion, '7.1.0')) {
await foClassicCheckoutPage.choosePaymentAndOrder(page, dataPaymentMethods.wirePayment.moduleName);
} else {
await foClassicCheckoutPage.choosePaymentAndOrder(page, '2');
}

const pageTitle = await foClassicCheckoutOrderConfirmationPage.getPageTitle(page);
expect(pageTitle).toEqual(foClassicCheckoutOrderConfirmationPage.pageTitle);
Expand Down
Loading

0 comments on commit 454784a

Please sign in to comment.