@bigbinary/neeto-playwright-commons 4.11.4 → 4.11.6

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.
Files changed (3) hide show
  1. package/index.d.ts +6 -1
  2. package/index.js +31 -16
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2990,7 +2990,11 @@ declare class HelpAndProfilePage {
2990
2990
  *
2991
2991
  * Opens the workspace menu from Help Center and verifies the organization settings
2992
2992
  *
2993
- * link opens the admin panel in a new tab.
2993
+ * link points to /auth/organization/edit. On staging it also opens the link and
2994
+ *
2995
+ * verifies it lands on the admin panel, since other environments have no
2996
+ *
2997
+ * NeetoAuth.
2994
2998
  *
2995
2999
  * @example
2996
3000
  *
@@ -6806,6 +6810,7 @@ declare const ROUTES: {
6806
6810
  auth: {
6807
6811
  adminPanel: string;
6808
6812
  billing: string;
6813
+ organizationSettings: string;
6809
6814
  };
6810
6815
  };
6811
6816
  /**
package/index.js CHANGED
@@ -69,6 +69,7 @@ const ROUTES = {
69
69
  auth: {
70
70
  adminPanel: "/admin/admin-panel",
71
71
  billing: "/admin/my/profile/billing",
72
+ organizationSettings: "/auth/organization/edit",
72
73
  },
73
74
  };
74
75
  const API_ROUTES = {
@@ -8077,7 +8078,7 @@ class HelpAndProfilePage {
8077
8078
  await this.page
8078
8079
  .getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
8079
8080
  .click({ timeout: 60_000 });
8080
- process.env.TEST_ENV === ENVIRONMENT.staging &&
8081
+ IS_STAGING_ENV &&
8081
8082
  (await expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
8082
8083
  timeout: 60_000,
8083
8084
  }));
@@ -8243,14 +8244,19 @@ class HelpAndProfilePage {
8243
8244
  await this.page
8244
8245
  .getByTestId(PROFILE_SECTION_SELECTORS.workspaceDisplay)
8245
8246
  .click();
8247
+ const organizationSettingsButton = this.page.getByTestId(PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton);
8248
+ await expect(organizationSettingsButton).toHaveAttribute("href", ROUTES.auth.organizationSettings);
8249
+ if (!IS_STAGING_ENV)
8250
+ return;
8246
8251
  const [workspacePage] = await Promise.all([
8247
8252
  this.page.waitForEvent("popup"),
8248
- this.page
8249
- .getByTestId(PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton)
8250
- .click(),
8253
+ organizationSettingsButton.click(),
8251
8254
  ]);
8252
- await workspacePage.waitForLoadState();
8253
8255
  await expect(workspacePage).toHaveURL(new RegExp(ROUTES.auth.adminPanel));
8256
+ await this.neetoPlaywrightUtilities.waitForPageLoad({
8257
+ customPageContext: workspacePage,
8258
+ });
8259
+ await expect(workspacePage.getByTestId(COMMON_SELECTORS.heading)).toBeVisible();
8254
8260
  await workspacePage.close();
8255
8261
  });
8256
8262
  };
@@ -11356,13 +11362,14 @@ class TagsPage {
11356
11362
  .fill(faker.lorem.word(7));
11357
11363
  await this.page.getByTestId(TAGS_SELECTORS.submitButton).click();
11358
11364
  await this.neetoPlaywrightUtilities.verifyToast();
11359
- await this.searchAndVerifyTags(tagName);
11365
+ await this.neetoPlaywrightUtilities.waitForSheetClose();
11366
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
11360
11367
  };
11361
11368
  filterTagsViaUI = async (tagName) => {
11362
- await this.page
11363
- .getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
11364
- .click();
11365
- await this.page.getByTestId(COMMON_SELECTORS.filterButon).click();
11369
+ const nameBlock = this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFilterNameBlock);
11370
+ const rows = this.page.getByRole("row");
11371
+ const tagRow = this.page.getByRole("row", { name: tagName });
11372
+ await filterUtils.openFilterPaneV2(this.page);
11366
11373
  await this.page
11367
11374
  .getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
11368
11375
  .fill(tagName);
@@ -11370,12 +11377,20 @@ class TagsPage {
11370
11377
  await this.page
11371
11378
  .getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
11372
11379
  .click();
11373
- await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFilterNameBlock)).toBeVisible();
11374
- await expect(this.page.getByRole("row", { name: tagName })).toBeVisible();
11375
- await this.page
11376
- .getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
11377
- .click();
11378
- await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFilterNameBlock)).toBeHidden();
11380
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
11381
+ await Promise.all([
11382
+ expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.filterPaneHeading)).toBeHidden(),
11383
+ expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible(),
11384
+ expect(nameBlock).toContainText(tagName),
11385
+ expect(tagRow).toBeVisible(),
11386
+ expect(rows).toHaveCount(2),
11387
+ ]);
11388
+ await filterUtils.clearFiltersFromActionBlock(this.page);
11389
+ await Promise.all([
11390
+ expect(nameBlock).toBeHidden(),
11391
+ expect(tagRow).toBeVisible(),
11392
+ expect(rows).not.toHaveCount(2),
11393
+ ]);
11379
11394
  };
11380
11395
  editTagViaUI = async ({ tagName, newTagName, }) => {
11381
11396
  await this.page
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-playwright-commons",
3
- "version": "4.11.4",
3
+ "version": "4.11.6",
4
4
  "description": "A package encapsulating common playwright code across neeto projects.",
5
5
  "repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
6
6
  "license": "apache-2.0",