Skip to content

Commit 66affd9

Browse files
authored
fix(tests): account for multiple links to Docs (#3645)
1 parent 28fec46 commit 66affd9

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

examples/browser-load-testing-playwright/browser-load-test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export const scenarios = [
3737
const req = await requestPromise;
3838
});
3939
await test.step('Go to docs', async () => {
40-
const docs = await page.getByRole('link', { name: 'Docs' });
41-
await docs.click();
40+
await page.getByRole('link', { name: 'Docs' }).first().click();
4241
await page.waitForURL('https://www.artillery.io/docs');
4342
});
4443

examples/browser-load-testing-playwright/flows.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ async function checkOutArtilleryCoreConceptsFlow(
1515
const req = await requestPromise;
1616
});
1717
await test.step('Go to docs', async () => {
18-
const docs = await page.getByRole('link', { name: 'Docs' });
19-
await docs.click();
18+
await page.getByRole('link', { name: 'Docs' }).first().click();
2019
await page.waitForURL('https://www.artillery.io/docs');
2120
});
2221

examples/browser-playwright-reuse-typescript/e2e/helpers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const goToDocsAndSearch = async (page: Page, step) => {
66
});
77

88
await step('go_to_docs', async () => {
9-
await page.getByRole('link', { name: 'Docs' }).click();
9+
await page.getByRole('link', { name: 'Docs' }).first().click();
1010
await expect(page).toHaveURL('/docs');
1111
await expect(
1212
page.getByText('Get started')

packages/artillery/test/cloud-e2e/fargate/fixtures/adot/flow.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ async function simpleCheck(page, userContext, events, test) {
55
const req = await requestPromise;
66
});
77
await test.step('Go to docs', async () => {
8-
const docs = await page.getByRole('link', { name: 'Docs' });
9-
await docs.click();
8+
await page.getByRole('link', { name: 'Docs' }).first().click();
109
await page.waitForURL('https://www.artillery.io/docs');
1110
});
1211

packages/artillery/test/publish-metrics/fixtures/flow.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ async function simpleCheck(page, userContext, events, test) {
77
const req = await requestPromise;
88
});
99
await test.step('Go to docs', async () => {
10-
const docs = await page.getByRole('link', { name: 'Docs' });
11-
await docs.click();
10+
await page.getByRole('link', { name: 'Docs' }).first().click();
1211
await page.waitForURL('https://www.artillery.io/docs');
1312
});
1413

@@ -32,8 +31,7 @@ async function simpleError(page, userContext, events, test) {
3231
const req = await requestPromise;
3332
});
3433
await test.step('Go to docs', async () => {
35-
const docs = await page.getByRole('link', { name: 'Docs' });
36-
await docs.click();
34+
await page.getByRole('link', { name: 'Docs' }).first().click();
3735
await page.waitForURL('https://www.artillery.io/docs');
3836
});
3937

0 commit comments

Comments
 (0)