Skip to content
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

chore(e2e): e2e setup for the new content editor #31044

Merged
merged 36 commits into from
Jan 17, 2025

Conversation

nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Jan 2, 2025

Parent Issue

#31033

Proposed Changes

This pull request includes various changes primarily focused on code formatting, adding new locators, and introducing new page classes for the end-to-end tests. The most important changes include reformatting the code for consistency, adding new locators for different elements, and creating new page classes to handle content type forms and listings.

Code Formatting and Consistency:

  • Reformatted the code in e2e/dotcms-e2e-node/frontend/locators/globalLocators.ts and e2e/dotcms-e2e-node/frontend/locators/navigation/menuLocators.ts for better readability and consistency. [1] [2]

New Locators:

  • Added new locators for CONTENT_MODEL in GroupEntriesLocators and adjusted existing locators in ToolEntriesLocators and MenuEntriesLocators in e2e/dotcms-e2e-node/frontend/locators/navigation/menuLocators.ts. [1] [2] [3]

New Page Classes:

  • Introduced ContentTypeFormPage, ListingContentTypesPage, ListingContentPage, NewEditContentFormPage, and TextFieldPage classes to handle various functionalities related to content types and their forms in e2e/dotcms-e2e-node/frontend/pages/. [1] [2] [3] [4] [5]

Package and Script Updates:

  • Added @faker-js/faker dependency and updated the start script to include --ui flag in e2e/dotcms-e2e-node/frontend/package.json. [1] [2]

Test File Adjustments:

  • Reformatted and adjusted the test files for consistency and readability, including contentEditing.spec.ts and contentData.ts in e2e/dotcms-e2e-node/frontend/tests/contentSearch/. [1] [2] [3] [4] [5] [6]

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

Screenshots

Screenshot 2025-01-15 at 12 22 44 PM

This PR fixes: #31033

@nicobytes nicobytes linked an issue Jan 2, 2025 that may be closed by this pull request
4 tasks
@nicobytes nicobytes requested a review from Copilot January 14, 2025 18:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 17 changed files in this pull request and generated 1 comment.

Files not reviewed (11)
  • e2e/dotcms-e2e-node/frontend/package.json: Language not supported
  • e2e/dotcms-e2e-node/frontend/locators/globalLocators.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentEditing.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/utils/contentUtils.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/portletIntegrity.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/login/login.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentData.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/locators/navigation/menuLocators.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/utils/dotCMSUtils.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/utils/api.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/pages/newEditContentForm.page.ts: Evaluated as low risk
Comments suppressed due to low confidence (4)

e2e/dotcms-e2e-node/frontend/tests/editContent/newEditContent.spec.ts:7

  • Ensure that the generated word is valid and appropriate for use as a content type name.
const contentTypeName = faker.lorem.word().toLocaleLowerCase();

e2e/dotcms-e2e-node/frontend/tests/editContent/newEditContent.spec.ts:15

  • [nitpick] Check if this call to goToUrl is necessary as it is called again on line 21.
await listingContentTypesPage.goToUrl();

e2e/dotcms-e2e-node/frontend/tests/editContent/newEditContent.spec.ts:33

  • Ensure that the generated word is valid and appropriate for use as a text field value.
const textFieldValue = faker.lorem.word();

e2e/dotcms-e2e-node/frontend/pages/listngContent.page.ts:0

  • The file name 'listngContent.page.ts' contains a typo. It should be 'listingContent.page.ts'.
index main..branch

@nicobytes nicobytes changed the title 31033 end to end e2e setup for the new content editor e2e setup for the new content editor Jan 14, 2025
@nicobytes nicobytes marked this pull request as ready for review January 14, 2025 19:20
@nicobytes nicobytes requested a review from Copilot January 14, 2025 19:21

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 17 changed files in this pull request and generated no comments.

Files not reviewed (11)
  • e2e/dotcms-e2e-node/frontend/package.json: Language not supported
  • e2e/dotcms-e2e-node/frontend/locators/globalLocators.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentEditing.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/utils/contentUtils.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/portletIntegrity.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentData.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/tests/login/login.spec.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/locators/navigation/menuLocators.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/utils/dotCMSUtils.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/pages/textField.page.ts: Evaluated as low risk
  • e2e/dotcms-e2e-node/frontend/pages/newEditContentForm.page.ts: Evaluated as low risk
Comments suppressed due to low confidence (3)

e2e/dotcms-e2e-node/frontend/pages/listingContentTypes.pages.ts:46

  • [nitpick] The locator 'getByLabel("Content")' might be ambiguous. Consider using a more specific locator to avoid potential issues.
await this.page.getByLabel("Content").locator("a").click();

e2e/dotcms-e2e-node/frontend/pages/listngContent.page.ts:0

  • The filename 'listngContent.page.ts' contains a typo. It should be 'listingContent.page.ts'.
filename

e2e/dotcms-e2e-node/frontend/pages/listngContent.page.ts:5

  • The private fields '#addBtn' and '#addNewContent' should use the 'private' keyword instead of the '#' syntax.
#addBtn = this.page.locator("span[widgetid='dijit_form_DropDownButton_0']");
@nicobytes nicobytes changed the title e2e setup for the new content editor chore(e2e): e2e setup for the new content editor Jan 14, 2025
@nicobytes nicobytes added this pull request to the merge queue Jan 17, 2025
Merged via the queue into main with commit 32195bc Jan 17, 2025
36 checks passed
@nicobytes nicobytes deleted the 31033-end-to-end-e2e-setup-for-the-new-content-editor branch January 17, 2025 15:07
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.

End-to-end (E2E) setup for the new content editor
4 participants