Skip to content

Commit

Permalink
fix test for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonja Popovic committed Feb 21, 2025
1 parent 44c04b3 commit add1ef8
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions nala/blocks/news/news.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ test.describe('Validate news block', () => {
});
});

test(`${features[6].name},${features[6].tags}`, async ({ page, context, baseURL }) => {
test(`${features[6].name},${features[6].tags}`, async ({ page, context, baseURL, browserName}) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[6];
await test.step('Click Sign In', async () => {
await page.goto(`${baseURL}${path}`);
Expand Down Expand Up @@ -297,7 +300,10 @@ test.describe('Validate news block', () => {
});
});

test(`${features[7].name},${features[7].tags}`, async ({ page, context, baseURL }) => {
test(`${features[7].name},${features[7].tags}`, async ({ page, context, baseURL, browserName }) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[7];
await findCardsForPartnerLevel(
page,
Expand All @@ -307,7 +313,10 @@ test.describe('Validate news block', () => {
);
});

test(`${features[8].name},${features[8].tags}`, async ({ page, context, baseURL }) => {
test(`${features[8].name},${features[8].tags}`, async ({ page, context, baseURL, browserName }) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[8];
await findCardsForPartnerLevel(
page,
Expand All @@ -317,7 +326,10 @@ test.describe('Validate news block', () => {
);
});

test(`${features[9].name},${features[9].tags}`, async ({ page, context, baseURL }) => {
test(`${features[9].name},${features[9].tags}`, async ({ page, context, baseURL, browserName }) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[9];
await findCardsForPartnerLevel(
page,
Expand All @@ -327,7 +339,10 @@ test.describe('Validate news block', () => {
);
});

test(`${features[10].name},${features[10].tags}`, async ({ page, context, baseURL }) => {
test(`${features[10].name},${features[10].tags}`, async ({ page, context, baseURL, browserName }) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[10];
await test.step('Click Sign In', async () => {
await findCardsForPartnerLevel(
Expand All @@ -339,7 +354,10 @@ test.describe('Validate news block', () => {
});
});

test(`${features[11].name},${features[11].tags}`, async ({ page, context, baseURL }) => {
test(`${features[11].name},${features[11].tags}`, async ({ page, context, baseURL, browserName }) => {
if (browserName === 'firefox') {
test.slow();
}
const { data, path } = features[11];
await test.step('Go to stage.adobe.com', async () => {
await page.goto(`${baseURL}${path}`);
Expand All @@ -352,7 +370,7 @@ test.describe('Validate news block', () => {
const newTab = await context.newPage();
await newTab.goto(`${path}`);
const newTabPage = new NewsPage(newTab);
await newTab.waitForSelector('.partner-cards-cards-results', { state: 'visible' });
await newTabPage.firstCardDate.waitFor({ state: 'visible', timeout: 20000 });
const resultCards = await newTabPage.resultNumber.textContent();
await expect(parseInt(resultCards.split(' ')[0], 10)).toBe(data.numberOfPublicCards);
});
Expand Down

0 comments on commit add1ef8

Please sign in to comment.