Skip to content

Commit 1d707aa

Browse files
committed
AXON-804: added close quickpick e2e helper
1 parent a863efa commit 1d707aa

13 files changed

+35
-0
lines changed

e2e/helpers/common.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,11 @@ export const closeAllNotifications = async (page: Page) => {
6969
await page.waitForTimeout(100);
7070
}
7171
};
72+
73+
export const closeOnboardingQuickPick = async (page: Page) => {
74+
const onboardingDismissButton = page.getByRole('button', { name: 'Dismiss' });
75+
if (await onboardingDismissButton.isVisible()) {
76+
await onboardingDismissButton.click();
77+
}
78+
await page.waitForTimeout(500);
79+
};

e2e/setup-mock-repository.sh

100644100755
File mode changed.

e2e/tests/bitbucket/repositoryConnection.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { expect, test } from '@playwright/test';
22
import { authenticateWithBitbucketCloud, connectRepository } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34

45
test.skip('Adding Bitbucket repository works', async ({ page, context }) => {
6+
await closeOnboardingQuickPick(page);
7+
58
await authenticateWithBitbucketCloud(page, context);
69
await page.getByRole('tab', { name: 'Atlassian Settings' }).getByLabel(/close/i).click();
710

e2e/tests/jira/addComment.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test } from '@playwright/test';
22
import { authenticateWithJira, getIssueFrame } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34
import { AtlascodeDrawer, AtlassianSettings, JiraIssuePage } from 'e2e/page-objects';
45

56
const COMMENT_TEXT = 'This is a test comment added via e2e test';
@@ -8,6 +9,7 @@ test('Add comment flow', async ({ page }) => {
89
await authenticateWithJira(page);
910

1011
await new AtlascodeDrawer(page).jira.openIssue('BTS-1 - User Interface Bugs');
12+
await closeOnboardingQuickPick(page);
1113
await new AtlassianSettings(page).closeSettingsPage();
1214

1315
const issueFrame = await getIssueFrame(page);

e2e/tests/jira/assigningFlow.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test } from '@playwright/test';
22
import { createSearchResponse } from 'e2e/fixtures/search';
33
import { authenticateWithJira, cleanupWireMockMapping, getIssueFrame, setupWireMockMapping } from 'e2e/helpers';
4+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
45
import { AtlascodeDrawer, AtlassianSettings } from 'e2e/page-objects';
56

67
test('Assigning Jira issue to myself works', async ({ page, request }) => {
@@ -10,6 +11,7 @@ test('Assigning Jira issue to myself works', async ({ page, request }) => {
1011
test.setTimeout(50_000);
1112

1213
await authenticateWithJira(page);
14+
await closeOnboardingQuickPick(page);
1315

1416
await new AtlassianSettings(page).closeSettingsPage();
1517
await new AtlascodeDrawer(page).jira.openIssue('BTS-1 - User Interface Bugs');

e2e/tests/jira/attachFile.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { test } from '@playwright/test';
22
import { attachment } from 'e2e/fixtures/attachment';
33
import { authenticateWithJira, getIssueFrame, setupIssueMock } from 'e2e/helpers';
4+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
45
import { AtlascodeDrawer, AtlassianSettings, JiraIssuePage } from 'e2e/page-objects';
56

67
const FILE_NAME = 'test.jpg';
78
const FILE_PATH = `e2e/wiremock-mappings/mockedteams/test-files/${FILE_NAME}`;
89

910
test('Test upload image to attachments', async ({ page, request }) => {
1011
await authenticateWithJira(page);
12+
await closeOnboardingQuickPick(page);
1113

1214
await new AtlassianSettings(page).closeSettingsPage();
1315
await new AtlascodeDrawer(page).jira.openIssue('BTS-1 - User Interface Bugs');

e2e/tests/jira/checkImageInDescription.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { expect, test } from '@playwright/test';
22
import { authenticateWithJira, getIssueFrame } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34
import { AtlascodeDrawer, AtlassianSettings } from 'e2e/page-objects';
45

56
test('Test image display in ticket description', async ({ page }) => {
67
await authenticateWithJira(page);
8+
await closeOnboardingQuickPick(page);
9+
710
await new AtlassianSettings(page).closeSettingsPage();
811
await new AtlascodeDrawer(page).jira.openIssue('BTS-1 - User Interface Bugs');
912

e2e/tests/jira/commentWithImage.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { expect, test } from '@playwright/test';
22
import { authenticateWithJira, getIssueFrame, setupIssueMock } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34
import { AtlascodeDrawer, AtlassianSettings } from 'e2e/page-objects';
45

56
const IMAGE_SRC = 'https://mockedteams.atlassian.net/secure/attachment/10001/test-image.jpg';
67
const COMMENT_CONTENT = `<p><span class="image-wrap" style=""><img src="${IMAGE_SRC}" alt="test-image.jpg" height="360" width="540" style="border: 0px solid black" /></span></p>`;
78

89
test('View image in Jira comment', async ({ page, request }) => {
910
await authenticateWithJira(page);
11+
await closeOnboardingQuickPick(page);
12+
1013
await new AtlassianSettings(page).closeSettingsPage();
1114

1215
const cleanupIssueMock = await setupIssueMock(request, { comment: COMMENT_CONTENT });

e2e/tests/jira/createIssue.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test } from '@playwright/test';
22
import { authenticateWithJira } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34
import { AppNotifications, AtlascodeDrawer, AtlassianSettings, CreateIssuePage } from 'e2e/page-objects';
45

56
const NEW_ISSUE_SUMMARY = 'Test Issue Created via E2E Test';
@@ -10,6 +11,7 @@ test('Create an issue via side panel flow', async ({ page }) => {
1011

1112
const atlascodeDrawer = new AtlascodeDrawer(page);
1213
await atlascodeDrawer.openCreateIssuePage();
14+
await closeOnboardingQuickPick(page);
1315

1416
await new AtlassianSettings(page).closeSettingsPage();
1517

e2e/tests/jira/renameIssue.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { test } from '@playwright/test';
22
import { authenticateWithJira, getIssueFrame, setupIssueMock } from 'e2e/helpers';
3+
import { closeOnboardingQuickPick } from 'e2e/helpers/common';
34
import { AtlascodeDrawer, AtlassianSettings, JiraIssuePage } from 'e2e/page-objects';
45

56
const OLD_TITLE = '(Sample) User Interface Bugs';
67
const NEW_TITLE = 'Check if renaming works';
78

89
test('Rename Jira issue', async ({ page, request }) => {
910
await authenticateWithJira(page);
11+
await closeOnboardingQuickPick(page);
1012

1113
await new AtlassianSettings(page).closeSettingsPage();
1214
await new AtlascodeDrawer(page).jira.openIssue('BTS-1 - User Interface Bugs');

0 commit comments

Comments
 (0)