Skip to content

Commit 329cd32

Browse files
AXON-819 setup for e2e tests (#707)
1 parent 34dbf55 commit 329cd32

28 files changed

+1287
-10
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { test as base } from '@playwright/test';
2+
3+
export const test = base.extend<{ forEachTest: void }>({
4+
forEachTest: [
5+
async ({ page }, use) => {
6+
await use();
7+
8+
// after test script
9+
await page.getByRole('button', { name: 'Manage' }).click();
10+
await page.waitForTimeout(250);
11+
await page.getByRole('menuitem', { name: 'Command Palette' }).click();
12+
await page.waitForTimeout(500);
13+
await page.keyboard.type('Workspaces: Close Workspace');
14+
await page.waitForTimeout(250);
15+
await page.keyboard.press('Enter');
16+
await page.waitForTimeout(1500);
17+
},
18+
{ auto: true },
19+
],
20+
});

e2e/helpers/update-jira-issue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defaultComment } from '../fixtures/comments';
1+
import { defaultComment } from '../mock-data/comments';
22
import type { FieldUpdater } from './types';
33

44
const updateAttachment: FieldUpdater = (issue, value) => {
File renamed without changes.
File renamed without changes.
File renamed without changes.

e2e/setup-mock-repository.sh

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -e
33

44
echo "Setting up global git configuration..."
5-
git config --global user.name "Test User"
6-
git config --global user.email "[email protected]"
5+
git config --global user.name "Mock User"
6+
git config --global user.email "[email protected]"
77
git config --global init.defaultBranch main
88

99
echo "Creating mock repository that simulates a Bitbucket clone..."
@@ -14,7 +14,7 @@ cd /mock-repository
1414
git init
1515

1616
# Add remote and configure it properly (like git clone does)
17-
git remote add origin [email protected]/test-repository.git
17+
git remote add origin [email protected]:mockuser/test-repository.git
1818
git config branch.main.remote origin
1919
git config branch.main.merge refs/heads/main
2020
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

e2e/tests/jira/assigningFlow.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test } from '@playwright/test';
2-
import { createSearchResponse } from 'e2e/fixtures/search';
32
import { authenticateWithJira, cleanupWireMockMapping, getIssueFrame, setupWireMockMapping } from 'e2e/helpers';
3+
import { createSearchResponse } from 'e2e/mock-data/search';
44
import { AtlascodeDrawer, AtlassianSettings } from 'e2e/page-objects';
55

66
test('Assigning Jira issue to myself works', async ({ page, request }) => {

e2e/tests/jira/attachFile.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test } from '@playwright/test';
2-
import { attachment } from 'e2e/fixtures/attachment';
32
import { authenticateWithJira, getIssueFrame, setupIssueMock } from 'e2e/helpers';
3+
import { attachment } from 'e2e/mock-data/attachment';
44
import { AtlascodeDrawer, AtlassianSettings, JiraIssuePage } from 'e2e/page-objects';
55

66
const FILE_NAME = 'test.jpg';

e2e/wiremock-mappings/bitbucket/access-token-bb-cloud.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"jsonBody": {
99
"access_token": "mocked_token",
1010
"token_type": "bearer",
11-
"expires_in": 3600
11+
"expires_in": 3600,
12+
"refresh_token": "mocked_refresh_token"
1213
},
1314
"headers": {
1415
"Content-Type": "application/json"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"request": {
3+
"method": "GET",
4+
"urlPath": "/2.0/repositories/mockuser/test-repository/branching-model"
5+
},
6+
"response": {
7+
"status": 200,
8+
"jsonBody": {
9+
"type": "branching_model",
10+
"links": {
11+
"self": {
12+
"href": "https://api.bitbucket.org/2.0/repositories/mockuser/test-repository/branching-model"
13+
}
14+
},
15+
"branch_types": [{
16+
"kind": "bugfix",
17+
"prefix": "bugfix/"
18+
}, {
19+
"kind": "feature",
20+
"prefix": "feature/"
21+
}, {
22+
"kind": "hotfix",
23+
"prefix": "hotfix/"
24+
}, {
25+
"kind": "release",
26+
"prefix": "release/"
27+
}],
28+
"development": {
29+
"name": "main",
30+
"use_mainbranch": true,
31+
"branch": {
32+
"name": "main",
33+
"target": {
34+
"hash": "123abc"
35+
},
36+
"type": "branch"
37+
}
38+
}
39+
},
40+
"headers": {
41+
"Content-Type": "application/json",
42+
"x-ausername": "mockedUser"
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)