Skip to content

feat(enterprise): adds new team members permission tests (3569..2579) - #873

Merged
daniel-herrero merged 1 commit into
mainfrom
dherrero/feature/new-team-members-permissions
Sep 25, 2026
Merged

daniel-herrero merged 1 commit into
mainfrom
dherrero/feature/new-team-members-permissions

Conversation

@daniel-herrero

@daniel-herrero daniel-herrero commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Implements PENPOT-3569/3571/3573/3574/3576/3577/3579 — the "New team members (Permission)" Advanced Permissions suite — in admin-console/advanced-permissions-new-team-members.spec.ts. All 7 cases were previously test.skip stubs.

Solution

  • Grouped the 7 cases into 4 tests by shared mechanism: restricting new members + revoking pending invites (3569+3571), a team admin blocked from inviting non-members (3573+3574), the org picker disabling an ineligible destination org (3576+3579), and a still-eligible restricted org warning before canceling external invites (3577).
  • 3576/3577/3579 use real multi-account scenarios matching each case's actual named users, rather than one account standing in for several roles.
  • Fixed Qase case 3576's precondition (team owner needs to be a member of both orgs involved, not just the destination one — confirmed live that a disabled org still requires membership to appear at all).
  • Found and fixed several genuine, reproducible bugs surfaced by extensive repeated local/remote runs — not blanket retries, each traced to a specific root cause:
    • clickOrganizationMembersOnlyExpectingWarning() could silently report success without ever confirming the warning panel appeared, if the radio was checked before the panel rendered.
    • A shared hydration race (element detached from the DOM) affecting every TeamPage method that opens the team options menu — deduplicated into one self-healing openTeamOptionsMenuItem() used by all of them.
    • switchTeam() had no recovery when a click landed back on Personal Projects instead of the target team; hardened to retry the click itself, not just the switcher list.
    • Creating a second org via the Admin Console's switcher can leave a subsequent read (e.g., an invite's membership check) seeing the previous org's stale cache — extracted into createSecondOrgFromAdminConsole() (also applied to navigation.spec.ts, which had the same unguarded pattern).
    • A second account's session can be stale relative to a permission the owner just changed — needs an explicit reload, not just time.
  • Refactored TeamPage.addTeamToOrganization()/changeTeamOrganization() to share new granular steps — both used by other, already-passing specs, re-verified green.
  • Addressed Copilot's automated review: two genuine issues fixed (a regressed duplicate retry loop in openTeamSettingsPageViaOptionsMenu(), and a missing invitation-visibility gate in 3577's setup — the same class of fix already applied to 3569/3571). The third flagged issue (missing baseURL on manually-created contexts) was investigated and empirically disproven — Playwright Test's browser fixture does thread baseURL through to contexts created via browser.newContext().
  • While addressing that, centralized several duplicated raw-URL navigations into proper POM methods: TeamPage.goToTeamDashboard(teamId) and ProfilePage.goToSubscriptionsPage(), plus wider reuse of createSecondOrgFromAdminConsole() — replacing 10+ scattered call sites across 5 files (some in other already-merged specs) with named, BASE_URL-explicit methods.
  • Second Copilot review round: one more false positive investigated and confirmed via the same proven mechanism (a different fixture's manually-created context), and one more genuine gap closed — deleteTeam()/renameTeam() were still using their own unguarded click instead of the shared self-healing helper, now routed through it too; openTeamOptionsMenu() is the one intentional exception (no destination item, so it doesn't fit the helper's contract), documented as such rather than force-fit.
  • Replaced remaining raw relative-URL navigations with explicit, BASE_URL-based POM methods for consistency: OrganizationPage.goto() and TeamPage.goto() (both mirroring the existing LoginPage.goto()/ProfilePage.goToAccountPage() pattern), on top of the goToTeamDashboard()/goToSubscriptionsPage() additions already mentioned above.

How to test

  • Check the code
  • Update the test case in Qase (Automation Status field or steps changed)
  • It complies with the test conventions
  • There are no missing snapshots
  • The tests run OK

Screenshots 📸 (optional)

0 hard failures across all 20 executions (4 tests x5 runs), and the flaky rates (1-2 out of 5 per test) match exactly an occasional backend propagation delay.

image

Local test run

image

Anything Else? (optional)

One known, accepted residual: 3573,3574 still shows occasional flakiness under real concurrent load (an invite-enforcement check between two accounts) that a reload() reduces but doesn't fully eliminate — traced to genuine backend propagation timing, not a test defect, and not worth further test-side complexity for a rare case.

Addressed Copilot's automated review (2 real fixes, 1 investigated and disproven with an empirical test). Merging now and watching Monday's regular regression run for real-world confirmation on the one known residual (3573,3574's load-sensitive flakiness, described above).

A separate PR (#878) fixes an unrelated playwright.config.ts timeout bug found along the way.

@daniel-herrero daniel-herrero self-assigned this Sep 21, 2026
@daniel-herrero daniel-herrero changed the title feat(enterprise): adds new team members permission suit (PENPOT 3569-… feat(enterprise): adds new team members permission tests (PENPOT 3569-2579) Sep 21, 2026
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch 6 times, most recently from 74330cc to dfe2127 Compare September 22, 2026 10:06
@daniel-herrero daniel-herrero changed the title feat(enterprise): adds new team members permission tests (PENPOT 3569-2579) feat(enterprise): adds 7 new team members permission tests (3569..2579) Sep 22, 2026
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from dfe2127 to 57723b2 Compare September 22, 2026 10:18
@daniel-herrero daniel-herrero changed the title feat(enterprise): adds 7 new team members permission tests (3569..2579) feat(enterprise): adds new team members permission tests (3569..2579) Sep 22, 2026
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch 2 times, most recently from 6c1809c to c5e1aec Compare September 23, 2026 05:24
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch 4 times, most recently from 4626314 to f0e62a4 Compare September 23, 2026 09:45
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from f0e62a4 to edc71ad Compare September 23, 2026 12:43
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch 4 times, most recently from 14d621c to 5d4c998 Compare September 24, 2026 06:34
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from 5d4c998 to 6db30f7 Compare September 24, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A critical navigation-context issue and multiple moderate synchronization/assertion issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Adds Enterprise Advanced Permissions coverage for seven “New team members” cases, replacing skipped tests with grouped multi-account scenarios.

Changes:

  • Adds permission, invitation, and organization-move test coverage.
  • Improves team navigation, invitation assertions, Gmail polling, and organization setup helpers.
  • Updates Enterprise documentation and related tests.
File Summary / review notes
tests/​enterprise/​README.md Updates Enterprise coverage documentation.
tests/​enterprise/​admin-console/​people-members-remove.spec.ts Clarifies invitation-count synchronization.
tests/​enterprise/​admin-console/​navigation.spec.ts Uses the shared second-organization helper.
tests/​enterprise/​admin-console/​advanced-permissions-new-team-members.spec.ts Adds permission scenarios. Critical: manually created context lacks baseURL (line 201). Moderate: invitation visibility and empty-state waits are insufficient (lines 103, 443, 483).
pages/​dashboard/​team-page.js Adds team and invitation handling. Moderate: duplicates the team-menu retry loop instead of reusing the shared helper (line 862).
pages/​admin-console/​advanced-permissions-page.ts Adds restriction-warning interactions.
helpers/​organizations/​create-second-org-from-admin-console.ts Centralizes second-organization creation. Nit: incomplete comment wording (line 7).
helpers/​gmail.js Refactors message-count polling helpers.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/enterprise/admin-console/advanced-permissions-new-team-members.spec.ts Outdated
Comment thread pages/dashboard/team-page.js Outdated
Comment thread tests/enterprise/admin-console/advanced-permissions-new-team-members.spec.ts Outdated
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from 6a36330 to 07ad171 Compare September 25, 2026 05:47
@daniel-herrero
daniel-herrero requested a lite review from Copilot September 25, 2026 05:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Resolve the critical manual-context navigation failure and complete the shared team-menu helper coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (3)

Comment thread tests/enterprise/admin-console/advanced-permissions-new-team-members.spec.ts Outdated
Comment thread pages/dashboard/team-page.js
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from 07ad171 to cd482d6 Compare September 25, 2026 06:16
@daniel-herrero
daniel-herrero requested a lite review from Copilot September 25, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Update switchTeam() to use explicit base-URL navigation in its retry path; the helper comment also needs clarification.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread pages/dashboard/team-page.js
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from cd482d6 to 6a87fc8 Compare September 25, 2026 07:09
@daniel-herrero
daniel-herrero requested a lite review from Copilot September 25, 2026 07:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A critical navigation issue can prevent the 3573/3574 scenarios from running; documentation and comment nits also remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from 6a87fc8 to e9207f8 Compare September 25, 2026 07:29
@daniel-herrero
daniel-herrero marked this pull request as ready for review September 25, 2026 07:29
@estefafdez
estefafdez self-requested a review September 25, 2026 07:33
Comment thread tests/enterprise/admin-console/advanced-permissions-new-team-members.spec.ts Outdated
Comment thread pages/dashboard/team-page.js Outdated
@daniel-herrero
daniel-herrero force-pushed the dherrero/feature/new-team-members-permissions branch from e9207f8 to a34b633 Compare September 25, 2026 08:56

@estefafdez estefafdez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@daniel-herrero
daniel-herrero merged commit bfdc838 into main Sep 25, 2026
@daniel-herrero
daniel-herrero deleted the dherrero/feature/new-team-members-permissions branch September 25, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants