@red-hat-developer-hub/e2e-test-utils 1.1.26 → 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/deployment/orchestrator/install-orchestrator.sh +1 -4
- 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 +3 -2
|
@@ -105,9 +105,7 @@ log::success() {
|
|
|
105
105
|
# Operator subscription and status
|
|
106
106
|
# ---------------------------------------------------------------------------
|
|
107
107
|
install_subscription() {
|
|
108
|
-
local name=$1 namespace=$2 channel=$3 package=$4 source_name=$5 source_namespace=$6
|
|
109
|
-
local spec_extra=""
|
|
110
|
-
[[ -n "$starting_csv" ]] && spec_extra=" startingCSV: $starting_csv"
|
|
108
|
+
local name=$1 namespace=$2 channel=$3 package=$4 source_name=$5 source_namespace=$6
|
|
111
109
|
oc apply -f - << EOD
|
|
112
110
|
apiVersion: operators.coreos.com/v1alpha1
|
|
113
111
|
kind: Subscription
|
|
@@ -120,7 +118,6 @@ spec:
|
|
|
120
118
|
name: $package
|
|
121
119
|
source: $source_name
|
|
122
120
|
sourceNamespace: $source_namespace
|
|
123
|
-
${spec_extra}
|
|
124
121
|
EOD
|
|
125
122
|
return 0
|
|
126
123
|
}
|
|
@@ -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,MAAM,GAAG,MAAM,GACrB,OAAO,CAAC,WAAW,CAAC;WAuBV,yBAAyB,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAU,EAClB,QAAQ,GAAE,OAAO,EAAO,GACvB,OAAO,CAAC,OAAO,EAAE,CAAC;WAmBR,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;WAYhD,wBAAwB,CACnC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM;
|
|
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,OAA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epoWithFile(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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/e2e-test-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"description": "Test utilities for RHDH E2E tests",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"clean": "rm -rf dist",
|
|
69
69
|
"lint:check": "eslint . --ignore-pattern dist --ignore-pattern README.md --ignore-pattern docs",
|
|
70
70
|
"lint:fix": "eslint . --fix --ignore-pattern dist --ignore-pattern README.md --ignore-pattern docs",
|
|
71
|
+
"prepack": "yarn build",
|
|
71
72
|
"prepublishOnly": "yarn build",
|
|
72
73
|
"prettier:check": "prettier --check . '!dist' '!README.md' '!docs' '!.github/workflows/deploy-docs.yml'",
|
|
73
74
|
"prettier:fix": "prettier --write . '!dist' '!README.md' '!docs' '!.github/workflows/deploy-docs.yml'",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"@axe-core/playwright": "^4.11.0",
|
|
105
106
|
"@backstage-community/plugin-rbac-common": "1.23.0",
|
|
106
107
|
"@eslint/js": "^9.39.1",
|
|
107
|
-
"@keycloak/keycloak-admin-client": "
|
|
108
|
+
"@keycloak/keycloak-admin-client": "26.5.6",
|
|
108
109
|
"@kubernetes/client-node": "^1.4.0",
|
|
109
110
|
"eslint": "^9.39.1",
|
|
110
111
|
"eslint-plugin-check-file": "^3.3.1",
|