@red-hat-developer-hub/e2e-test-utils 1.1.27 → 1.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/playwright/helpers/api-endpoints.d.ts +3 -1
- package/dist/playwright/helpers/api-endpoints.d.ts.map +1 -1
- package/dist/playwright/helpers/api-endpoints.js +3 -1
- package/dist/playwright/helpers/api-helper.d.ts.map +1 -1
- package/dist/playwright/helpers/api-helper.js +10 -0
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@ export declare const GITHUB_API_ENDPOINTS: {
|
|
|
2
2
|
pull: (owner: string, repo: string, state: "open" | "closed" | "all") => string;
|
|
3
3
|
issues: (state: string) => string;
|
|
4
4
|
workflowRuns: string;
|
|
5
|
+
getOrg: (owner: string) => string;
|
|
6
|
+
createRepo: (owner: string) => string;
|
|
7
|
+
getRepo: (owner: string, repo: string) => string;
|
|
5
8
|
deleteRepo: (owner: string, repo: string) => string;
|
|
6
9
|
mergePR: (owner: string, repoName: string, pullNumber: number) => string;
|
|
7
|
-
createRepo: (owner: string) => string;
|
|
8
10
|
pullFiles: (owner: string, repoName: string, pr: number) => string;
|
|
9
11
|
contents: (owner: string, repoName: string) => string;
|
|
10
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-endpoints.d.ts","sourceRoot":"","sources":["../../../src/playwright/helpers/api-endpoints.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;kBACjB,MAAM,QAAQ,MAAM,SAAS,MAAM,GAAG,QAAQ,GAAG,KAAK;oBAGpD,MAAM;;
|
|
1
|
+
{"version":3,"file":"api-endpoints.d.ts","sourceRoot":"","sources":["../../../src/playwright/helpers/api-endpoints.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;kBACjB,MAAM,QAAQ,MAAM,SAAS,MAAM,GAAG,QAAQ,GAAG,KAAK;oBAGpD,MAAM;;oBARE,MAAM;wBAeV,MAAM;qBAjBD,MAAM,QAAQ,MAAM;wBAApB,MAAM,QAAQ,MAAM;qBAuB5B,MAAM,YAAY,MAAM,cAAc,MAAM;uBAG1C,MAAM,YAAY,MAAM,MAAM,MAAM;sBAGrC,MAAM,YAAY,MAAM;CAE3C,CAAC"}
|
|
@@ -7,9 +7,11 @@ export const GITHUB_API_ENDPOINTS = {
|
|
|
7
7
|
pull: (owner, repo, state) => `${getRepoUrl(owner, repo)}/pulls?per_page=${perPage}&state=${state}`,
|
|
8
8
|
issues: (state) => `${backstageShowcaseAPI}/issues?per_page=${perPage}&sort=updated&state=${state}`,
|
|
9
9
|
workflowRuns: `${backstageShowcaseAPI}/actions/runs?per_page=${perPage}`,
|
|
10
|
+
getOrg: getOrgUrl,
|
|
11
|
+
createRepo: (owner) => `${getOrgUrl(owner)}/repos`,
|
|
12
|
+
getRepo: getRepoUrl,
|
|
10
13
|
deleteRepo: getRepoUrl,
|
|
11
14
|
mergePR: (owner, repoName, pullNumber) => `${getRepoUrl(owner, repoName)}/pulls/${pullNumber}/merge`,
|
|
12
|
-
createRepo: (owner) => `${getOrgUrl(owner)}/repos`,
|
|
13
15
|
pullFiles: (owner, repoName, pr) => `${getRepoUrl(owner, repoName)}/pulls/${pr}/files`,
|
|
14
16
|
contents: (owner, repoName) => `${getRepoUrl(owner, repoName)}/contents`,
|
|
15
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-helper.d.ts","sourceRoot":"","sources":["../../../src/playwright/helpers/api-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAgB;IAC/C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,OAAO,CAAc;IAC7B,cAAc,UAAS;WAEV,aAAa,CACxB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE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U,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAY1E;;;;;OAKG;WACU,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ9D;;;;;;OAMG;WACU,0BAA0B,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAkB,GAC5B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAe9B;;;;;OAKG;WACU,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlE;;;;;OAKG;WACU,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB9D;;;;;OAKG;WACU,qBAAqB,CAChC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAe/B"}
|
|
@@ -44,6 +44,16 @@ export class APIHelper {
|
|
|
44
44
|
static async createGitHubRepoWithFile(owner, repoName, filename, fileContent) {
|
|
45
45
|
// Create the repository
|
|
46
46
|
await APIHelper.createGitHubRepo(owner, repoName);
|
|
47
|
+
// Wait until repository is created
|
|
48
|
+
await expect
|
|
49
|
+
.poll(async () => {
|
|
50
|
+
const res = await APIHelper.githubRequest("GET", GITHUB_API_ENDPOINTS.getRepo(owner, repoName));
|
|
51
|
+
return res.status();
|
|
52
|
+
}, {
|
|
53
|
+
timeout: 30_000,
|
|
54
|
+
intervals: [5000],
|
|
55
|
+
})
|
|
56
|
+
.toBe(200);
|
|
47
57
|
// Add the specified file
|
|
48
58
|
await APIHelper.createFileInRepo(owner, repoName, filename, fileContent, `Add ${filename} file`);
|
|
49
59
|
}
|