PromucFlow_constructor/app/client/cypress/locators/HomePage.js
Rahul Barwal 756d1083ec
feat: Adds support for showing navbar in embedded view. (#23725)
## Description

- Adds support for query param navbar. We will show navbar and user
settings in the embedded view based on this.
- Made sure that user profile settings are not visiblie in embedded view
when navbar=true
- Adds logic to let user decide Template iframe URL. Till now, we forced
`embed=true` flag, moving forward we let this on user(devrel's)
descretion.
- Adds correct url for embed settings tab.

- Adds relevant tests for both embed settings and appview.

#### PR fixes following issue(s)
Fixes #23559

#### Media

| App normal preview | ?embed=true | ?embed=true&navbar=true |
|----------|:-------------:|------:|
| ![Screenshot 2023-05-26 at 3 08 16
PM](https://github.com/appsmithorg/appsmith/assets/6761673/019bbefd-719f-4f18-9373-77abac789fa2)
| ![Screenshot 2023-05-26 at 3 08 39
PM](https://github.com/appsmithorg/appsmith/assets/6761673/292035ec-5a2c-4139-ae86-119a872bae58)
| ![Screenshot 2023-05-26 at 3 08 59
PM](https://github.com/appsmithorg/appsmith/assets/6761673/a0a7fb8d-0f9f-42a7-b909-272e5ac310ad)
|

#### Type of change
- New feature (non-breaking change which adds functionality)

## Testing
- [ ] Cypress
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-06-05 19:37:39 +05:30

104 lines
5.0 KiB
JavaScript

export default {
CreateApp: "span[class='bp3-button-text']",
searchInput: "input[type='text']",
appEditIcon: ".t--application-edit-link",
publishButton: ".t--application-publish-btn",
shareButton: ".t--application-share-btn",
deployPopupOptionTrigger: ".t--deploy-popup-option-trigger",
connectToGitBtn: ".t--connect-to-git-btn",
currentDeployedPreviewBtn: ".t--current-deployed-preview-btn",
publishCrossButton: "span[icon='small-cross']",
homePageID: "//div[@id='root']",
appMoreIcon: ".t--application-card .ads-v2-button__content",
forkAppFromMenu: "[data-testid=t--fork-app]",
exportAppFromMenu: "[data-testid=t--export-app]",
forkAppWorkspaceButton: ".t--fork-app-to-workspace-button",
selectAction: "#Base",
deleteApp: "[data-testid=t--delete]",
createNewAppButton: ".t--new-button",
deleteAppConfirm: "[data-testid=t--delete-confirm]",
homeIcon: ".t--appsmith-logo",
inputAppName: "input[name=applicationName]",
createNew: ".createnew",
createWorkspace: "span:contains('New workspace')",
inputWorkspaceName: "//input[@name='name']",
submitBtn: "//span[text()='Submit']",
workspaceMenu: "//span[text()='TestShareWorkspace']",
members: "//span[contains(text(),'Members')]",
share: "//span[contains(text(),'Share')]",
WorkspaceSettings: "//span[contains(text(),'Workspace Settings')]",
MemberSettings: "//span[contains(text(),'Members')]",
inviteUser: "//span[text()='Invite Users']",
inviteUserMembersPage: "[data-testid=t--page-header-input]",
email: "//input[@type='email']",
selectRole: "[data-testid='t--invite-role-input']",
adminRole: `//div[contains(@class, 'rc-select-item-option-content')]//span[1][text()='Administrator']`,
viewerRole:
"//div[contains(@class, 'rc-select-item-option-content')]//span[1][text()='App Viewer']",
developerRole:
"//div[contains(@class, 'rc-select-item-option-content')]//span[1][text()='Developer']",
inviteBtn: "//button//span[text()='Invite']",
manageUsers: ".manageUsers",
DeleteBtn: "[data-testid=t--deleteUser]",
ShareBtn: "//button//span[2][text()='Share']",
launchBtn: "//span[text()='Launch']",
appView: ".t--application-view-link",
applicationCard: ".t--application-card",
appsContainer: ".t--applications-container",
appHome: "//a[@href='/applications']",
emailList: "[data-colindex='0']",
workspaceList: ".t--workspace-section:contains(",
workspaceSectionBtn: ".t--workspace-section .bp3-button",
shareWorkspace: ") button:contains('Share')",
workspaceSection: "a:contains(",
createAppFrWorkspace: ") .t--new-button",
shareApp: ".t--application-share-btn",
enablePublicAccess:
"//div[contains(@class, 't--share-public-toggle')]//input[@role='switch']",
enablePublicAccessSettingsPage: "[data-testid=t--embed-settings-application-public]",
switchLabel: ".ads-v2-switch__label",
closeBtn: ".ads-v2-modal__content-header-close-button",
editModeInviteModalCloseBtn: ".ads-v2-modal__content-header-close-button",
applicationName: ".t--application-name",
applicationEditMenu: ".ads-v2-menu__menu-item-children",
editingAppName: "bp3-editable-text-editing",
portalMenuItem: ".ads-v2-menu__menu-item-children",
profileMenu: ".t--profile-menu-icon",
signOutIcon: ".t--sign-out",
headerAppSmithLogo: ".t--Appsmith-logo-image",
applicationCardName: "[data-testid=t--app-card-name]",
applicationIconSelector: ".t--icon-not-selected",
applicationColorSelector: ".t--color-not-selected",
applicationBackgroundColor: ".t--application-card-background",
workspaceSettingOption: "[data-testid=t--workspace-setting]",
workspaceImportAppOption: "[data-testid=t--workspace-import-app]",
workspaceImportAppModal: ".t--import-application-modal",
workspaceImportAppButton: "[data-testid=t--workspace-import-app-button]",
leaveWorkspaceConfirmModal: ".t--member-delete-confirmation-modal",
leaveWorkspaceConfirmButton: "[data-testid=t--workspace-leave-button]",
workspaceNameInput: "[data-testid=t--workspace-name-input]",
renameWorkspaceInput: ".t--workspace-rename-input",
workspaceEmailInput: "[data-testid=t--workspace-email-input]",
workspaceWebsiteInput: "[data-testid=t--workspace-website-input]",
workspaceHeaderName: "[data-testid='t--page-title']",
leftPanelContainer: "[data-testid=t--left-panel]",
themeText: "label div",
shareUserIcons: ".t--workspace-share-user-icons",
toastMessage: "div.Toastify__toast",
uploadLogo: "//div/form/input",
removeLogo: ".remove-button a span",
generalTab: "//li//span[text()='General']",
membersTab: "//li//span[text()='Members']",
cancelBtn: "//span[text()='Cancel']",
submit: "button:contains('Submit')",
workspaceNamePopover: ".ads-v2-button__content-icon-start",
workspaceNamePopoverContent: ".ads-v2-menu",
workspaceCompleteSection: ".t--workspace-section",
workspaceNameText: ".t--workspace-name-text",
workspaceHeading: "//span[text()='Workspaces']",
optionsIcon: ".t--options-icon",
reconnectDatasourceModal: "[data-testid='reconnect-datasource-modal']",
importAppProgressWrapper: ".t-import-app-progress-wrapper",
backtoHome: ".t--app-viewer-back-to-apps-button",
};