Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
TARGET: ${{ matrix.target }}

- name: Upload E2E artifacts (${{ matrix.target }})
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results-${{ matrix.target }}
Expand Down
1 change: 1 addition & 0 deletions e2e/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { authenticateWithBitbucketDC, authenticateWithBitbucketCloud } from './b
export { authenticateWithJiraCloud, authenticateWithJiraDC } from './jira-auth';
export { getIssueFrame, openAtlassianSettings, closeOnboardingQuickPick } from './common';
export {
resetWireMockMappings,
cleanupWireMockMapping,
setupWireMockMapping,
setupSearchMock,
Expand Down
9 changes: 9 additions & 0 deletions e2e/helpers/setup-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ import { DetailedSiteInfo } from 'src/atlclients/authInfo';
import { JiraTypes, PullRequestComment } from './types';
import { updateIssueField } from './update-jira-issue';

/**
* Helper function to reset all WireMock mappings
* This should be called before each test to prevent state pollution from previous tests
*/
export const resetWireMockMappings = async ({ request }: { request: APIRequestContext }) => {
await request.post('http://wiremock-mockedteams:8080/__admin/mappings/reset');
await request.post('http://wiremock-bitbucket:8080/__admin/mappings/reset');
};

/**
* Helper function to set up WireMock mapping
*/
Expand Down
1 change: 0 additions & 1 deletion e2e/scenarios/bitbucket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { connectRepository } from './connectRepository.spec';
import { createPullRequest } from './createPullRequest.spec';
import { startWorkFlow } from './startWorkFlow.spec';
import { viewPullRequest } from './viewPullRequest.spec';

export const bitbucketScenarios = [
{ name: 'Authenticate with Bitbucket', run: authFlow },
{ name: 'Connect repository', run: connectRepository },
Expand Down
6 changes: 5 additions & 1 deletion e2e/scenarios/bitbucket/startWorkFlow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
authenticateWithJiraCloud,
authenticateWithJiraDC,
getIssueFrame,
resetWireMockMappings,
setupIssueMock,
setupSearchMock,
} from 'e2e/helpers';
Expand All @@ -14,7 +15,10 @@ const CURRENT_STATUS = 'To Do';
const NEXT_STATUS = 'In Progress';

export async function startWorkFlow(page: Page, type: BitbucketTypes, request: APIRequestContext) {
test.setTimeout(50_000);
// This test is large and may run longer on slower machines
test.setTimeout(60_000);
await resetWireMockMappings({ request });

// Login to Jira
if (type === BitbucketTypes.Cloud) {
await authenticateWithJiraCloud(page);
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/jira/jiraCloud.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { test } from '@playwright/test';
import { authenticateWithJiraCloud, closeOnboardingQuickPick } from 'e2e/helpers';
import { authenticateWithJiraCloud, closeOnboardingQuickPick, resetWireMockMappings } from 'e2e/helpers';
import { JiraTypes } from 'e2e/helpers/types';
import { jiraCloudScenarios, unAuthenticatedJiraScenarios } from 'e2e/scenarios/jira';

test.describe('Jira Cloud', () => {
test.beforeEach(resetWireMockMappings);

// Unauthenticated scenarios
for (const scenario of unAuthenticatedJiraScenarios) {
test(scenario.name, async ({ page }) => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/jira/jiraDC.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { test } from '@playwright/test';
import { authenticateWithJiraDC, closeOnboardingQuickPick } from 'e2e/helpers';
import { authenticateWithJiraDC, closeOnboardingQuickPick, resetWireMockMappings } from 'e2e/helpers';
import { JiraTypes } from 'e2e/helpers/types';
import { jiraDCScenarios } from 'e2e/scenarios/jira';

test.describe('Jira DC', () => {
test.beforeEach(resetWireMockMappings);

for (const scenario of jiraDCScenarios) {
test(scenario.name, async ({ page, request }) => {
await authenticateWithJiraDC(page);
Expand Down
4 changes: 4 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { defineConfig } from '@playwright/test';

export default defineConfig({
retries: 3,
reporter: [
['list'],
['github'],
],
use: {
viewport: {
width: 1600,
Expand Down
Loading