PromucFlow_constructor/app/client/cypress/support/Pages
Shrikant Sharat Kandula 55b6e6d8d8
test: Extract pageId with regex to cover more cases (#34521)
There's a few places in Cypress tests that are trying to extract the
page ID using `.split`, especially with just the path information,
instead of the whole URL. So this PR changes the extraction
implementation to use a regex, to support all three cases we need:

1. Full absolute application+page URL.
2. Just the path of an application+page URL.
3. Just the path of an application with a custom slug.
4. Full absolute application with a custom slug. (Supported, but we
don't need this today).

We've also fixed the URL parsing for the (very) old application URLs
that didn't use slugs in the URL at all. This was making
`FocusEntity.test.ts` fail.

Fixed that test as well as improved it's error reporting.

Before this PR:

![shot-2024-06-27-05-02-16](https://github.com/appsmithorg/appsmith/assets/120119/f3363376-a74d-4f3e-8196-5e72a9e758de)


After this PR:

![shot-2024-06-27-05-03-15](https://github.com/appsmithorg/appsmith/assets/120119/8dc1be04-c60f-4251-acf0-e4fd962f4f00)

No conflicts to EE.

/test all

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9713573983>
> Commit: 49edbce5ae85ee7fe9f4d2df05e2933347ddb3f4
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9713573983&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: ``

<!-- end of auto-generated comment: Cypress test results  -->












<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved URL handling by centralizing page ID extraction logic across
various tests and components.
- Updated deprecated path constants to include ID extraction patterns
for better consistency.
- Enhanced code readability and maintainability by moving page ID
extraction to a helper method.

- **Tests**
- Modified test cases to dynamically set `applicationId` and `pageId`
instead of hardcoding values, ensuring more flexible and maintainable
test scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-02 06:31:59 +05:30
..
Anvil chore: add snapshots for input type widgets (#34436) 2024-06-27 10:51:28 +05:30
AppSettings test: Extract pageId with regex to cover more cases (#34521) 2024-07-02 06:31:59 +05:30
IDE feat: Overflow tabs list view (#34150) 2024-06-25 16:00:41 +05:30
AdminSettings.ts chore: Make edit launch buttons as links & add upgrade ramps for session timeout setting (#31862) 2024-03-21 15:37:13 +05:30
AggregateHelper.ts test: Extract pageId with regex to cover more cases (#34521) 2024-07-02 06:31:59 +05:30
ApiPage.ts chore: remove cypress hardcoded strings and waits (#33513) 2024-05-16 13:38:43 +05:30
AssertHelper.ts test: Cypress | Downgrade Cypress to 13.5.1 (#31011) 2024-02-09 13:33:30 +05:30
AutoLayout.ts fix: missing methods in gitexecutorceimpl (#32614) 2024-04-12 06:21:01 +05:30
Canvas.ts chore: cypress test for canvas view mode (#32354) 2024-04-03 14:52:09 +05:30
CommunityTemplates.ts fix: default port numbers for the datasources (#32901) 2024-04-30 13:15:11 +05:30
DataSources.ts feat: Preliminary set of test cases and test utils for Anvil DnD and Space distribution. (#33827) 2024-05-30 12:46:56 +05:30
DebuggerHelper.ts feat: Collapsible Bottom View (#33441) 2024-05-22 19:43:07 +05:30
DeployModeHelper.ts chore: tests for wds button widget (#34242) 2024-06-20 18:30:16 +05:30
EditorNavigation.ts fix: action selector create flow (#32326) 2024-04-05 11:28:47 +05:30
EntityExplorer.ts feat: New tab ui changes (#33228) 2024-05-15 19:15:49 +05:30
FakerHelper.ts
GitSync.ts test: updated flow for GitSync (#34239) 2024-06-28 10:29:12 +05:30
GSheetHelper.ts test: Gsheet Automation (#25255) 2023-07-26 18:56:24 +05:30
HomePage.ts test: Failing cypress tests due to removal of empty canvas prompts (#34037) 2024-06-07 15:24:07 +05:30
InviteModal.ts test: Cypress | SetWidget property validations + CI Stabilize (#28626) 2023-11-06 15:18:00 +05:30
JSEditor.ts fix: Fix for regression in js query refactor in modules (#34186) 2024-06-13 13:41:14 +05:30
LibraryInstaller.ts chore: App Sidebar testing (#28479) 2023-11-15 08:01:12 +05:30
MultipleEnvironments.ts chore: Multiple Env code split for 1-click (#27275) 2023-09-29 16:16:24 +05:30
Onboarding.ts chore: removed onboarding flags ab_create_new_apps_enabled , ab_start_with_data_default_enabled (#31384) 2024-03-15 11:13:14 +05:30
PageList.ts test: GitSyncedApps_spec - multiple IA changes (#33257) 2024-05-10 15:34:40 +05:30
PartialImportExport.ts chore: unified way of writing messages in cypress (#33659) 2024-05-27 15:34:45 +02:00
PeekOverlay.ts feat: peek overlay nested properties + perf improvements (#23414) 2023-05-26 17:12:10 +05:30
PropertyPane.ts fix: number slider + category slider color spec fails (#32935) 2024-04-29 11:31:46 +05:30
Table.ts test: flay table header validation (#34080) 2024-06-07 18:56:02 +05:30
Tabs.ts test: added tests for Tabs (#27765) 2023-10-05 09:34:41 +05:30
Templates.ts chore: Add spec for create new app from template (#31311) 2024-02-28 14:42:35 +05:30
WDSWidgets.ts fix: Anvil toggleable widgets not working when native callbacks are used for AnvilFlexComponent (#31125) 2024-02-15 11:00:57 +05:30