-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GDB-7784 implement show saved queries action (#44)
* GDB-7784 implement show saved queries action ## What Introduce a show saved queries action. ## Why Save query action exists in current implementation in the GDB WB. It allows the user to load and see the available saved queries then for each query additional actions can be performed, e.g. select, edit, delete. ## How * Add custom button in the yasqe buttons extension point. The button rises an event for loading of the saved queries. Handling of this event is responsibility of the client who then must set the queries list in the config. Setting the queries in the config triggers the popup to appear. * Add a saved queries popup which implements the visualization of the saved queries list. Each saved query is represented as a link and can be selected via click which then opens the query in a new yasgui tab. The dialog can be closed via click outside. * Implemented tests. * Fix review notes. Changed the model of the saved query response in order to be more convenient and readable. Improved styling of the saved queries popup. * Fixed test
- Loading branch information
1 parent
08954a2
commit 1870d6c
Showing
23 changed files
with
633 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import {YasqeSteps} from "../../steps/yasqe-steps"; | ||
import {QueryStubs} from "../../stubs/query-stubs"; | ||
import ActionsPageSteps from "../../steps/actions-page-steps"; | ||
import {YasguiSteps} from "../../steps/yasgui-steps"; | ||
|
||
describe('Show saved queries action', () => { | ||
beforeEach(() => { | ||
QueryStubs.stubDefaultQueryResponse(); | ||
// Given I have opened a page with the yasgui | ||
// And there is an open tab with sparql query in it | ||
ActionsPageSteps.visit(); | ||
}); | ||
|
||
it('Should open a popup with the saved queries list', () => { | ||
// When I click on show saved queries button | ||
YasqeSteps.showSavedQueries(); | ||
// Then I expect that a popup with a saved queries list to be opened | ||
YasqeSteps.getSavedQueriesPopup().should('be.visible'); | ||
YasqeSteps.getSavedQueries().should('have.length', 12); | ||
YasqeSteps.verifySavedQueries([ | ||
{queryName: 'Add statements'}, | ||
{queryName: 'Clear graph'}, | ||
{queryName: 'new query'}, | ||
{queryName: 'q1'}, | ||
{queryName: 'q2'}, | ||
{queryName: 'q3'}, | ||
{queryName: 'q4'}, | ||
{queryName: 'q5'}, | ||
{queryName: 'q6'}, | ||
{queryName: 'q7'}, | ||
{queryName: 'q8'}, | ||
{queryName: 'q9'} | ||
]); | ||
}); | ||
|
||
it('Should be able to select a query from the list', () => { | ||
// Given I have opened the saved queries popup | ||
YasqeSteps.showSavedQueries(); | ||
YasqeSteps.getSavedQueriesPopup().should('be.visible'); | ||
// When I select a query from the list | ||
YasqeSteps.selectSavedQuery(1); | ||
// Then I expect that the popup should be closed | ||
YasqeSteps.getSavedQueriesPopup().should('not.exist'); | ||
// And the query will be populated in a new tab in the yasgui | ||
YasguiSteps.getTabs().should('have.length', 2); | ||
YasguiSteps.getCurrentTab().should('contain', 'Clear graph'); | ||
YasqeSteps.getTabQuery(1).should('equal', 'CLEAR GRAPH <http://example>'); | ||
}); | ||
|
||
it('Should be able to close the popup by clicking outside', () => { | ||
// Given I have opened the saved queries popup | ||
YasqeSteps.showSavedQueries(); | ||
YasqeSteps.getSavedQueriesPopup().should('be.visible'); | ||
// When I click outside of the popup | ||
cy.get('body').click(); | ||
// Then the popup should be closed | ||
YasqeSteps.getSavedQueriesPopup().should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.