8000 feat: create e2e tests for organization custom roles page by jaaydenh · Pull Request #15814 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: create e2e tests for organization custom roles page #15814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use different org name for test
  • Loading branch information
jaaydenh committed Dec 10, 2024
commit 1ef60fc2df6561f4857992f9873da047ae80297e
8 changes: 4 additions & 4 deletions site/e2e/tests/deployment/idpOrgSync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test.describe("IdpOrgSyncPage", () => {
requiresLicense();
await setupApiCalls(page);

await createOrganizationWithName("developers");
await createOrganizationWithName("admins");

await page.goto("/deployment/idp-org-sync", {
waitUntil: "domcontentloaded",
Expand All @@ -135,7 +135,7 @@ test.describe("IdpOrgSyncPage", () => {

// Select Coder organization from combobox
await orgSelector.click();
await page.getByRole("option", { name: "developers" }).click();
await page.getByRole("option", { name: "admins" }).click();

// Add button should now be enabled
await expect(addButton).toBeEnabled();
Expand All @@ -146,12 +146,12 @@ test.describe("IdpOrgSyncPage", () => {
const newRow = page.getByTestId("idp-org-new-idp-org");
await expect(newRow).toBeVisible();
await expect(newRow.getByText("new-idp-org")).toBeVisible();
await expect(newRow.getByText("developers")).toBeVisible();
await expect(newRow.getByText("admins")).toBeVisible();

await expect(
page.getByText("Organization sync settings updated."),
).toBeVisible();

await deleteOrganization("developers");
await deleteOrganization("admins");
});
});
16 changes: 8 additions & 8 deletions site/e2e/tests/organizations/customRoles/customRoles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.describe("CustomRolesPage", () => {
requiresLicense();
await setupApiCalls(page);

const org = await createOrganizationWithName("developers");
const org = await createOrganizationWithName("users");

const customRole = await createCustomRole(org.id, "custom-role-test-1", "Custom Role Test 1");

Expand Down Expand Up @@ -78,14 +78,14 @@ test.describe("CustomRolesPage", () => {

await expect(page).toHaveURL(`/organizations/${org.name}/roles`);

await deleteOrganization("developers");
await deleteOrganization("users");
});

test("displays built-in role without edit/delete options", async ({ page }) => {
requiresLicense();
await setupApiCalls(page);

const org = await createOrganizationWithName("developers");
const org = await createOrganizationWithName("testers");

await page.goto(`/organizations/${org.name}/roles`);

Expand All @@ -97,14 +97,14 @@ test.describe("CustomRolesPage", () => {
// Verify that the more menu (three dots) is not present for built-in roles
await expect(roleRow.getByRole("button", { name: "More options" })).not.toBeVisible();

await deleteOrganization("developers");
await deleteOrganization("testers");
});

test("create custom role with UI", async ({ page }) => {
requiresLicense();
await setupApiCalls(page);

const org = await createOrganizationWithName("developers");
const org = await createOrganizationWithName("contractors");

await page.goto(`/organizations/${org.name}/roles`);

Expand All @@ -128,14 +128,14 @@ test.describe("CustomRolesPage", () => {
await expect(roleRow.getByText(customRoleDisplayName)).toBeVisible();
await expect(roleRow.getByText("None")).toBeVisible();

await deleteOrganization("developers");
await deleteOrganization("contractors");
});

test("delete custom role", async ({ page }) => {
requiresLicense();
await setupApiCalls(page);

const org = await createOrganizationWithName("developers");
const org = await createOrganizationWithName("custom1");
const customRole = await createCustomRole(org.id, "custom-role-test-1", "Custom Role Test 1");
await page.goto(`/organizations/${org.name}/roles`);

Expand All @@ -151,7 +151,7 @@ test.describe("CustomRolesPage", () => {

await expect(page.getByText("Custom role deleted successfully!")).toBeVisible();

await deleteOrganization("developers");
await deleteOrganization("custom1");
});

// test("shows paywall when custom roles not enabled", async ({ page }) => {
Expand Down
Loading
0