From 1491513f6c16fae6268f42e5ab1261a984438485 Mon Sep 17 00:00:00 2001 From: duncdrum Date: Fri, 21 May 2021 15:24:03 +0200 Subject: [PATCH] ignore(_specs): refactor logging start new operations spec see #413 #403 --- cypress/integration/01_connection_spec.js | 2 +- cypress/integration/02_api-spec.js | 6 +- cypress/integration/03_eval_spec.js | 4 +- cypress/integration/04_operations_spec.js | 68 +++++++++++++++++++++++ 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 cypress/integration/04_operations_spec.js diff --git a/cypress/integration/01_connection_spec.js b/cypress/integration/01_connection_spec.js index 124c0477..b0695b55 100644 --- a/cypress/integration/01_connection_spec.js +++ b/cypress/integration/01_connection_spec.js @@ -1,5 +1,5 @@ /// -context('Fusion Studio', () => { +context('Connecting to Servers', () => { describe('Connection Dialogue', () => { after(() => { // cleanup connections after test diff --git a/cypress/integration/02_api-spec.js b/cypress/integration/02_api-spec.js index 3c8705d0..5b4b4ad7 100644 --- a/cypress/integration/02_api-spec.js +++ b/cypress/integration/02_api-spec.js @@ -1,8 +1,8 @@ /// -context('Fusion Studio', function () { - describe('API version', function () { - it('should connect with newer api', function () { +context('Talking to the api directly', () => { + describe('API version', () => { + it('should connect with newer api', () => { cy.visit('/') // TODO: Why does this have UUID is the ID stable, this needs a meaningful selector .get('#d184cace-9938-4ad5-b8df-925a91942661') diff --git a/cypress/integration/03_eval_spec.js b/cypress/integration/03_eval_spec.js index c8567daa..126a79f3 100644 --- a/cypress/integration/03_eval_spec.js +++ b/cypress/integration/03_eval_spec.js @@ -1,5 +1,5 @@ /// -context('Fusion Studio', () => { +context('Evaluation', () => { before(() => { cy.visit('/') .get('#theia-top-panel') @@ -7,7 +7,7 @@ context('Fusion Studio', () => { .get('.theia-preload').should('not.exist') }) - describe('Evaluation panel', () => { + describe('The Theia Panel', () => { it('should be accessible from command panel', () => { // invoke command panel and run the command cy.get('body').trigger('keydown', { keyCode: 112, which: 112 }) diff --git a/cypress/integration/04_operations_spec.js b/cypress/integration/04_operations_spec.js new file mode 100644 index 00000000..c69f276b --- /dev/null +++ b/cypress/integration/04_operations_spec.js @@ -0,0 +1,68 @@ +/// +context('Basic Operations', () => { + describe('working with tree view', () => { + before(() => { + cy.connect() + }) + + describe('db context menu', () => { + // TODO #413 + it('should display creation options', () => { + cy.visit('/') + cy.get('.ReactVirtualized__Grid') + .should('be.visible') + cy.get('.fusion-item') + .click() + // all we need is the final part of the node-id attribute + cy.get('[node-id$=db]') + .rightclick() + // TODO(DP): see if not using then allows for better flow + .then(() => { + cy.get('.p-Menu') + .should('be.visible') + .contains('New document') + .trigger('mousemove') + cy.get('[data-command="fusion.new-document"] > .p-Menu-itemLabel') + .should('be.visible') + .click() + }) + // TODO(DP): + // - add test for #413, + // - check if tree view is deselected, + // - check if Explorer is updated properly, + // - check if editor window is opening the newly create doc in a new tab + // - two routes one with follow-up dialog (xquery lib) one without (txt, xml) + }) + + // Get rid of this: + // cy.addDocument(mkApiPathUrl('admin', '/db/test_col'), 'text_file.txt'); + + it.skip('should let users create documents', () => { + cy.get('[node-id$=db]') + .click() + .type('{enter}') + .contains('untitled') + }) + }) + }) + + describe('working with collections', () => { + it.skip('should create a connection', () => { + cy.visit('/') + // see it in action + cy.get('.ReactVirtualized__Grid') + .should('be.visible') + .should('contain', 'localhost') + cy.get('.fusion-item') + .click() + .then(() => { + cy.get('.ReactVirtualized__Grid__innerScrollContainer') + .should('contain', 'db') + .should('contain', 'RestXQ') + }) + }) + + }) + + +}) \ No newline at end of file