@camunda/e2e-test-suite 0.0.1329 → 0.0.1330
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/.github/c8_versions.json +1 -0
- package/README.md +1 -0
- package/dist/fixtures/8.11.d.ts +83 -0
- package/dist/fixtures/8.11.js +203 -0
- package/dist/pages/8.11/AppsPage.d.ts +60 -0
- package/dist/pages/8.11/AppsPage.js +1060 -0
- package/dist/pages/8.11/AuditLogPage.d.ts +14 -0
- package/dist/pages/8.11/AuditLogPage.js +69 -0
- package/dist/pages/8.11/Authorization.d.ts +44 -0
- package/dist/pages/8.11/Authorization.js +409 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.d.ts +12 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.js +36 -0
- package/dist/pages/8.11/ClusterDetailsPage.d.ts +107 -0
- package/dist/pages/8.11/ClusterDetailsPage.js +892 -0
- package/dist/pages/8.11/ClusterPage.d.ts +96 -0
- package/dist/pages/8.11/ClusterPage.js +657 -0
- package/dist/pages/8.11/ClusterSecretsPage.d.ts +48 -0
- package/dist/pages/8.11/ClusterSecretsPage.js +406 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.d.ts +29 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.js +156 -0
- package/dist/pages/8.11/ConnectorSettingsPage.d.ts +39 -0
- package/dist/pages/8.11/ConnectorSettingsPage.js +150 -0
- package/dist/pages/8.11/ConnectorTemplatePage.d.ts +11 -0
- package/dist/pages/8.11/ConnectorTemplatePage.js +34 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.d.ts +77 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.js +457 -0
- package/dist/pages/8.11/DataFiltersPage.d.ts +30 -0
- package/dist/pages/8.11/DataFiltersPage.js +135 -0
- package/dist/pages/8.11/FormJsPage.d.ts +38 -0
- package/dist/pages/8.11/FormJsPage.js +283 -0
- package/dist/pages/8.11/HomePage.d.ts +29 -0
- package/dist/pages/8.11/HomePage.js +176 -0
- package/dist/pages/8.11/IdpCreatePage.d.ts +118 -0
- package/dist/pages/8.11/IdpCreatePage.js +514 -0
- package/dist/pages/8.11/LoginPage.d.ts +45 -0
- package/dist/pages/8.11/LoginPage.js +214 -0
- package/dist/pages/8.11/ModelerCreatePage.d.ts +256 -0
- package/dist/pages/8.11/ModelerCreatePage.js +2272 -0
- package/dist/pages/8.11/ModelerHomePage.d.ts +100 -0
- package/dist/pages/8.11/ModelerHomePage.js +1168 -0
- package/dist/pages/8.11/ModelerUserInvitePage.d.ts +29 -0
- package/dist/pages/8.11/ModelerUserInvitePage.js +136 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.d.ts +11 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.js +25 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.js +128 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.d.ts +38 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.js +176 -0
- package/dist/pages/8.11/OCIdentityHomePage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityHomePage.js +111 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.d.ts +23 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.js +124 -0
- package/dist/pages/8.11/OCIdentityRolesPage.d.ts +43 -0
- package/dist/pages/8.11/OCIdentityRolesPage.js +236 -0
- package/dist/pages/8.11/OperateHomePage.d.ts +28 -0
- package/dist/pages/8.11/OperateHomePage.js +150 -0
- package/dist/pages/8.11/OperateProcessInstancePage.d.ts +43 -0
- package/dist/pages/8.11/OperateProcessInstancePage.js +893 -0
- package/dist/pages/8.11/OperateProcessesPage.d.ts +28 -0
- package/dist/pages/8.11/OperateProcessesPage.js +153 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.d.ts +30 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.js +175 -0
- package/dist/pages/8.11/OptimizeDashboardPage.d.ts +11 -0
- package/dist/pages/8.11/OptimizeDashboardPage.js +71 -0
- package/dist/pages/8.11/OptimizeHomePage.d.ts +17 -0
- package/dist/pages/8.11/OptimizeHomePage.js +171 -0
- package/dist/pages/8.11/OptimizeReportPage.d.ts +49 -0
- package/dist/pages/8.11/OptimizeReportPage.js +184 -0
- package/dist/pages/8.11/OptimizeSharePage.d.ts +16 -0
- package/dist/pages/8.11/OptimizeSharePage.js +100 -0
- package/dist/pages/8.11/PlayPage.d.ts +17 -0
- package/dist/pages/8.11/PlayPage.js +157 -0
- package/dist/pages/8.11/ProcessApplicationPage.d.ts +32 -0
- package/dist/pages/8.11/ProcessApplicationPage.js +496 -0
- package/dist/pages/8.11/SettingsPage.d.ts +10 -0
- package/dist/pages/8.11/SettingsPage.js +53 -0
- package/dist/pages/8.11/SignUpPage.d.ts +42 -0
- package/dist/pages/8.11/SignUpPage.js +134 -0
- package/dist/pages/8.11/TaskDetailsPage.d.ts +77 -0
- package/dist/pages/8.11/TaskDetailsPage.js +324 -0
- package/dist/pages/8.11/TaskPanelPage.d.ts +26 -0
- package/dist/pages/8.11/TaskPanelPage.js +245 -0
- package/dist/pages/8.11/TaskProcessesPage.d.ts +18 -0
- package/dist/pages/8.11/TaskProcessesPage.js +134 -0
- package/dist/pages/8.11/UtilitiesPage.d.ts +56 -0
- package/dist/pages/8.11/UtilitiesPage.js +1024 -0
- package/dist/pages/8.11/WorkspaceMembersPage.d.ts +21 -0
- package/dist/pages/8.11/WorkspaceMembersPage.js +268 -0
- package/dist/tests/8.11/access-user-role-management.spec.d.ts +1 -0
- package/dist/tests/8.11/access-user-role-management.spec.js +487 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.js +209 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.js +188 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.js +167 -0
- package/dist/tests/8.11/cluster-variables.spec.d.ts +1 -0
- package/dist/tests/8.11/cluster-variables.spec.js +202 -0
- package/dist/tests/8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/connectors-user-flows.spec.js +537 -0
- package/dist/tests/8.11/console-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/console-user-flows.spec.js +199 -0
- package/dist/tests/8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/hto-user-flows.spec.js +358 -0
- package/dist/tests/8.11/idp-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/idp-user-flows.spec.js +316 -0
- package/dist/tests/8.11/login-negative-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/login-negative-tests.spec.js +29 -0
- package/dist/tests/8.11/login.spec.d.ts +1 -0
- package/dist/tests/8.11/login.spec.js +29 -0
- package/dist/tests/8.11/navigation.spec.d.ts +1 -0
- package/dist/tests/8.11/navigation.spec.js +59 -0
- package/dist/tests/8.11/operate-access-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/operate-access-flow.spec.js +136 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +96 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.js +69 -0
- package/dist/tests/8.11/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-api-tests.spec.js +1194 -0
- package/dist/tests/8.11/optimize-collections-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-api.spec.js +184 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.js +46 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.js +195 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.js +306 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.js +316 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.js +337 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.js +198 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.js +146 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.js +208 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js +242 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.js +75 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.js +123 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.js +123 -0
- package/dist/tests/8.11/play.spec.d.ts +1 -0
- package/dist/tests/8.11/play.spec.js +93 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.js +495 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.js +133 -0
- package/dist/tests/8.11/smoke-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/smoke-tests.spec.js +339 -0
- package/dist/tests/8.11/test-setup.spec.d.ts +1 -0
- package/dist/tests/8.11/test-setup.spec.js +256 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.js +523 -0
- package/dist/utils/clusterVersions.d.ts +2 -1
- package/dist/utils/clusterVersions.js +1 -0
- package/dist/utils/consoleApiHelpers.js +1 -0
- package/package.json +1 -1
- package/playwright.config.ts +10 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
type WorkspaceRole = 'Workspace Admin' | 'Editor' | 'Commenter' | 'Viewer';
|
|
3
|
+
declare class WorkspaceMembersPage {
|
|
4
|
+
private page;
|
|
5
|
+
readonly membersTab: Locator;
|
|
6
|
+
readonly manageMembersHeading: Locator;
|
|
7
|
+
readonly addMembersButton: Locator;
|
|
8
|
+
readonly addMemberSearchbox: Locator;
|
|
9
|
+
readonly addMemberSubmitButton: Locator;
|
|
10
|
+
constructor(page: Page);
|
|
11
|
+
showAllWorkspaces(): Promise<void>;
|
|
12
|
+
openManageMembers(workspaceName: string): Promise<void>;
|
|
13
|
+
workspaceId(): string;
|
|
14
|
+
private memberRow;
|
|
15
|
+
isMember(email: string): Promise<boolean>;
|
|
16
|
+
addMember(email: string, role: WorkspaceRole): Promise<void>;
|
|
17
|
+
private selectRoleIn;
|
|
18
|
+
setMemberRole(email: string, role: WorkspaceRole): Promise<void>;
|
|
19
|
+
removeMember(email: string): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export { WorkspaceMembersPage, WorkspaceRole };
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceMembersPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
// Camunda Hub's workspace "Manage members" view: Members / Environments /
|
|
6
|
+
// General tabs over a member table of Name | Email | Workspace role | Joined,
|
|
7
|
+
// an "Add members" panel, and a role cell that becomes a select once clicked.
|
|
8
|
+
//
|
|
9
|
+
// This page matters to the role flows because an organization role alone no
|
|
10
|
+
// longer decides what a non-admin can reach. Since camunda-hub's environments
|
|
11
|
+
// work, an environment -- and so the cluster app behind it -- is visible only
|
|
12
|
+
// to a user who is Editor or Workspace Admin on a workspace it is assigned to
|
|
13
|
+
// (pdp-3715); organization admins and owners see every environment.
|
|
14
|
+
class WorkspaceMembersPage {
|
|
15
|
+
page;
|
|
16
|
+
membersTab;
|
|
17
|
+
manageMembersHeading;
|
|
18
|
+
addMembersButton;
|
|
19
|
+
addMemberSearchbox;
|
|
20
|
+
addMemberSubmitButton;
|
|
21
|
+
constructor(page) {
|
|
22
|
+
this.page = page;
|
|
23
|
+
this.membersTab = page.getByRole('tab', { name: 'Members' });
|
|
24
|
+
this.manageMembersHeading = page.getByRole('heading', {
|
|
25
|
+
name: 'Manage members',
|
|
26
|
+
});
|
|
27
|
+
this.addMembersButton = page
|
|
28
|
+
.locator('[data-test="add-members-button"]')
|
|
29
|
+
.or(page.getByRole('button', { name: 'Add members' }))
|
|
30
|
+
.first();
|
|
31
|
+
// A cmdk combobox: <input cmdk-input role="combobox"
|
|
32
|
+
// aria-label="Search members" placeholder="Search members or enter an
|
|
33
|
+
// email to invite">. Prefer the accessible name over the placeholder,
|
|
34
|
+
// which is the longer and more churn-prone of the two.
|
|
35
|
+
this.addMemberSearchbox = page
|
|
36
|
+
.getByRole('combobox', { name: 'Search members' })
|
|
37
|
+
.or(page.getByPlaceholder('Search members or enter an email to invite'))
|
|
38
|
+
.first();
|
|
39
|
+
// `exact` matters: the panel's own trigger is "Add members", which a
|
|
40
|
+
// substring match on "Add" would also resolve.
|
|
41
|
+
this.addMemberSubmitButton = page.getByRole('button', {
|
|
42
|
+
name: 'Add',
|
|
43
|
+
exact: true,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// Hub's Workspaces overview defaults to "My workspaces" -- only the ones the
|
|
47
|
+
// current user is an explicit member of -- and resets to it on every load,
|
|
48
|
+
// so a workspace created by another user is invisible until the scope is
|
|
49
|
+
// widened. The empty state offers an explicit button; the populated view
|
|
50
|
+
// offers the filter instead. A no-op where neither is rendered.
|
|
51
|
+
async showAllWorkspaces() {
|
|
52
|
+
const switchButton = this.page.getByRole('button', {
|
|
53
|
+
name: 'Switch to All workspaces',
|
|
54
|
+
});
|
|
55
|
+
const scopeFilter = this.page.getByRole('combobox', {
|
|
56
|
+
name: 'Filter workspaces',
|
|
57
|
+
});
|
|
58
|
+
const appeared = await switchButton
|
|
59
|
+
.or(scopeFilter)
|
|
60
|
+
.first()
|
|
61
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
62
|
+
.then(() => true)
|
|
63
|
+
.catch(() => false);
|
|
64
|
+
if (!appeared) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (await switchButton.isVisible().catch(() => false)) {
|
|
68
|
+
await switchButton.click({ timeout: 10000 });
|
|
69
|
+
await (0, test_1.expect)(switchButton).toBeHidden({ timeout: 10000 });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if ((await scopeFilter.innerText()).includes('All workspaces')) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
await scopeFilter.click({ timeout: 10000 });
|
|
76
|
+
await this.page
|
|
77
|
+
.getByRole('option', { name: 'All workspaces' })
|
|
78
|
+
.click({ timeout: 10000 });
|
|
79
|
+
await (0, test_1.expect)(scopeFilter).toContainText('All workspaces', {
|
|
80
|
+
timeout: 10000,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async openManageMembers(workspaceName) {
|
|
84
|
+
// `.first()`: an org can hold several workspaces sharing a name -- the
|
|
85
|
+
// nightly's environments card lists "Cross Component Test Project" twice
|
|
86
|
+
// -- and an unqualified match is then a strict-mode violation.
|
|
87
|
+
const manageButton = this.page
|
|
88
|
+
.getByRole('button', { name: `Manage workspace ${workspaceName}` })
|
|
89
|
+
.first();
|
|
90
|
+
// Keep Hub's default "My workspaces" scope, which is what a real user
|
|
91
|
+
// sees, and widen only when the target is not in it -- e.g. it was
|
|
92
|
+
// created by another user and this one holds no explicit membership.
|
|
93
|
+
const visibleUnderDefaultScope = await manageButton
|
|
94
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
95
|
+
.then(() => true)
|
|
96
|
+
.catch(() => false);
|
|
97
|
+
if (!visibleUnderDefaultScope) {
|
|
98
|
+
await this.showAllWorkspaces();
|
|
99
|
+
}
|
|
100
|
+
await (0, test_1.expect)(manageButton).toBeVisible({ timeout: 60000 });
|
|
101
|
+
await manageButton.click({ timeout: 30000 });
|
|
102
|
+
await (0, test_1.expect)(this.manageMembersHeading).toBeVisible({ timeout: 60000 });
|
|
103
|
+
if ((await this.membersTab
|
|
104
|
+
.getAttribute('aria-selected')
|
|
105
|
+
.catch(() => null)) !== 'true') {
|
|
106
|
+
await this.membersTab.click({ timeout: 30000 });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Valid once openManageMembers has landed on /workspaces/<id>/manage.
|
|
110
|
+
workspaceId() {
|
|
111
|
+
const id = this.page.url().match(/\/workspaces\/([^/?#]+)\/manage/)?.[1];
|
|
112
|
+
if (!id) {
|
|
113
|
+
throw new Error(`Not on a workspace Manage page, cannot read its id: ${this.page.url()}`);
|
|
114
|
+
}
|
|
115
|
+
return decodeURIComponent(id);
|
|
116
|
+
}
|
|
117
|
+
memberRow(email) {
|
|
118
|
+
return this.page.getByRole('row').filter({ hasText: email }).first();
|
|
119
|
+
}
|
|
120
|
+
async isMember(email) {
|
|
121
|
+
return this.memberRow(email)
|
|
122
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
123
|
+
.then(() => true)
|
|
124
|
+
.catch(() => false);
|
|
125
|
+
}
|
|
126
|
+
// Adds a user who is not on the member list yet. The panel is collapsed
|
|
127
|
+
// until its trigger is clicked, and its own "Workspace role" select already
|
|
128
|
+
// defaults to Editor, so it is only driven when a different role is wanted.
|
|
129
|
+
async addMember(email, role) {
|
|
130
|
+
await this.addMembersButton.click({ timeout: 30000 });
|
|
131
|
+
await (0, test_1.expect)(this.addMemberSearchbox).toBeVisible({ timeout: 30000 });
|
|
132
|
+
await this.addMemberSearchbox.click({ timeout: 30000 });
|
|
133
|
+
await this.addMemberSearchbox.fill(email);
|
|
134
|
+
// An org member shows up as a pickable result; picking it is what enables
|
|
135
|
+
// the submit. Typing alone leaves an invite-by-email candidate that some
|
|
136
|
+
// builds require to be committed the same way.
|
|
137
|
+
// cmdk renders its results as [cmdk-item] nodes with role="option",
|
|
138
|
+
// filtered live against what was typed.
|
|
139
|
+
const result = this.page
|
|
140
|
+
.getByRole('option', { name: new RegExp(escapeRegExp(email), 'i') })
|
|
141
|
+
.or(this.page.locator('[cmdk-item]').filter({ hasText: email }))
|
|
142
|
+
.first();
|
|
143
|
+
// The result list is a multi-select, and its checkbox is NOT a checkbox:
|
|
144
|
+
// a trace of the live DOM shows each row as
|
|
145
|
+
// <div cmdk-item role="option" data-staged="false" aria-selected="true">
|
|
146
|
+
// <svg aria-hidden="true"><rect .../></svg> <div>name / email</div>
|
|
147
|
+
// so getByRole('checkbox') matches nothing, and clicking the row only
|
|
148
|
+
// sets cmdk's highlight -- aria-selected and data-selected both read
|
|
149
|
+
// "true" while data-staged stays "false" and "Add" stays disabled.
|
|
150
|
+
// Click the leading svg, which is the box itself, and gate on the one
|
|
151
|
+
// attribute that actually tracks the pick.
|
|
152
|
+
await (0, test_1.expect)(result).toBeVisible({ timeout: 30000 });
|
|
153
|
+
// Neither the row nor its box can be clicked into a staged state: the box
|
|
154
|
+
// is a decorative svg the design system gives `pointer-events: none`, so
|
|
155
|
+
// that click lands on the row, and a row click only moves cmdk's
|
|
156
|
+
// highlight -- across three live runs `data-staged` never left "false"
|
|
157
|
+
// while `aria-selected` read "true" and "Add" stayed disabled. The
|
|
158
|
+
// list's "Select all" control is what actually stages. It is a
|
|
159
|
+
// <button data-test="members-picker-select-all">, not a cmdk item, and
|
|
160
|
+
// its label is split across text nodes ("Select all (", "1", ")"), so it
|
|
161
|
+
// is addressed by its test id. The search box above has already been
|
|
162
|
+
// filled with this one address, so the guard below holds it to exactly
|
|
163
|
+
// the intended user rather than trusting the label's count.
|
|
164
|
+
const candidates = this.page
|
|
165
|
+
.locator('[cmdk-item]')
|
|
166
|
+
.filter({ hasText: email });
|
|
167
|
+
await (0, test_1.expect)(candidates).toHaveCount(1, { timeout: 15000 });
|
|
168
|
+
await this.page
|
|
169
|
+
.locator('[data-test="members-picker-select-all"]')
|
|
170
|
+
.click({ timeout: 15000 });
|
|
171
|
+
// Hub no longer renders `data-staged`: the pick is now reported on the
|
|
172
|
+
// row's own `aria-checked` (its checkbox-visual flips to
|
|
173
|
+
// data-state="checked"). The nightly trace shows it reading "false"
|
|
174
|
+
// before the "Select all" click and "true" right after.
|
|
175
|
+
await (0, test_1.expect)(result).toHaveAttribute('aria-checked', 'true', {
|
|
176
|
+
timeout: 15000,
|
|
177
|
+
});
|
|
178
|
+
if (role !== 'Editor') {
|
|
179
|
+
await this.selectRoleIn(this.page.getByRole('combobox', { name: 'Workspace role' }).first(), role);
|
|
180
|
+
}
|
|
181
|
+
await (0, test_1.expect)(this.addMemberSubmitButton).toBeEnabled({ timeout: 30000 });
|
|
182
|
+
await this.addMemberSubmitButton.click({ timeout: 30000 });
|
|
183
|
+
await (0, test_1.expect)(this.memberRow(email)).toBeVisible({ timeout: 60000 });
|
|
184
|
+
}
|
|
185
|
+
async selectRoleIn(control, role) {
|
|
186
|
+
await control.click({ timeout: 30000 });
|
|
187
|
+
await this.page
|
|
188
|
+
.getByRole('option', { name: role, exact: true })
|
|
189
|
+
.or(this.page.getByRole('menuitem', { name: role, exact: true }))
|
|
190
|
+
.first()
|
|
191
|
+
.click({ timeout: 30000 });
|
|
192
|
+
}
|
|
193
|
+
// Ensures the user holds `role` on this workspace, adding them first when
|
|
194
|
+
// they are not a member at all -- which is the usual case for a role flow,
|
|
195
|
+
// since the shared workspace is created by whichever setup user won the
|
|
196
|
+
// race and nobody else is added to it.
|
|
197
|
+
async setMemberRole(email, role) {
|
|
198
|
+
if (!(await this.isMember(email))) {
|
|
199
|
+
await this.addMember(email, role);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const row = this.memberRow(email);
|
|
203
|
+
if ((await row.getByText(role, { exact: true }).count()) > 0) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
// The role cell renders as a static pill until clicked, then becomes a
|
|
207
|
+
// select with its own confirm control; leaving it unconfirmed silently
|
|
208
|
+
// reverts the row to its previous role.
|
|
209
|
+
const roleControl = row
|
|
210
|
+
.getByRole('combobox')
|
|
211
|
+
.or(row.getByRole('button', {
|
|
212
|
+
name: /^(Workspace Admin|Editor|Commenter|Viewer)$/,
|
|
213
|
+
}))
|
|
214
|
+
.first();
|
|
215
|
+
await roleControl.click({ timeout: 30000 });
|
|
216
|
+
await this.selectRoleIn(roleControl, role);
|
|
217
|
+
// Clicked unconditionally, not behind an `isVisible()` probe: the
|
|
218
|
+
// confirmation is what persists the change, and the control can render a
|
|
219
|
+
// beat after the select. A probe would read `false` in that window, skip
|
|
220
|
+
// the click, and let the assertion below match the still-uncommitted
|
|
221
|
+
// value in the open editor just before the row reverts. Clicking outright
|
|
222
|
+
// makes Playwright wait for the control and fail here when it never
|
|
223
|
+
// arrives, rather than passing on an edit that was never saved.
|
|
224
|
+
await row
|
|
225
|
+
.getByRole('button', { name: /^(Confirm|Save|Apply|Update)$/i })
|
|
226
|
+
.or(row.locator('button[type="submit"]'))
|
|
227
|
+
.first()
|
|
228
|
+
.click({ timeout: 30000 });
|
|
229
|
+
await (0, test_1.expect)(row.getByText(role, { exact: true })).toBeVisible({
|
|
230
|
+
timeout: 60000,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
// Undoes `setMemberRole`/`addMember`. Workspace membership is durable org
|
|
234
|
+
// state: left behind, it survives the test that granted it, so a Playwright
|
|
235
|
+
// retry starts with the user already an Editor and any assertion about the
|
|
236
|
+
// un-granted state fails on the second attempt. A no-op when the user is
|
|
237
|
+
// not on the list, so it is safe to call from teardown after a failure at
|
|
238
|
+
// any point in the flow.
|
|
239
|
+
async removeMember(email) {
|
|
240
|
+
if (!(await this.isMember(email))) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const row = this.memberRow(email);
|
|
244
|
+
// camunda-hub MembersTable.tsx: the row's icon trigger is
|
|
245
|
+
// aria-label="Actions for <name>", data-test="member-actions-trigger".
|
|
246
|
+
await row
|
|
247
|
+
.locator('[data-test="member-actions-trigger"]')
|
|
248
|
+
.or(row.getByRole('button', { name: /^Actions for / }))
|
|
249
|
+
.first()
|
|
250
|
+
.click({ timeout: 30000 });
|
|
251
|
+
await this.page
|
|
252
|
+
.getByRole('menuitem', { name: /^Remove( member)?$/i })
|
|
253
|
+
.or(this.page.getByRole('option', { name: /^Remove( member)?$/i }))
|
|
254
|
+
.first()
|
|
255
|
+
.click({ timeout: 30000 });
|
|
256
|
+
// RemoveMemberDialog.tsx is a Radix AlertDialog, i.e. role="alertdialog",
|
|
257
|
+
// which getByRole('dialog') does not match.
|
|
258
|
+
await this.page
|
|
259
|
+
.getByRole('alertdialog', { name: 'Remove member' })
|
|
260
|
+
.getByRole('button', { name: 'Remove', exact: true })
|
|
261
|
+
.click({ timeout: 30000 });
|
|
262
|
+
await (0, test_1.expect)(row).toBeHidden({ timeout: 60000 });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
exports.WorkspaceMembersPage = WorkspaceMembersPage;
|
|
266
|
+
function escapeRegExp(value) {
|
|
267
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
268
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|