Skip to content

Commit

Permalink
Merge pull request PrestaShop#36514 from Progi1984/uiTestsRemoveTodo
Browse files Browse the repository at this point in the history
Nightly : Enable UI Tests after merge Hummingbird
  • Loading branch information
Progi1984 authored Jul 9, 2024
2 parents c897d8e + 3e309c6 commit 0c10534
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(pageTitle).to.equal(myAccountPage.pageTitle);
});

// @todo https://github.com/PrestaShop/hummingbird/pull/600
it.skip('should go to \'GDPR - Personal data\' page', async function () {
it('should go to \'GDPR - Personal data\' page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToGDPRPage1', baseContext);

await myAccountPage.goToMyGDPRPersonalDataPage(page);
Expand All @@ -164,7 +163,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(pageTitle).to.equal(gdprPersonalDataPage.pageTitle);
});

it.skip('should click on \'Get my data to PDF file\'', async function () {
it('should click on \'Get my data to PDF file\'', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'clickOnGetMyDataToPDF1', baseContext);

filePath = await gdprPersonalDataPage.exportDataToPDF(page);
Expand Down Expand Up @@ -248,7 +247,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(imageNumber).to.be.equal(1);
});

it.skip('should check the date and the customer name', async function () {
it('should check the date and the customer name', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkDateAndCustomerName', baseContext);

const isVisible = await utilsFile.isTextInPDF(
Expand All @@ -259,7 +258,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(isVisible, 'The date and the customer name are not correct!').to.eq(true);
});

it.skip('should check general info', async function () {
it('should check general info', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkGeneralInfo', baseContext);

const age = await utilsCore.age(customerData.birthDate);
Expand All @@ -272,36 +271,36 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(isVisible, 'General info is not correct!').to.eq(true);
});

it.skip('should check that Addresses table is empty', async function () {
it('should check that Addresses table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkThatAddressesTableIsEmpty', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'No addresses ', true);
expect(isVisible, 'Addresses table is not empty!').to.eq(true);
});

it.skip('should check that Orders table is empty', async function () {
it('should check that Orders table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkThatOrdersTableIsEmpty', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Orders Reference Payment Order state '
+ 'Total paid Date No orders', true);
expect(isVisible, 'Orders table is not empty!').to.eq(true);
});

it.skip('should check that Carts table is empty', async function () {
it('should check that Carts table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkThatCartsTableIsEmpty1', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Carts Id Total products Date No carts', true);
expect(isVisible, 'Carts table is not empty!').to.eq(true);
});

it.skip('should check that Messages table is empty', async function () {
it('should check that Messages table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkThatMessagesTableIsEmpty', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Messages IP Message Date No messages', true);
expect(isVisible, 'Messages table is not empty!').to.eq(true);
});

it.skip('should check Last connections table', async function () {
it('should check Last connections table', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkLastConnectionsTable1', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Last connections Origin request Page viewed '
Expand All @@ -310,22 +309,22 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
expect(isVisible, 'The data in Last connections table is not correct!').to.eq(true);
});

it.skip('should check that Newsletter subscription table is empty', async function () {
it('should check that Newsletter subscription table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkNewsletterSubscriptionTable', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Module : Newsletter subscription 0 Newsletter '
+ 'subscription: no email to export this customer has not registered.', true);
expect(isVisible, 'Newsletter subscription table is not empty!').to.eq(true);
});

it.skip('should check that Module product comments is empty', async function () {
it('should check that Module product comments is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkModuleProductComments', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Module : Product Comments ', true);
expect(isVisible, 'Products comments is not empty!').to.eq(true);
});

it.skip('should check that mail alerts table is empty', async function () {
it('should check that mail alerts table is empty', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkModuleMailAlerts', baseContext);

const isVisible = await utilsFile.isTextInPDF(filePath, 'Module : Mail alerts 0 Mail alert: Unable to export '
Expand All @@ -335,7 +334,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
});
});

describe.skip('Check GDPR PDF file after create a cart', async () => {
describe('Check GDPR PDF file after create a cart', async () => {
describe('Add a product to the cart and download PDF file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount2', baseContext);
Expand Down Expand Up @@ -453,7 +452,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
});
});

describe.skip('Check GDPR PDF file after create an order and an address', async () => {
describe('Check GDPR PDF file after create an order and an address', async () => {
describe('Create an order and download PDF file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount3', baseContext);
Expand Down Expand Up @@ -615,7 +614,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
});
});

describe.skip('Check GDPR PDF file after send a message', async () => {
describe('Check GDPR PDF file after send a message', async () => {
describe('Send message and download PDF file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount4', baseContext);
Expand Down Expand Up @@ -754,7 +753,7 @@ describe('FO - Account : Get GDPR data in PDF', async () => {
});
});

describe.skip('Check GDPR PDF file after logout and login in FO', async () => {
describe('Check GDPR PDF file after logout and login in FO', async () => {
describe('Logout then login and download PDF file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount5', baseContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
expect(pageTitle).to.equal(myAccountPage.pageTitle);
});

// @todo https://github.com/PrestaShop/hummingbird/pull/600
it.skip('should go to \'GDPR - Personal data\' page', async function () {
it('should go to \'GDPR - Personal data\' page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToGDPRPage1', baseContext);

await myAccountPage.goToMyGDPRPersonalDataPage(page);
Expand All @@ -162,7 +161,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
expect(pageTitle).to.equal(gdprPersonalDataPage.pageTitle);
});

it.skip('should click on \'Get my data to CSV\'', async function () {
it('should click on \'Get my data to CSV\'', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'clickOnGetMyDataToCSV1', baseContext);

filePath = await gdprPersonalDataPage.exportDataToCSV(page);
Expand All @@ -172,7 +171,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Get personal information from BO', async () => {
describe('Get personal information from BO', async () => {
it('should login in BO', async function () {
await loginCommon.loginBO(this, page);
});
Expand Down Expand Up @@ -236,7 +235,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Check GDPR data in CSV', async () => {
describe('Check GDPR data in CSV', async () => {
it('should check general info', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkGeneralInfo', baseContext);

Expand Down Expand Up @@ -362,7 +361,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Check GDPR CSV file after create a cart', async () => {
describe('Check GDPR CSV file after create a cart', async () => {
describe('Add a product to the cart and download CSV file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount2', baseContext);
Expand Down Expand Up @@ -485,7 +484,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Check GDPR CSV file after create an order and an address', async () => {
describe('Check GDPR CSV file after create an order and an address', async () => {
describe('Create an order and download CSV file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount3', baseContext);
Expand Down Expand Up @@ -661,7 +660,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Check GDPR CSV file after send a message', async () => {
describe('Check GDPR CSV file after send a message', async () => {
describe('Send message and download CSV file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount4', baseContext);
Expand Down Expand Up @@ -815,7 +814,7 @@ describe('FO - Account : Get GDPR data in CSV', async () => {
});
});

describe.skip('Check GDPR CSV file after logout and login in FO', async () => {
describe('Check GDPR CSV file after logout and login in FO', async () => {
describe('Logout then login and download CSV file', async () => {
it('should go to FO home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToFoToCreateAccount5', baseContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ describe('FO - Account : Contact us on GDPR page', async () => {
expect(pageTitle).to.equal(myAccountPage.pageTitle);
});

// @todo https://github.com/PrestaShop/hummingbird/pull/600
it.skip('should go to \'GDPR - Personal data\' page', async function () {
it('should go to \'GDPR - Personal data\' page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToGDPRPage', baseContext);

await myAccountPage.goToMyGDPRPersonalDataPage(page);
Expand All @@ -104,7 +103,7 @@ describe('FO - Account : Contact us on GDPR page', async () => {
expect(pageTitle).to.equal(gdprPersonalDataPage.pageTitle);
});

it.skip('should click on \'Contact page\' link from Rectification & Erasure requests block', async function () {
it('should click on \'Contact page\' link from Rectification & Erasure requests block', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToContactUsPage', baseContext);

await gdprPersonalDataPage.goToContactUsPage(page);
Expand All @@ -113,7 +112,7 @@ describe('FO - Account : Contact us on GDPR page', async () => {
expect(pageTitle).to.equal(contactUsPage.pageTitle);
});

it.skip('should send message to customer service', async function () {
it('should send message to customer service', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'sendMessage', baseContext);

await contactUsPage.sendMessage(page, contactUsData, `${contactUsData.fileName}.txt`);
Expand All @@ -122,11 +121,11 @@ describe('FO - Account : Contact us on GDPR page', async () => {
expect(validationMessage).to.equal(contactUsPage.validationMessage);
});

it.skip('should login in BO', async function () {
it('should login in BO', async function () {
await loginCommon.loginBO(this, page);
});

it.skip('should go to customer service page', async function () {
it('should go to customer service page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToOrderMessagesPage', baseContext);

await boDashboardPage.goToSubMenu(
Expand All @@ -139,14 +138,14 @@ describe('FO - Account : Contact us on GDPR page', async () => {
expect(pageTitle).to.contains(customerServicePage.pageTitle);
});

it.skip('should check message', async function () {
it('should check message', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkMessage', baseContext);

const message = await customerServicePage.getTextColumn(page, 1, 'message');
expect(message).to.contain(contactUsData.message);
});

it.skip('should delete the message', async function () {
it('should delete the message', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'deleteMessage', baseContext);

const textResult = await customerServicePage.deleteMessage(page, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,31 +198,25 @@ describe('FO - Product page - Product page : Display discount', async () => {
expect(productQuantity).to.equal(3);
});

// @todo : https://github.com/PrestaShop/hummingbird/issues/616
it('should check the tag \'New, -€2.00\'', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkFlag', baseContext);

this.skip();

const flagText = await foProductPage.getProductTag(page);
expect(flagText).to.contains('-€2.00')
.and.to.contain('New');
});

// @todo : https://github.com/PrestaShop/hummingbird/issues/616
it('should check the product price before and after the discount', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkProductPrice', baseContext);

this.skip();

const discountValue = await foProductPage.getDiscountAmount(page);
expect(discountValue).to.equal('(Save €2.00)');

const finalPrice = await foProductPage.getProductPrice(page);
expect(finalPrice).to.equal('€22.00');
expect(finalPrice).to.equal('€18.00');

const regularPrice = await foProductPage.getRegularPrice(page);
expect(regularPrice).to.equal('€24.00');
expect(regularPrice).to.equal('€20.00');
});

it('should add the product to cart and check the block cart modal', async function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/UI/pages/FO/classic/myAccount/gdprPersonalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GDPRPersonalDataPage extends FOBasePage {

private readonly exportDataToPDFButton: string;

private readonly contactUsHyperLink: string;
protected contactUsHyperLink: string;

private readonly exportDataToCSVButton: string;

Expand Down
3 changes: 3 additions & 0 deletions tests/UI/pages/FO/hummingbird/myAccount/gdprPersonalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class GDPRPersonalData extends GDPRPersonalDataPage {
*/
constructor() {
super('hummingbird');

// Selectors
this.contactUsHyperLink = 'section.page-content a[href*=\'contact-us\']';
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/UI/pages/FO/hummingbird/product/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class ProductPage extends Product {
*/
async setQuantity(page: Page, quantity: number | string): Promise<void> {
await this.setValue(page, this.productQuantity, quantity);
await page.locator(this.productQuantity).dispatchEvent('change');
await page.waitForTimeout(4000);
}
}

Expand Down

0 comments on commit 0c10534

Please sign in to comment.