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

[3982] Add support for command palette #4011

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
npx yalc add @eclipse-sirius/sirius-components-formdescriptioneditors
npx yalc add @eclipse-sirius/sirius-components-forms
npx yalc add @eclipse-sirius/sirius-components-gantt
npx yalc add @eclipse-sirius/sirius-components-omnibox
npx yalc add @eclipse-sirius/sirius-components-portals
npx yalc add @eclipse-sirius/sirius-components-widget-reference
npx yalc add @eclipse-sirius/sirius-components-selection
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ description (optional).
** updateProject (`PUT /projects/{projectId}`): Update the project with the given id (projectId).
- https://github.com/eclipse-sirius/sirius-web/issues/3873[#3873] [diagram] Make the Selection Dialog available for the EdgeTool
- https://github.com/eclipse-sirius/sirius-web/issues/3950[#3950] [diagram] Have the multiple selection on the Selection Dialog
- https://github.com/eclipse-sirius/sirius-web/issues/3982[#3982] [core] Add support for the command palette.


=== Improvements

Expand Down Expand Up @@ -113,7 +115,7 @@ This will allow specifier to create images that fir perfectly in the project tem
- https://github.com/eclipse-sirius/sirius-web/issues/3816[#3816] [form] Make EMF default form support Integer null value
- https://github.com/eclipse-sirius/sirius-web/issues/3826[#3826] [form] Make EMF default form support attributes with a date
- https://github.com/eclipse-sirius/sirius-web/issues/2163[#2163] [form] Make EMF default form support non changeable features
- https://github.com/eclipse-sirius/sirius-web/issues/4086[#4086] [form] Wrap widget returned by property section in a div with a specific classname
- https://github.com/eclipse-sirius/sirius-web/issues/4086[#4086] [form] Wrap widget returned by property section in a div with a specific classname


== v2024.9.0
Expand Down
41 changes: 41 additions & 0 deletions integration-tests/cypress/e2e/project/omnibox.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/

import { Project } from '../../pages/Project';
import { Flow } from '../../usecases/Flow';
import { Explorer } from '../../workbench/Explorer';
import { Omnibox } from '../../workbench/Omnibox';

const projectName = 'Cypress - Omnibox';
describe('Project - Omnibox', () => {
context('Given a Robot flow project', () => {
let projectId: string = '';
beforeEach(() => {
new Flow().createRobotProject(projectName).then((createdProjectData) => {
projectId = createdProjectData.projectId;
new Project().visit(projectId);
});
});

afterEach(() => cy.deleteProject(projectId));

it('Then the omnibox can be display and used to select an element in the workbench', () => {
const explorer = new Explorer();
const omnibox = new Omnibox(projectName);
omnibox.display();
omnibox.sendQuery('').findByTestId('DSP').click();
omnibox.shouldBeClosed();
explorer.getSelectedTreeItems().contains('DSP').should('exist');
});
});
});
50 changes: 50 additions & 0 deletions integration-tests/cypress/workbench/Omnibox.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/

export class Omnibox {
constructor(readonly projectName: string) {}

private getOmnibox(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getByTestId('omnibox');
}

public display(): Cypress.Chainable<JQuery<HTMLElement>> {
cy.getByTestId(`navbar-${this.projectName}`).should('exist');
cy.get('body').type('{ctrl+k}');
cy.getByTestId('omnibox').should('exist');
return this.getOmnibox();
}

public sendQuery(query: string, hasResult: boolean = true): Cypress.Chainable<JQuery<HTMLElement>> {
if (query !== '') {
this.getOmnibox().find('.MuiInputBase-input').type(`${query}`);
}
this.getOmnibox().findByTestId('submit-query-button').should('not.be.disabled');
this.getOmnibox().find('.MuiInputBase-input').type('{enter}');

this.getOmnibox().find('.MuiList-root').findByTestId('fetch-omnibox-result').should('not.exist');
if (hasResult) {
this.getOmnibox().find('.MuiList-root').findByTestId('omnibox-no-result').should('not.exist');
} else {
this.getOmnibox().find('.MuiList-root').findByTestId('omnibox-no-result').should('exist');
}

this.getOmnibox().findByTestId('submit-query-button').should('be.disabled');

return this.getOmnibox().find('.MuiList-root');
}

public shouldBeClosed(): void {
cy.getByTestId('omnibox').should('not.exist');
}
}
Loading
Loading