Skip to content

Commit

Permalink
Add beforeEach that resets JS errors befor each test, to make sure th…
Browse files Browse the repository at this point in the history
…e reported errors are not cumulated test after test
  • Loading branch information
jolelievre committed Jan 27, 2025
1 parent fe115bd commit 108ae1b
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/01_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe('BO - Dashboard', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/02_orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ describe('BO - Orders', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/03_catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ describe('BO - Catalog', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/04_customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe('BO - Customers', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/05_customerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ describe('BO - Customer Service', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/06_statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ describe('BO - Statistics', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/07_modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ describe('BO - Modules', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/08_design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe('BO - Design', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/09_shipping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ describe('BO - Shipping', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/10_payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ describe('BO - Payment', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/11_international.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('BO - International', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/BO/12_shopParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ describe('BO - Shop Parameters', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/classic/01_guest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe('Check FO public pages', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHome', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/classic/02_connected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ describe('Check FO connected pages', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHome', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/classic/03_cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('Check FO pages in the checkout process', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHomePage', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/hummingbird/01_guest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ describe('Check FO public pages', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHome', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/hummingbird/02_connected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ describe('Check FO connected pages', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHome', baseContext);

Expand Down
4 changes: 4 additions & 0 deletions tests/UI/campaigns/audit/FO/hummingbird/03_cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ describe('Check FO pages in the checkout process', async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});

beforeEach(async () => {
utilsPlaywright.resetJsErrors();
});

it('should go to the home page', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'goToHomePage', baseContext);

Expand Down

0 comments on commit 108ae1b

Please sign in to comment.