Skip to content

Commit

Permalink
update-dx-config-file (#373)
Browse files Browse the repository at this point in the history
updating config file to user process.env.PR_BRANCH_LIVE_URL if exist
wait time changes
  • Loading branch information
cod17828 authored Jun 11, 2024
1 parent 800e576 commit a9bb65a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
17 changes: 4 additions & 13 deletions configs/dx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,24 @@ const config = {
actionTimeout: 60000,

trace: 'on-first-retry',
baseURL: process.env.BASE_URL || envs['@dx_stage'] || 'https://stage--dx-partners--adobecom.hlx.live',
baseURL: process.env.PR_BRANCH_LIVE_URL || envs['@dx_stage'] || 'https://stage--dx-partners--adobecom.hlx.live',
},

/* Configure projects for major browsers */
projects: [
{
name: 'dx-live-chromium',
use: {
...devices['Desktop Chrome'],
baseURL: envs['@dx_stage'],
},
use: { ...devices['Desktop Chrome'] },
},

{
name: 'dx-live-firefox',
use: {
...devices['Desktop Firefox'],
baseURL: envs['@dx_stage'],
},
use: { ...devices['Desktop Firefox'] },
},

{
name: 'dx-live-webkit',
use: {
...devices['Desktop Safari'],
baseURL: envs['@dx_stage'],
},
use: { ...devices['Desktop Safari'] },
},
],
};
Expand Down
8 changes: 4 additions & 4 deletions tests/dx/news.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.describe('Validate news block', () => {
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
await test.step('Go to News page', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 30000 });
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 3000 });
const result = await newsPage.resultNumber.textContent();
await expect(parseInt(result.split(' ')[0], 10)).toBeGreaterThan(6);
});
Expand All @@ -39,7 +39,7 @@ test.describe('Validate news block', () => {
await test.step('Clear all', async () => {
await newsPage.clearAllSelector.click();
const result = await newsPage.resultNumber.textContent();
await expect(parseInt(result.split(' ')[0], 10)).toBeGreaterThan(7);
await expect(parseInt(result.split(' ')[0], 10)).toBeGreaterThan(6);
});

await test.step('Enter This is automation in search field', async () => {
Expand All @@ -52,7 +52,7 @@ test.describe('Validate news block', () => {
test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
await test.step('Go to News page', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 30000 });
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 3000 });
const result = await newsPage.resultNumber.textContent();
await expect(parseInt(result.split(' ')[0], 10)).toBeGreaterThan(6);
});
Expand Down Expand Up @@ -81,7 +81,7 @@ test.describe('Validate news block', () => {
test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
await test.step('Go to News page', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 30000 });
await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 3000 });
const result = await newsPage.resultNumber.textContent();
await expect(parseInt(result.split(' ')[0], 10)).toBeGreaterThan(6);
});
Expand Down

0 comments on commit a9bb65a

Please sign in to comment.